Category: i18n

Multi lingual sites is a desired feature for sites targeting audiences of multiple countries or of more than one linguistic groups for example my first experience with the module was translating the Wanderlust Festival website for audiences in Quebec, where French and English are national languages. For Drupal there are many features which streamline the process. We will go into some of the standard translation techniques. In a later post I will go into identifying and translating certain hard to target strings such as those in complex views.
Continue Reading..

Preface

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

In this tutorial we will

1. Configure Views to show nodes with only the current language.

2. Translate  strings in views that cant be translated via admin UI.

3. Translate menu items.

 

1. On each views (pages, blocks etc) we need to add filter criteria ‘Content: Language’ and choose ‘Current user’s language’ – https://screencast.com/t/hvRR4XmL8DQZ After this you the view will only show nodes that contain your current language on site.

2. Sometimes we have views with a difficult structure and fields with a lot of HTML tags, tokens and strings. These can’t be translated via Drupal admin UI. For example this global custom field – https://screencast.com/t/S0U6Zibb0p54 a method for translating something irregular like this is as follows.  Create a .tpl file for this field and wrap strings and links in t() and l() functions.  https://screencast.com/t/3Dj1gGjEe after this we Then these can easily found and translated in admin UI.

The Same method can be used for other views templates and nodes if there are links

3. To translate the menu we need to enable ‘Menu translation’ module (from i18n). Now we go to edit menu and enable translation mode – https://screencast.com/t/JRw0ngrBa8  Now we can translate any menu item – https://screencast.com/t/s6maX10qk

Contact

office: (212)-658-1447 | cell: (914)-715-8862 | alex@freeenergymedia.com

Name
Email
Message

Message sent, Thanks!
Error! Please validate your fields.
2017 FEM NYC (formerly Free Energy Media)