AW: Default language
"Bernhard Woehrlin" <[email protected]> Wed, 6 Jul 2005 14:31:07 +0200
| Newsgroups | gmane.comp.java.strutscx.user |
|---|---|
| Organization | IT.CappuccinoNet.com |
| Message-ID | <001101c58226$98886190$4c01a8c0@javaws> |
Hi Oliver, A default language parameter to set inside the strutscx-config.xml is a good idea and I will put it on the Todo-list. I yesterday exchanged some mails with Yayo outside the list. So I'll copy/paste the correspondence below - for your information. Greets, Berny ------------ This is what Yayo wrote: Yeah!!! That's it. Now just have to add somekind of default="true" attribute to the locales in strutscx config. By now for just it to work I'll do it programmatically. Thanks. I've got a mail from a French user who have same problem. The demo crashes because there's just en, gr and donnowhat more but others responds with filenotfound. thanks again! 2005/7/5, Bernhard Woehrlin <[email protected]>: > Hi Yayo, > > this is what the StrutsCXStandardDocumentBuilder does to check which > file to > take: > > Locale locale = > (Locale) > session.getAttribute("org.apache.struts.action.LOCALE"); > > String variablesFileName = > StrutsCXConstants.RESSOURCEPROPERTIES_FILES > + "." > + locale.getLanguage(); > > So, if you set your Locale right (check Struts for details) it should > get the right resource properties file for you. - I'm not sure but > Struts works with a default locale - if not you could change the code > above to pass a default language ID... > > Greets, > > Berny > > -----Ursprüngliche Nachricht----- > Von: Yayo [mailto:[email protected]] > Gesendet: Dienstag, 5. Juli 2005 10:59 > An: Bernhard Woehrlin > Betreff: Re: [Strutscx-user] Default language > > hies! > > Yeah, ok, that's a solution. Same solution as copying the files from > lang to lang... But just for a few locales. I don't remember most of > them, just a few US, UK, GA, JP, FR, DE, MX, SW, ES, MX, CA... > > Wouldn't it be nice if there's a way to have a default to EN, for > example? > > Could you tell me which is the class where CX looks for locale so I > can modify it and return a default lang for a not found locale file? > > Also got to tell that Dudley has redone some of my XSL code so it > works better now (well it works now :P) so ask hem for the file to > output correctly the errors 'cos I did mistakes on it. > > 2005/7/5, Bernhard Woehrlin <[email protected]>: > > Hi Yayo, > > > > have you tried to just redirect to the english file by using > > > > <es>/WEB-INF/xml/variables_en.xml</es> > > > > I'm short in time and can't check out the details myself right > > now... > > > > Greets, > > > > Berny > > > > -----Ursprüngliche Nachricht----- > > Von: Yayo [mailto:[email protected]] > > Gesendet: Dienstag, 5. Juli 2005 10:30 > > An: [email protected] > > Betreff: Re: [Strutscx-user] Default language > > > > I'll give you the stack trace of the exception but it's caused by a > > FileNotFound when trying to load _ES resources XML file and it does > > not exist. So I copy the EN file to an ES and there it goes fine. My > > browser is configured to just accept ES_ES as language :( > > > > 2005/7/5, Bernhard Woehrlin <[email protected]>: > > > Hi Yayo, > > > > > > Check the lang and resources-properties elements in your > > strutscx-config.xml > > > to configure the language settings. - Could you give us more > > > precise information on the reason of the application crash in your > > > browser? > > > > > > Thanks, > > > > > > Berny > > > -----Ursprüngliche Nachricht----- Von: PEGUET Steve [mailto:[email protected]] Gesendet: Dienstag, 5. Juli 2005 11:58 An: Yayo Cc: Bernhard Woehrlin Betreff: RE: [Strutscx-user] Default language Is it possible to change only the baseAction to force the use of ressource and the directive pragma for the encoding and charactere set HTTP for the answer? -----Message d'origine----- De : Yayo [mailto:[email protected]] Envoyé : mardi 5 juillet 2005 11:33 À : PEGUET Steve Objet : Fwd: [Strutscx-user] Default language there it goes. Now I must modify again stritscx to get it to work :B ---------- Forwarded message ---------- From: Bernhard Woehrlin <[email protected]> Date: 05-jul-2005 11:23 Subject: AW: [Strutscx-user] Default language To: Yayo <[email protected]> Hi Yayo, this is what the StrutsCXStandardDocumentBuilder does to check which file to take: Locale locale = (Locale) session.getAttribute("org.apache.struts.action.LOCALE"); String variablesFileName = StrutsCXConstants.RESSOURCEPROPERTIES_FILES + "." + locale.getLanguage(); So, if you set your Locale right (check Struts for details) it should get the right resource properties file for you. - I'm not sure but Struts works with a default locale - if not you could change the code above to pass a default language ID... Greets, Berny -----Ursprüngliche Nachricht----- Von: Yayo [mailto:[email protected]] Gesendet: Dienstag, 5. Juli 2005 10:59 An: Bernhard Woehrlin Betreff: Re: [Strutscx-user] Default language hies! Yeah, ok, that's a solution. Same solution as copying the files from lang to lang... But just for a few locales. I don't remember most of them, just a few US, UK, GA, JP, FR, DE, MX, SW, ES, MX, CA... Wouldn't it be nice if there's a way to have a default to EN, for example? Could you tell me which is the class where CX looks for locale so I can modify it and return a default lang for a not found locale file? Also got to tell that Dudley has redone some of my XSL code so it works better now (well it works now :P) so ask hem for the file to output correctly the errors 'cos I did mistakes on it. 2005/7/5, Bernhard Woehrlin <[email protected]>: > Hi Yayo, > > have you tried to just redirect to the english file by using > > <es>/WEB-INF/xml/variables_en.xml</es> > > I'm short in time and can't check out the details myself right now... > > Greets, > > Berny > > -----Ursprüngliche Nachricht----- > Von: Yayo [mailto:[email protected]] > Gesendet: Dienstag, 5. Juli 2005 10:30 > An: [email protected] > Betreff: Re: [Strutscx-user] Default language > > I'll give you the stack trace of the exception but it's caused by a > FileNotFound when trying to load _ES resources XML file and it does > not exist. So I copy the EN file to an ES and there it goes fine. My > browser is configured to just accept ES_ES as language :( > > 2005/7/5, Bernhard Woehrlin <[email protected]>: > > Hi Yayo, > > > > Check the lang and resources-properties elements in your > strutscx-config.xml > > to configure the language settings. - Could you give us more precise > > information on the reason of the application crash in your browser? > > > > Thanks, > > > > Berny > > > > -----Ursprüngliche Nachricht----- > > Von: [email protected] > > [mailto:[email protected]] Im Auftrag von > > Yayo > > Gesendet: Dienstag, 5. Juli 2005 09:11 > > An: [email protected] > > Betreff: [Strutscx-user] Default language > > > > Can there be applied a default language for the resources? > > > > I've noticed that the strutscx demo crashes when I run it with > > spanish configured browser. Can there be specified a default language to load? > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration > > Strategies from IBM. Find simple to follow Roadmaps, straightforward > > articles, informative Webcasts and more! Get everything you need to > > get up to speed, fast. > > http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick > > _______________________________________________ > > Strutscx-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/strutscx-user > > > > > > -- -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von [email protected] Gesendet: Mittwoch, 6. Juli 2005 14:17 An: [email protected]; [email protected]; [email protected] Betreff: AW: [Strutscx-user] Default language Hello Bernd, i ran into the same trouble. In strutscx-config.xml you can configure all available language properties. The Problem Yayo mentioned is, that there is now possibility to set some kind of default language. You can test this with your shipped demo application. When your Browser is configured with an language (e.g. spanish), which is not setup in strutscx-config.xml, then the application crashes. <resources-properties> <!-- build something in like this> <default>de</default> <!-- --> <de>/WEB-INF/xml/index-de.xml</de> <en>/WEB-INF/xml/index-en.xml</en> </resources-properties> So if the client is setup with an language, which is not supported by the application, then the default language should be displayed. Best regards Oliver Walter > -----Ursprüngliche Nachricht----- > Von: Bernhard Woehrlin [mailto:[email protected]] > Gesendet: Dienstag, 5. Juli 2005 10:27 > An: 'Yayo'; [email protected] > Betreff: AW: [Strutscx-user] Default language > > Hi Yayo, > > Check the lang and resources-properties elements in your > strutscx-config.xml > to configure the language settings. - Could you give us more precise > information on the reason of the application crash in your browser? > > Thanks, > > Berny > > > > > -----Ursprüngliche Nachricht----- > Von: [email protected] > [mailto:[email protected]] Im Auftrag von Yayo > Gesendet: Dienstag, 5. Juli 2005 09:11 > An: [email protected] > Betreff: [Strutscx-user] Default language > > Can there be applied a default language for the resources? > > I've noticed that the strutscx demo crashes when I run it with spanish > configured browser. Can there be specified a default language to load? > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick > _______________________________________________ > Strutscx-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/strutscx-user > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click > _______________________________________________ > Strutscx-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/strutscx-user > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick _______________________________________________ Strutscx-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strutscx-user ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click