Read or Write Translatable Files
Read or Write Translatable Files
The Read or Write Translatable Files task presents a view of the lang_files table. It enables you to read translatable files to the localization tables, and to write translatable files from the localization tables. See Localization Tables.
Applications to Include, Core Files, and Per-Site View Files
Depending on which selection you make for Applications to Include , Include core files and Include per-site view files checkboxes are enabled or disabled.
Choose
Include All Applications
if you want to localize all applications in
\schema\ab-products\
, with the option to include core files and per-site view files. Default setting for both types of files is checked. If desired, uncheck one or both boxes next to
When reading or writing include
. The image below, from
System / Localization Manager / Read or Write Translatable Files
, illustrates these settings:
Choose Include a single application to localize files for a specified application. Core files option is disabled, as it is not applicable for single applications. Per-site view files option is enabled and unchecked. If desired, check the per-site view files option.
Choose Mobile strings only to localize strings only for mobile apps. Checkboxes to include core files and per-site view files are disabled in this case, as mobile apps reside in a separate folder altogether. Thus these two options do not apply.
Include Core Files
If you select to Include core files :
- The selection to delete and re-create Archibus language files (.lang files) is automatically selected.
-
The read action reads all:
- \ab-core and ab-system .js files
- \ab-core\control.js files
-
The write action writes:
- the core-xx.lang for the given language
- the schema\ab-core\controls\lang\*.js files for the controls.
Note: If you are adding a new language that is not currently supported, you must add the language and locale to the afm-config.xml file before extracting the strings. If you omit this step, the language is not available in the Sign-In Page selection list on the sign-in screen. See Adding Languages and Locales to the afm-config.xml File.
To Read or Write Translatable Files
- Select System / Localization Manager / Read or Write Translatable Files .
- From the Language list, select the target language. If this is a new language, you must add it to the \WEB-INF\config\context\compatibility\afm-config . xml file, and then add the record to the Languages table. See About the Language Selection .
-
Select one of the following:
- Select all applications, for example, when translating Archibus to a new language.
- Select a single application, for example, when translating a personalized extension or a view file created using the View Definition Wizard. When selecting a single application, use the Specify option to select the subfolder for the application.
- Choose Mobile strings only if you want to translate only the Archibus mobile apps . This is convenient if you are translating the interface for only your mobile app users.
-
Select the files to include.
- If you select to include all applications and to include core files, the search includes all files within the schema directory.
- If you select to include all applications, then the program deletes all existing Archibus language files and re-creates them.
- If you select to include a single application, you can select to add new application strings to existing language files, or to create new language files. Creating new language files enables you to keep your translated strings separate from those provided by Archibus, so that you can upgrade your Archibus core and applications separately from your own extensions.
- If you are translating Archibus mobile apps, make sure that you select the "Mobile (.js)" checkbox.
- If your user will use home pages to access tasks, be sure to check "View Files," which includes the .xml home page descriptor files.
- Click the Read Files or Write Files button, located in the upper right corner of the form.
Note: When localizing the mobile apps, note that after reading and writing the translatable files, you must rebuild and republish the mobile apps in the native device. For information, see Localizing the Mobile Apps.
Localization: Java Files and Naming Conventions
Java files and naming conventions play a role in the localization process.
Background
When you extract strings, the Localization Kit allows you to extract from:
- All applications, or
- A single application
If you select Include a single application , a Specify field appears:
Click the browse icon at the right to open the Select Value - subfolder pane:
Click the desired subfolder to select the application you want to include. The subfolder appears in the Specify field.
Note: All relevant Java files are included in the applications folder.
Naming conventions used in Search
To ensure your application's Java strings are extracted, the Localization Kit follows these conventions:
- If you select Include All Applications , search under the applications folder. For example: C:\Users\<username>\git\applications\ .
-
If you select Include a single application , try to generate the component name and path for the .java files:
Localization Kit uses the input or selected path directly, and tries to convert to the component name and main folder first. For example:
\ab-products\ workplace\hoteling to ...\applications\webcentral-application- workplace-hoteling
If the folder does not exist, then use the parent folder to construct the component name and main folder path instead. For example:
\ab-products\ risk\clean to ...\applications\webcentral-application- risk
-
Lastly, take the main folder path, and search under the eventhandler , app , and service folders, to find the correct subfolder. For example:
\ab-products\ risk\clean to ...\applications\webcentral-application- risk \src\main\java\com\archibus\ eventhandler\clean
Special cases
In some cases, the Localization Kit hard-codes folder mapping. For example, building-operations vs. bldgops , or assets vs. workplace-assets . To avoid or minimize special cases, ensure naming conventions between user inputs and .java searches match.
Application vs. platform
In the Select Value - subfolder pane, where you specify a single application, all but one of the available options map to webcentral-application folders. The exception is \ab-products\system-administration , which is handled as a special case.