# Languages and Translations # Create Language Files How to create language files for the Eenos Control panel and manage It. # New Page # Introduction ### Eenos Language Files Eenos control panel is developed on Python and uses **Gnu Gettext** tools to manage languages. The WAP, RAPP, and UAPP have their own language files. The language file locations are as follows,
**Sl.NO** | **User Interface** | **Location of Language File** | **Description** |
1 | WAP | /usr/local/eenos/wap/locale | Web Admin Panel language folder |
2 | RAPP | /usr/local/eenos/rapp/locale | Reseller Control Panel language folder |
3 | UAPP | /usr/local/eenos/uapp/locale | User Control Panel language folder |
IMPORTANT: Eenos only provides language files, you need to translate into your local language by yourself. We will provide the translations in future releases only.
Please take a backup of the language folders before making customization on Eenos.
By default, Eenos provides 16 Language Files. So that you can directly start creating the translations of those language files. The web interfaces were created using the Django libraries. So any Django developer can create a language file configuration in the Django Settings Page as follows, ```python LANGUAGES += ( ('en',_('English')), ('de',_('German')), ('es',_('Spanish')), ('ml',_('Malayalam')), ) ``` You need to add the custom language codes to all three interfaces Django Settings page #### Build Gettext Language Files. After configuring the custom language code use the following tool to generate the language files, **Command :** ```bash /usr/local/eenos/scripts/translate ``` Rebuild the WAP language files, and run the following command : ```bash /usr/local/eenos/scripts/translate --rebuild --wap ``` Rebuild RAPP language files, and run the following command: ```bash /usr/local/eenos/scripts/translate --rebuild --rapp ``` Rebuild UAPP language files, and run the following command : ```bash /usr/local/eenos/scripts/translate --rebuild --uapp ``` The above commands will create the language files in the gettext format in **.po** files. An example language file for WAP for the language Arabic is as follows: Location of the file **/usr/local/eenos/wap/locale/ar/LC\_MESSAGES/django.po** ``` more /usr/local/eenos/wap/locale/ar/LC_MESSAGES/django.po # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHORRebuilding will rewrite any existing Language files. So please take proper backup before starting to rebuild language files.
# Create Translations How to create a translation for the language files. # New Page # Create Translation and Compile Language ### Creating Translation on Language In the previous chapter, we have seen how to create the gettext language files in .po files. Now we are going to make translations for the language files. Here we are going to translate the Arabic ( ar ) language file for the WAP control panel. The language file is located on **/usr/local/eenos/wap/locale/ar/LC\_MESSAGES/django.po** #### Understating the Gettext Language file The language file has two terms, - **msgid**: This string is in the original language, don't change it. - **msgstr**: This is the translation of the msgid, you need to add the translation here. After making the full translation, we need to compile the **.po** language files into binary file **.mo** files. To compile the language files use the following command, To compile WAP translations run the following command. ``` /usr/local/eenos/scripts/translate --compile --wap ``` To compile RAPP translations run the following command, ```bash /usr/local/eenos/scripts/translate --compile --rapp ``` To compile UAPP translations run the following command: ```bash /usr/local/eenos/scripts/translate --compile --uapp ```Warning: Compiling a language file may rewrite the existing .mo files.