Community Documentation

Translate default language

Last updated November 16, 2012. Created by GiorgosK on November 11, 2012.
Edited by NonProfit. Log in to edit this page.

Reasons you might need to translate the default language

  • you need to change a few strings depending on the dialect spoken or because of personal preference
  • you need to change the default language but it will probably break translations because they are based on default language

Using settings.php - Changing a few strings

In the first case you can just use the settings.php and erase the # signs from the following piece of code and changing _en to your default language code

In the following example for English the word forum will be translated to Discussion Board

<?php
$conf
['locale_custom_strings_en'][''] = array(
  
'forum'      => 'Discussion board',
);
?>

Using Variable admin - Changing many/all strings

If you want to translate a lot of strings or you want an administrator to translate the strings without touching the settings.php you need to use the variable module.

  • Enable the variable admin (variable module should be enabled if you have i18n enabled)
  • Go to admin/config/system/variable
  • Click on the multilingual vertical tab
  • click on the ENABLE TRANSLATION FOR LANGUAGE
  • put TRUE in your default language (usually English)
  • press save

After this you are able to translate the default language
I suggest using a module like translation table which gives you a nice table of all available fields, terms, menus etc that can be translated

There is probably another way for this to be done using a setting in settings.php (please provide if you know it)

String Overrides module - changing a few strings

http://drupal.org/project/stringoverrides
Will let you override some default strings

for drupal 6

the only way to do it is probably by putting this piece of code in somewhere in settings.php
$conf['i18nstrings_translate_langcode_en'] = TRUE;
please change en with your default language

NOTES

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Audience
Programmers, Site administrators, Site builders
Level
Intermediate
Keywords
content translation, string translation
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here