Our Blog

Basics of Translating an Arabic site Content Type Fields and Taxonomy in i18n

Our fourth multilingual site and significantly more of a challange. When in the past I had dealt with latin alphabet only, this time I was dealing with Arabic and there were some major differences here. In the Arabic language everything reads right to left. So through simply checking a setting in i18n admin panel you can add the attribute dir="rtl" to the <html> tag. This conveniently moves all your content to the right side of your page and changes text highlight from this direction as well. This caused quite a few issues mainly with CSS. Sprites were off on the Arabic version by a few px, but luckily this was easy to fix, as Drupal adds the class i18n-ar to the body tag, so it was easy to target Arabic only views. One other major issue I had was a large left margin of > 1000px when language was set to Arabic, this was fixed by setting body tag to overflow:none;

Translating Fields and Taxonomy

First enable translation on the content type you want to translate. You can find this at the bottom in the ‘Publishing options’ tab. There you need to select ‘Enabled with translation’ . After saving you will see a new tab – ‘Multilingual settings’. Afterwards select checkbox ‘Set current language as default for new content’ – This makes it easier for editors creating a post if they primarily post in a certain language, it will be set to that language by default without having to manually choose a language.

To translate fields in content type (labels, descriptions etc.) – enable ‘Field translation’ module. After this we can go to the field in the ‘manage fields’ section.
and click translate tab –

and there you can translate needed title

Replace text
and click ‘Save translation’.

To translate taxonomy terms enable – ‘Taxonomy translation’ module. After this we can go to the vocabulary and edit it.

With this method we can translate terms via the admin panel. If we need different terms for each language – we must choose ‘Translate. Different terms will be allowed for each language and they can be translated.’ – this method can also be used too in some cases. You must decide before development what method you want to use.
Now we can translate the term in admin section. Go to yoursite.com/admin/config/regional/translate/translate and search term –