Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts 2 i18n is not working, need help

 
Alex Bokov
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just forgot, i am using tomcat as a server
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read up on Java properties/I18N/messages. native2ascii turns natively-encoded files into something Java can understand.
 
Alex Bokov
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic