Category:Language Files
From MODx Wiki
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:
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):
/* Set locale to Persian */ /* Set locale to Spanish */ /* Set locale to French */ /* Set locale to Portuguese */ /* Set locale to German */ /* Set locale to Dutch */
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.
ACD |
D cont.EIKM |
M cont.Q
RT |
