Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. Some words about localization
  2.  
  3. Since i-MSCP 1.0.1.4, Machine object files are used in replacement of the database tables for translation storage.
  4.  
  5.  
  6. I. How to help us to translate i-MSCP
  7.  
  8. To make the translation easier, we are using the translation service provided by Transifex that provides a set of Web-based tools to translate the softwares. If you want contribute to the translation, you only have to be registered on Transifex to begin to make the translation.
  9.  
  10. Transifex provides documentation that explains to new users how to translate. For this reason, no further explanation is made here. The only important thing that you must take into consideration is that i-MSCP uses only UTF-8 as encoding for translation files. That means that if you want translate with your editor (such as Poedit) and do not use the Web-based interface provided by Transifex, you must use this encoding. This last statement is also valid when you want install the locale on your server. For example, if you want install the locale es_ES for i-MSCP and also install it on your server, you must select the UTF-8 version of it. With Debian, that can easily achieved through dpkg-reconfigure locales as the root user.
  11.  
  12. II. i-MSCP Frontend (GUI) - internal localization management
  13.  
  14. i-MSCP manages the locales in different ways, depending whether the locales are installed or not on the system.
  15.  
  16. Example for the locale es_ES :
  17.  
  18. I. The locale is installed on the server
  19.  
  20. In this case, the iMSCP frontend is able to use native PHP gettext functions. The performances are greatly improved because the Machine object files (MO files) are read once per process. However, a workaround is in place here to be able to update any translation file through the GUI without having to reload the Web server since the files are cached in memory. When native PHP gettext function are used, i-MSCP creates a specific production file with an unique gettext domain name based on the modification filetime of the upstream file and load it instead. When the upstream Machine file is updated by admin, the GUI detects the change and then, creates another production file which is used in replacement of the previous.
  21.  
  22. You must note that natives PHP gettext functions are used only if the locale being used is also installed on the server.
  23.  
  24. II. The locale is not installed on the server
  25.  
  26. Unfortunately, native PHP gettext functions can not be used if the locale being used is not installed on the server. In this case, a specific library (PHP-gettext) that provide similar set of functions to simulate localization is used. This is slower since the parser is implemented in PHP and not in C, and also because the files (translation tables) are not cached in memory. In this situation, the admin is warned by email.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement