Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

translation the message in display tag

 
Aya Muhannad
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems to be the relevant documentation: http://www.displaytag.org/1.2/i18n.html
 
Aya Muhannad
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Accept-Language HTTP header is en-US
how to make it arabic
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set that in your browser.
 
Aya Muhannad
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I set it but there is no any change
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic