![アプリの国際化の舞台裏](https://cdn-ak-scissors.b.st-hatena.com/image/square/e1f80b7814606757c50c8971831c8e0d39ea3910/height=288;version=1;width=512/https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2F53c500a10ede4de099a3b53b2205a90e%2Fslide_0.jpg%3F13452530)
i18next is an internationalization-framework written in and for JavaScript. But it's much more than that! i18next goes beyond just providing the standard i18n features such as (plurals, context, interpolation, format). It provides you with a complete solution to localize your product from web to mobile and desktop. The i18next-community created integrations for frontend-frameworks such as React, A
IntlというのはECMAScript Internationalization APIのこと ECMA-402 として標準化 Intl - JavaScript | MDN NodeJSでも利用可能だが、ビルドオプションによって様子が変わる NodeJSのICUサポートは none, system-icu, small-icu, full-icu というオプションが用意されている https://nodejs.org/api/intl.html 公式バイナリのオプションは small-icu で、これは英語だけをサポートしている 起動時にICU dataを与える事も可能 この情報は node -e 'console.log(process.config.variables)' で調べられる Intl によってI18N処理をするときに日本語サポートをしたい場合、3つの選択肢がある full
あたくしは普段 Locale::Maketext::Lexicon を利用しているので、Locale::Maketext::Lexicon をつかったサンプルをかいてみた。 #!perl use strict; use warnings; use utf8; package MyApp::I18N; use FindBin qw($Bin); use parent 'Locale::Maketext'; use Locale::Maketext::Lexicon { '*' => [Gettext => "$Bin/locale/*.po"], _auto => 1, _decode => 1, _style => 'gettext', }; package main; use Encode (); use Text::Xslate; my $i18n = MyApp::I18N->get
CatalystだとCatalyst::Plugin::I18Nを使うのが楽みたいですが、 Xslateだと使えないようなので Text::Xslateのドキュメントを参考に自前で設定してみました。 (ちなみに今回の目的は国際化ではなく、ラベル等をファイル管理したかっただけという...) サンプル https://github.com/toritori0318/Catalyst-Xslate-Po-Example 必要なモジュール(CatalystとText::Xslateは除外) I18N::Handle App::I18N Catalyst::View::Xslate とりあえずの手順 catalyst.pl でアプリケーション生成 catalyst.pl PoDemo とか。 po プロジェクト?の初期設定 App::I18N をインストールすると「po」というコマンドが使えるように
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く