Adobe 65007312 Programming Guide - Page 148
Localization dictionary files
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 148 highlights
CHAPTER 7: Using ZStrings for Localization Localization dictionary files 148 Localization dictionary files To localize your plug-in's user interface, you must provide a localization dictionary file for each language, named and located as follows: X Each translation dictionary must be in a file named TranslatedStrings_code.txt. The code is the two-letter ISO code for the language, such as en for English, fr for French, de for German, ja for Japanese, and so on. X The dictionary files must located be in the top plug-in folder, with the Info.lua file. Lightroom automatically selects the appropriate translation file based on the current language in use for the application. Lightroom performs ZString translation when it creates the object containing the string. When the LOC function encounters a ZString, it looks for the localization dictionary appropriate to the current locale, and uses it to find translations for static ZString values. X If there are no localization dictionary files, or if none is found to match the application language, the LOC function returns the value string found in the original ZString. X When it does find a matching dictionary file, the LOC function locates the ZString in the dictionary file using the context path and property name; that is, the first part of the supplied ZString up to, but not including the = sign. If a matching line is found, LOC removes the first part of the found ZString up to and including the = sign, and returns the remaining string as the translation. X If a matching line is not found in the dictionary, the function returns the value string found in the original ZString. Localization dictionary file format A localization dictionary file is a text file containing one ZString translation entry per line. Each ZString's final string value is in the destination language. The text must be encoded in UTF-8. The only things allowed on a line (after the first character) are ZStrings; no newline characters or comments are allowed. The ZStrings in this file must all be enclosed with double quotes. The following text editors are recommended for creating these files: X In Mac OS X simply use TextEdit and make sure you save the file type as "UTF-8" (rather than UTF-16 or UCS-2, for instance). X In Windows use Notepad, and be sure to save the file as type "UTF-8." The file is UTF-8 formatted text. A leading UTF-8 byte-order marker (EF BB BF) is permitted.