This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes translation the message in display tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "translation the message in display tag" Watch "translation the message in display tag" New topic
Author

translation the message in display tag

Aya Muhannad
Greenhorn

Joined: Dec 14, 2013
Posts: 22
I use display tag library to show the result in my jsp code
but I need to translate the language of the message shown with paging to another language like Arabic
how can I make that?
my code
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
This seems to be the relevant documentation: http://www.displaytag.org/1.2/i18n.html
Aya Muhannad
Greenhorn

Joined: Dec 14, 2013
Posts: 22
thank you Ulf Dittmer for response
I made the steps in that web site to support another language
I made the displaytag_ar.properties file and put it in WEB-INF folder contains follow row:
paging.banner.one_item_found=الاسم
but there is no any change

Can you help me in this problem
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
I would assume that DisplayTag uses the Accept-Language HTTP header to determine the locale to use. What value does that header have when you access the web app?
Aya Muhannad
Greenhorn

Joined: Dec 14, 2013
Posts: 22
Accept-Language HTTP header is en-US
how to make it arabic
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
You can set that in your browser.
Aya Muhannad
Greenhorn

Joined: Dec 14, 2013
Posts: 22
I set it but there is no any change
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
What's the value of the Accept-Language header now?

You have restarted the web app, right?

Also be sure to read the "Advanced" and "Locale resoluton" sections on the page I linked to, just in case those apply to your situation.
Aya Muhannad
Greenhorn

Joined: Dec 14, 2013
Posts: 22
I read the read the "Advanced" and "Locale resoluton" sections on the page you linked
but I did not understand well
I put the following properties in file named by displaytag_ar.properties

locale.provider=org.displaytag.localization.I18nStrutsAdapter

locale.resolver=org.displaytag.localization.I18nStrutsAdapter
paging.banner.one_item_found=الأسم

there is no any change in the language
can you help me?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
I've never done this, so I can't help specifically, but only go by the documentation. So: Does Globals.LOCALE_KEY have the correct value?

The documentation says to put "locale.provider=org.displaytag.localization.I18nStrutsAdapter" into displaytag.properties; is that where it is?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: translation the message in display tag
 
It's not a secret anymore!