Category:Language Files

From MODx Wiki

Jump to: navigation, search

These are the main MODx language files:

  • Manager Language File: manager/includes/lang/english.inc.php - includes all messages used in the Manager interface
  • Countries List Language File: manager/includes/lang/english_country.inc.php - includes all countries used in combo boxes

Translations for these files sit at the same folders and follow the naming convention (language).inc.php, e.g:

  • manager/includes/lang/spanish.inc.php
  • manager/includes/lang/country/french_country.inc.php

Assets (snippets/plugins/modules, etc) can also have translations and follow the same naming convention. Usually, their language files are at 'lang' folders, inside the asset's main folder, e.g.:

  • assets/snippets/ditto/lang/english.inc.php
  • assets/plugins/tinymce/lang/portuguese.inc.php
  • assets/modules/docmanager/lang/spanish.inc.php

When creating Language Packs in your language:

  • please keep the folder structure intact;
  • whenever possible, use UTF-8 encoding for the files (Windows users can find a good editor that saves in UTF-8 at http://notepad-plus.sourceforge.net);

Contents

Managing the translation process collaboratively

The files in this section (see list at the bottom of this page) can be used to have a group of individuals working on translations.

To view how the base English language files change over time, use the history tab found at the top of each of those pages.

The naming convention for these files is as follows:

Filename/function lang-dialect

For example, British English for the Ditto file would be:

Ditto en-uk
  • To add a new language translation file, follow the instructions [1] to add a new wiki page.
  • To start a translation from scratch, go to the base English file (most current version) and then copy the page, creating a new page with that content - you can then start translating all english strings to your language.

This way more than one individual can work on the translations, collaboratively.

Additional help for translators

Falling back to English defaults

To ensure that no errors occur because of missing strings, you can add the following line to your language files:

  1. include_once(dirname(__FILE__).'/english.inc.php'); // fall back to English defaults if needed

Setting Locale for local string formatting

In order to have specific formatting for a language (e.g. translated dates), you can set the php locale in you Manager lang file (includes/lang/YOUR_LANGUAGE.inc.php), right at the beginning of the file. Some examples (*nix systems):

  1. /* Set locale to Persian */
  2. setlocale (LC_ALL, 'fa_IR');
  3.  
  4. /* Set locale to Spanish */
  5. setlocale (LC_ALL, 'es_ES');
  6.  
  7. /* Set locale to French */
  8. setlocale (LC_ALL, 'fr_FR');
  9.  
  10. /* Set locale to Portuguese */
  11. setlocale (LC_ALL, 'pt_PT');
  12.  
  13. /* Set locale to German */
  14. setlocale (LC_ALL, 'de_DE');
  15.  
  16. /* Set locale to Dutch */
  17. setlocale(LC_ALL, 'nl_NL');

Warning: The "locale" string always depends on the server configuration, so these examples might not work on your specific setup!

More info on php locales at http://www.php.net/setlocale


Articles in category "Language Files"

There are 53 articles in this category.

A

C

D

D cont.

E

I

K

M

M cont.

Q

R

T

Personal tools