Skip to main content

Translation

translation

Translation of custom modules and themes in Drupal 7

As we discussed a lot about translation in the previous posts Translation in Drupal 7: How it works? and TRANSLATION in Drupal 7: How to work with, let us discuss a few points about how to do a custom translation to our module and pot(.po) file handling for string translations. Before getting into the custom translation let us know few things about pot file handling. The pot (or) potx file which will be with extension .po.

knackforge blog knowledge base

TRANSLATION in Drupal 7 : How to work with

In the previous part, we discussed about the Translation in Drupal 7 works with few snapshots and some makeovers. Now, lets discuss how to work with translation to translate the contents, field values and entity items.

1) Translating Menus

With Drupal core alone, user-defined menu items are not translatable. The Menu translation module, part of the Internationalization (i18n) package, allows users to select a translation mode for each menu.The following modes are available:

    translate in drupal 7

    Translation in Drupal 7 : How it works?

    As we all know that, we were all getting projects and clients across the globe. But doing a multilingual website with each having different set of requirements make the website handling tougher and tougher. Also, building a multilingual web site involves much more than translating content from one language to another. Translation must be done with an awareness of a language's idioms as spoken within a geographic region. But in Drupal we’ve been provided with rich set of core and contrib modules, which supports translation for our website(s).

    Translatable strings

    Translatable strings in Drupal JavaScript

    Drupal is known for being highly translatable. The localization team has done a fantastic job building out tools to make Drupal translatable and it's rare to find a contrib module that doesn't properly wrap its strings in the t() function or the lesser known format_plural() function. While the Drupal community is doing fairly well on the PHP side, many people don't know there is a translation system for Drupal JavaScript as well through the use of Drupal.t() functions and Drupal.formatPlural() functions. 

    Drupal.t() function

    Subscribe to Translation