You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
これはi18n対応のために i18next と react-i18next を使ってみた備忘録となる。 目次 目次 Reactアプリでのi18n対応(国際化/多言語対応)にi18nextを使ってみる react-intlとi18next サンプルアプリの雛形生成 create-react-appでブラウザが勝手に立ち上がらないようにする react-i18nextのセットアップ HOCで使う場合はwithTranslationを使う hookで使う場合はuseTranslationを使う namespacesについて translation というnamespaceの挙動について translationを言語のテキストファイルに含めたくない場合 言語を切り替える機能を実装する 翻訳した言語の管理方法 Transを用いて、HTMLタグが使われている箇所を多言語化する addResourceB
年末〜年始にかけて、React with i18n対応(国際化対応)について調べていました。 下書きでずっと塩漬けになっているのを思い出し、TODOなどを残したまま一旦公開します。 あとで、少しずつ内容を充実させていきたい。 前提として、自身はi18n対応の経験がほとんどなく初心者レベルであるゆえ、書いてある内容も基本的なものがほとんどだと思います。 (昔、railsアプリ書いていたときにちょっとやっていた程度です...) また、i18n対応を行うにあたってreact-intlを使用していますが、他の方の書かれた記事を見ていると、自分とは別のやり方をしていたり、いろいろとやり方がありそうな感じがしました。 実際に自身でもサンプルを作成してみて、言語ファイルの管理の仕方一つをとっても色々な手法が出てきそうな気がしたので、こんなやり方もあるんだなーという感じで見ていただいたほうが良いかもしれま
続編と、コード自体ではなく、何をすればいいかを書きましたAmazonに見るi18n -「国際化対応」とは何を変える事か Webサイトを多言語化する 最近多言語化に関する仕事をしている関係でi18n(l10n)用のライブラリを色々と見たので、 i18nライブラリによくある使い方を紹介します。 とは言ってもほとんどのライブラリは同じような書き方をするのでJavaScriptを例にします。 ライブラリ一覧 書き方の紹介として使用するものはawasome-javascriptにあるものと、他に気になったものを選びました。 ただし、この記事の目的は「書き方」を紹介するもので「ライブラリ」を紹介するものではありません。 動くことは確認しましたがどのくらいまともに動くかはチェックしていないのでご注意ください。 Polyglot Airbnbが公開するシンプルなライブラリ i18next 色々な環境やフレ
We all know that internationalization is important when it comes to bigger apps, or just the ones that are simply used across countries. Angular itself comes with very poor i18n support, which is why the community has built their own solutions to extend the framework’s functionalities to their needs. However, there’s finally a first-class solution evolving that will be baked right into the core. I
FormatJS is a set of JavaScript libraries.FormatJS is a modular collection of JavaScript libraries for internationalization that are focused on formatting numbers, dates, and strings for displaying to people. It includes a set of core libraries that build on the JavaScript Intl built-ins and industry-wide i18n standards, plus a set of integrations for common template and component libraries. Integ
consoleからI18n.load_pathとすればよい。外部のgem経由で読み込まれているファイルも含めて、arrayで返ってくる。 [1] pry(main)> I18n.load_path => ["/Users/foo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/locale/en.yml", "/Users/foo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activemodel-3.2.8/lib/active_model/locale/en.yml", "/Users/foo/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems
Andreas Szurawitzki 氏 (ヘルシンキ大学の大学生) が書いたゲームのローカリゼーションに関する修士論文を今日から読みはじめました。 Japanese Video Game Localization A Case Study of Sony’s Sairen Series (PDF) まだ前提部分読んでるところなんですけど、読んでいたら「翻訳、ローカリゼーション、インターナショナリゼーション、グローバリゼーションの定義」を自分なりに消化できたような気がします。ずっとしっかり説明したかったことだし、せっかくイメージができたので、ちょっと書いてみます。 翻訳 (Translation): 等価性 (Equivalencce) を基礎において行われる行為のこと インターナショナライゼーション (Internationalization): 最重要課題の一つが "翻訳の等価性を効
These are some tips based on my experiences of working with Rails i18n, extracted from my styleguide. Avoid translated view files If you ever need to work with external translators, it’s a bit of a pain sending both your YML files and a bunch of views like index.en.html.erb. For one thing, you need some code to find all those files and send them, and put them back after receiving the translations.
多言語サイトを作っていて、マスタデータも多言語化したい、でもそのためにテーブル増やしたりプラグイン入れるほどのものでもない・・・といったときに、簡単にカラムデータを国際化(i18n)できるヘルパーです。 たとえば、「ランク」という機能があって、ユーザはbeginner, intermediate, seniorのどれかに属するようなとき、以下のようなシンプルなテーブルを作り、UserはRankにbelongs_toするとします。 DBには、英語の文字列でも入れておきます。 create_table :ranks do |t| t.string :name end 以下のようなヘルパーを作ってやります。 #lib/acts/column_i18n.rb #localizableとかのほうが格好いいが、たまたま他で使っていたので、かぶらないように変な名前にした module Acts::Col
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く