Skip to content

LocalizationEditor

Max S edited this page Aug 20, 2015 · 3 revisions

Editor Localization

This article discusses support for localization in the editor. Note that it specifically addresses editor localization. Putting any string in the editor into _("your string") will make it localizable. When the editor runs this line of code, it searches for the given string in the localization strings which are loaded from database on editor startup. Form input titles and link texts are automatically passed through localization. After finishing with the code changes, you need to run "editUpdateStrings" tool. It will find all strings in your code and output an SQL file that has INSERTs for new strings. Once the strings are in database, you can use the usual localization workflow described in the Localization Support article.

Example of localized string:

p(_("File unpacked successfully."));

The "editUpdateStrings" tool is located in "tools/editUpdateStrings/" and accepts two command-line arguments: project ID and starting directory. It searches that directory recursively for all ".hx" files and works through them. Project ID will be used to give unique ID to all found strings. If project ID is "core", then the script will use database table for core editor strings.

If you want to localize core editor strings into an unsupported language, you can do it. The core editor strings will be in the localization strings file that you download through the editor.

The SQL file containing the latest editor localization strings is distributed in Snipe package.

Clone this wiki locally