Key for poedit1/8/2024 ![]() ![]() po file, run the script again-without the -debug parameter. Once you have translated all strings in a. po file, run the script with -debug parameter. If you have doubts as to how to translate some localization string, you have a convenient opportunity to look up the logic used in the file where that string is used. Such a comment shows that a localization key was found on line 38 of the specified file. po files comments with paths to source files in which a particular localization key was found. Php wa.php locale someapp/themes/mytheme Generation of localization files in the debug mode Php wa.php locale someapp/widgets/mywidget Php wa.php locale /themes/ Examples php wa.php locale someapp/plugins/myplugin po files for plugins, widgets, and design themes is performed in a similar way: po file generation scripts, runĪuto-generation of. po file for an application, it is created automatically. The framework supports automatic analysis of the entire source code of an application in order to collect all localization keys and to append missing Within the translated string using PHP function sprintf e.g.: _w('%d file', '%d files', 21) // 2 1 файл (Russian for "21 files") Single-value strings syntax should be used.įunction _w() is also capable of automatically replacing substring %d by the value of $n Note the difference between the above example for Smarty and the syntax used to display single-value localization strings in template files: for po fileīelow is shown a similar structure for use in Smarty templates: On the value of $n in accordance to the formula contained in the. To obtain the desired localization form for a word in PHP code, use the following syntax: // this code will return one of the values запись, записи, or записей depending po file is used to specify that there are three plural forms in the Russian language (as shown in the above example)Īnd contains a formula to determine the correct plural form of a word depending on the number used with that word:Ī translation example of multiple word forms in a. (there are several plural forms of the Russian word запись = record): ![]() Is required by the rules of a specific language e.g. Multiple translation forms allow an application developer to easily display localization strings in the correct form depending on the context, if it Translations of some or all interface strings are missing, then their English keys will be displayed in a browser. This will allow your application to have a fully functional web interface in English. We recommend using English strings as localization keys. msgid is a localization key which is used in an application's source code (in PHP or Smarty files).po file by a pair of lines as shown below: msgid "Name" "Content-Type: text/plain charset=utf-8\n" po file containing translations into Russian: msgid "" mo extension e.g., using theīelow is shown an example of a. po file, the file must be compiled to a file with the. ![]() To allow the application to use translations from a. po extension is a text file of in a special format, which contains translations of text strings for a specific language locale. Wa-apps/ / locale/ru_RU/LC_MESSAGES/blog.po.Ī file with the. For example, a localizationįile containing translation of text strings used in an application with the blog identifier into the Russian language must be located at Gettext localization files containing translations of interface strings to other languages must be placed inside the application file system If no translation for string word is found, the string is displayed without translation: word. To display string word translated to the current user language, you can use the following syntax: Gettext or, if it is not installed on the server, similar functions written in PHP are used. The localization mechanism utilizes the functions provided by PHP extension Webasyst framework has built-in support for multi-lingual applications. ![]() Collecting product reviews via a widget.Dummy theme template for custom design theme development.One-click installation (for web hosting companies). ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |