[Seasar-user:17460] Re: Teeda「マルチ言語サポート」

Koichi Kobayashi [E-MAIL ADDRESS DELETED]
2009年 5月 15日 (金) 21:00:46 JST


小林 (koichik) です.

Date:    Fri, 15 May 2009 15:42:00 +0900
From:    thomas <[E-MAIL ADDRESS DELETED]>
To:      [E-MAIL ADDRESS DELETED]
Subject: [Seasar-user:17454] Teeda「マルチ言語サポート」

> I am using *label.properties* and *label_jp.properties* in my project.
> 
> Login画面contains selection for language.
> 
> If the user select English as a language,i need to get the english lable.if
> he select 日本語i need to get 日本語label
> 
> How can i achieve this.

Teeda automatically detect the Locale from 'accept-language' 
request header.
It is difficult to change it from a program.

May be possible if you use a Filter.

1. LoginPage set a selected Locale to an HttpSession.
2. Filter create a wrapper for an HttpServletRequest.
3. getLocale() and getLocales() methods of the wrapper 
   return the Locale from an HttpSession.

> By deafault if i run in IE i got labels in 日本語,if i run in firebox i got
> labels in English.

If you depend on automatic detection of Teeda,

IE
select [tool]-[internet option] menu, push [language] button, 
push [add] button, choose [ja-JP], push [OK] button.

Firefox
select [tool]-[option] menu, select [contents] panel,
push [choose] button in [language] section,
select [ja] if exists, push [remove] button.


-- 
<component name="koichik">
    <property name="fullName">"Koichi Kobayashi"</property>
    <property name="email">"[E-MAIL ADDRESS DELETED]"</property>
    <property name="blog">"http://d.hatena.ne.jp/koichik"</property>
</component>



Seasar-user メーリングリストの案内