0

I built web site using JSF, support multi-language(German and English). I just set the internationalization values for each language in properties to be use in xhtml. Now I added Arabic language and create lang_ar.properties for Arabic values. It works fine, but the direction is still displayed in the wrong place. Since Arabic is RTL, so when change to Arabic the its should change the direction of the whole content of the page to RTL. I searched a lot for the solution but I didn't find what I am looking for. If I use html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" dir="rtl"> It will change the direction of the page even if I use German or English. I don't want to use separate page for Arabic content I want use the same pages which take the value from properties files just like English and German, but I need to change the direction when use arabic properties.

If I use the following:

<h:inputText ... dir="#{view.locale.language eq 'ar' ? 'rtl' : 'ltr'}" />

This will works just for the plain text entered in the input field not to the input field itself. So the input field will stay ltr but the text inside will be rtl.

Can any one help me?

R.Almoued
  • 219
  • 6
  • 16
  • Possible duplicate of [JSF render dir="rtl" when language is arabic](http://stackoverflow.com/questions/30629814/jsf-render-dir-rtl-when-language-is-arabic) – BalusC Jul 29 '16 at 14:08
  • I saw the answer before writting my question.actually it works just for plain text inside the input feld but it will make no difference with other components like buttons or even the input felds. – R.Almoued Jul 30 '16 at 01:18
  • I have already found solution. – R.Almoued Aug 03 '16 at 07:00
  • That's indeed answered in the duplicate. – BalusC Aug 03 '16 at 21:07

0 Answers0