GeeCON Prague 2014*
The moose likes Struts and the fly likes struts 2 i18n is not working, need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 i18n is not working, need help" Watch "struts 2 i18n is not working, need help" New topic
Author

struts 2 i18n is not working, need help

Alex Bokov
Greenhorn

Joined: Jun 01, 2009
Posts: 16
i am trying to do i18n, created two property files: text_en and text_ru. if i save it as ASCII i can get value in english, but not in russian (characters get corrupted).
if i save it as UTF-8, seems like property file is not accessible ( tag is displayed not value )
any ideas how to solve the problem?
thank you.
Alex Bokov
Greenhorn

Joined: Jun 01, 2009
Posts: 16
just forgot, i am using tomcat as a server
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Read up on Java properties/I18N/messages. native2ascii turns natively-encoded files into something Java can understand.
Alex Bokov
Greenhorn

Joined: Jun 01, 2009
Posts: 16
i tried! saved file as Unicode, then run:
native2ascii.exe -encoding unicode text_ru_utf8.txt text_ru.properties

but still see only ???
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Is the response encoding set correctly? Is the browser set up correctly? Sometimes server settings may need to be tweaked as well. I mean, I can pretty much guarantee it's not an S2 issue as I can spit out Chinese with no issue. Maybe also try on the struts-user mailing list; I know there are people on there making Russian apps.
 
GeeCON Prague 2014
 
subject: struts 2 i18n is not working, need help