Re: Example for Internationalization
MARGALEFF-san wrote: > I am also interested in this example. Did you post it somewhere and I > missed? Kapur-san posted it to the list on 2000/12/07. You can find it in the mail archives at: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg00999.html It's a very good example. Took just minutes to add Japanese support. -- Michael Westbay Work: Beacon-IT http://www.beacon-it.co.jp/ Home: http://www.seaple.icc.ne.jp/~westbay Commentary: http://www.japanesebaseball.com/
Re: Example for Internationalization
Hello all, I am also interested in this example. Did you post it somewhere and I missed? Cheers, Pep Michael Westbay wrote: > > Kapur-san wrote: > > > I was building some prototype for my company and I have modified the Struts > > out-of-box example to add a language drop down on the Login page (which just > > displays English and German) and if the user logs in after selecting the > > language as German all the screens are in German. > > > > If anybody is interested I can post the modified example and the code. > > I think a lot of people are interested. Perhaps it would be best to put the > .war file up on a web site that it can be downloaded from, then send the > URL to the list. Anyone who wants it can get it from there. Those who don't > won't lose the bandwidth. > > If you don't have an extronet site to place it on, I'd be more than happy to > put it up for you.
Re: Example for Internationalization
Kapur-san wrote: > I have attached the changed classes and the jsp files along with the source. > Heres how to use it. Replace the logon.jsp in struts-example subdir with the > file in my distribution. Also replace the class files LogonAction.class and > LogonForm.class Very nice. In order to add a language, I only had to edit two files: 1. create WEB-INF/classes/org/apache/struts/example/ApplicationResources_ja.properties 2. edit the following lines in login.jsp: pageContext.setAttribute("languageValues", new String[] { "en_US", "de_DE", "ja_JP" }); pageContext.setAttribute("languageLabels", new String[] { "English", "German", "Japanese" }); and it was done. This is the major feature that the other sample lacked. There was just one major problem. On my environment, the English wouldn't show up, even when selected. I have Japanese as my default environment, so when ResourceBundle is unable to file ApplicationResources_en.properties, it tries the default locale next, which is ApplicationResources_ja.properties. It is only if the keys can't be found in the default locale also that ResourceBundle looks in ApplicationResources.properties. Most people with English as their default locale don't seem to realize that the _en.properties file does have a meaning. To fix this, I "ln -s"ed the _en props to the "default" properties file, and all worked well. Very nice example. -- Michael Westbay Work: Beacon-IT http://www.beacon-it.co.jp/ Home: http://www.seaple.icc.ne.jp/~westbay Commentary: http://www.japanesebaseball.com/
Re: Example for Internationalization
Aditya, I'd like to see your changes also ... this sounds like something that would be a nice addition to the standard Struts example. Craig McClanahan Aditya Kapur wrote: > Hi All, > I was building some prototype for my company and I have modified the Struts > out-of-box example to add a language drop down on the Login page (which just > displays English and German) and if the user logs in after selecting the > language as German all the screens are in German. > > If anybody is interested I can post the modified example and the code. > > Aditya Kapur > Office (248) 699 3275
RE: Example for Internationalization
Hi, I have attached the changed classes and the jsp files along with the source. Heres how to use it. Replace the logon.jsp in struts-example subdir with the file in my distribution. Also replace the class files LogonAction.class and LogonForm.class (If you unzip this zip file in your webapps directory it should be enough) In case any of you need clarification you can contact me. Thanks, Aditya -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 06, 2000 12:32 PM To: [EMAIL PROTECTED] Subject: Re: Example for Internationalization Aditya Kapur, Please do post your example, as least to my email account if you prefer. I have tried this i18n issue and was stuck somewhere, and regreted that I don't see an adequate example to start with. Thanks, Deping - Original Message - From: "Aditya Kapur" <[EMAIL PROTECTED]> To: "Struts-User (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, December 06, 2000 3:21 PM Subject: Example for Internationalization > Hi All, > I was building some prototype for my company and I have modified the Struts > out-of-box example to add a language drop down on the Login page (which just > displays English and German) and if the user logs in after selecting the > language as German all the screens are in German. > > If anybody is interested I can post the modified example and the code. > > Aditya Kapur > Office (248) 699 3275 > > > > struts-example.zip
Simple Struts I18N (Re: Example for Internationalization)
I've attached a simple Struts app that illustrates basic i18n. This example is targeted, along with a couple other examples, for a second Java Report article on Struts (the first was in the November issue of JR). In the interests of bandwidth, I removed struts.lib and struts*.tld from the WEB-INF/lib and WEB-INF/tlds directories, respectively. To run the example you will need to copy those files from the Struts distribution. This example works with the 20001206 version of Struts and Tomcat3.2 final. Please let me know if you encounter any difficulties. david PS: I'm not trying to steal Aditya's thunder. I just thought we could all benefit from more than one example, especially considering that this one's not tied to the struts example app, and is small enough to post as an attachment. And, of course, I can benefit from your feedback before I write the article. Aditya Kapur wrote: > Hi All, > I was building some prototype for my company and I have modified the Struts > out-of-box example to add a language drop down on the Login page (which just > displays English and German) and if the user logs in after selecting the > language as German all the screens are in German. > > If anybody is interested I can post the modified example and the code. > > Aditya Kapur > Office (248) 699 3275 struts-i18n.zip
Re: Example for Internationalization
Kapur-san wrote: > I was building some prototype for my company and I have modified the Struts > out-of-box example to add a language drop down on the Login page (which just > displays English and German) and if the user logs in after selecting the > language as German all the screens are in German. > > If anybody is interested I can post the modified example and the code. I think a lot of people are interested. Perhaps it would be best to put the .war file up on a web site that it can be downloaded from, then send the URL to the list. Anyone who wants it can get it from there. Those who don't won't lose the bandwidth. If you don't have an extronet site to place it on, I'd be more than happy to put it up for you. -- Michael Westbay Work: Beacon-IT http://www.beacon-it.co.jp/ Home: http://www.seaple.icc.ne.jp/~westbay Commentary: http://www.japanesebaseball.com/
RE: Example for Internationalization
Hi, I am interested as well. Can you post it to my email? Thanks Misak Boulatian [EMAIL PROTECTED] -Original Message- From: Aditya Kapur [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 06, 2000 9:22 AM To: Struts-User (E-mail) Subject: Example for Internationalization Hi All, I was building some prototype for my company and I have modified the Struts out-of-box example to add a language drop down on the Login page (which just displays English and German) and if the user logs in after selecting the language as German all the screens are in German. If anybody is interested I can post the modified example and the code. Aditya Kapur Office (248) 699 3275
Re: Example for Internationalization
Aditya Kapur, Please do post your example, as least to my email account if you prefer. I have tried this i18n issue and was stuck somewhere, and regreted that I don't see an adequate example to start with. Thanks, Deping - Original Message - From: "Aditya Kapur" <[EMAIL PROTECTED]> To: "Struts-User (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, December 06, 2000 3:21 PM Subject: Example for Internationalization > Hi All, > I was building some prototype for my company and I have modified the Struts > out-of-box example to add a language drop down on the Login page (which just > displays English and German) and if the user logs in after selecting the > language as German all the screens are in German. > > If anybody is interested I can post the modified example and the code. > > Aditya Kapur > Office (248) 699 3275 > > > >
RE: Example for Internationalization
Hi, I'm quite interested in your example. Can you post me your code ? Thanks -Message d'origine- De : Aditya Kapur [mailto:[EMAIL PROTECTED]] Envoyé : 6 décembre, 2000 12:22 À : Struts-User (E-mail) Objet : Example for Internationalization Hi All, I was building some prototype for my company and I have modified the Struts out-of-box example to add a language drop down on the Login page (which just displays English and German) and if the user logs in after selecting the language as German all the screens are in German. If anybody is interested I can post the modified example and the code. Aditya Kapur Office (248) 699 3275