Tuesday November 14, 2006 | Just my 2¢ Naoto Sato's Weblog |
|
All Languages |
English Only |
日本語のみ ”百聞は一見にしかず”ということわざがありますが、前のエントリーで取り上げたロケール・デモをWebStartアプリケーションにして、実行可能にしてみました。 このデモはJava 6の機能を使うのでJava 6がマシンにインストールされていることが前提条件です。もしまだの場合はこの際ここからインストールしましょう。Java 6のインストールが完了したら下のボタンを押してみて下さい。 デモが立ち上がったでしょうか?この状態だとこのデモに表示されているロケールのデータはJava 6に同梱されているそのままです。"Locale Names"のタブへ移動すると実際にいくつのロケールがインストールされているかを見ることが出来ます。全部で"150"と表示されるはずです。 次に例のCLDRアダプターをインストールしてみましょう。CLDRアダプターはここにあるので、この"cldradapter.jar"ファイルをJavaランタイムの拡張ディレクトリに保存します。ウィンドウズですと通常、"C:\Program Files\Java\jre1.6.0\lib\ext"というディレクトリがあるはずですのでここに保存します。そして再び上の"Launch"ボタンを押してみましょう。どうですか?今度は少し立ち上がりに時間がかかったと思いますが、これはロケールデータをユニコード・コンソーシアムのウェブサイトから動的にダウンロードしているためです。先ほどのように"Locale Names"のタブに移動すると、"365"個のロケールが表示されていると思います。 このデモの面白いところは、ロケールデータを"オン・デマンド”で引っ張ってきてくれるところです。Javaランタイムにもともと組み込まれていなくても、必要になった時に初めてインストールすることによって、ダウンロードの最適化及び拡張性を同時に得ることが出来ます。次期Javaのリリース(えっと、Java 6の次の話をしています :-)のプランの一つにロケールデータを如何に効率よくデプロイするかというフィーチャーがありますが、このデモはそれに対する一つの方向性を示していると思います。 (2006-11-14 19:19:55.0) PermalinkLocale Demo on your own machine "Seeing is believing", so I made the locale demo webstartable. First, please check that your machine has Java 6 installed, if not, you can install it from here. Then just hit the following button: The demo started? At this moment, it only displays locales that are provided by the Java runtime only. If you go to the "Locale Names" tab, it shows the total number of locales as "150". Now the fun part begins. Download the CLDR Adapter into the extension directory of your Java runtime. For example on Windows, the path to the extension directory is typically "C:\Program Files\Java\jre1.6.0\lib\ext". Then hit the above "Launch" button again. It would take a bit longer time to start, because this time the CLDR adapter retrieves the locale data from the Unicode Consortium's web site on the fly. Take a look at the "Locale Names" tab again and you will see the locale count jumps to "365"! This demo also showcases an interesting aspect, i.e., "locale on demand". Locales can be installed into the runtime only when it is really needed. One of the features that we are planning to do in the next release, um, that means after Java 6 :-), is how we can deploy locale data to the clients, and this demonstrates an interesting point. (2006-11-14 18:56:57.0) Permalink Comments [2] |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||