Externalize Strings Wizard
Reference documentation for Externalize Strings Wizard
Last updated
Reference documentation for Externalize Strings Wizard
Last updated
The Externalize Strings Wizard is a powerful tool used to manage and externalize strings for internationalization (i18n). This tool allows developers to move hard-coded strings into external properties files, facilitating easier translation and localization of the application. The wizard provides a comprehensive interface to filter, select, and manage strings efficiently.
Warning It is highly recommended to define a clear i18n (internationalization) strategy from the beginning when developing multi-language applications. By planning for internationalization at the start and implementing it using i18n editor, you can integrate multi-language support more easily into your application, making it simpler to manage and maintain.
Externalization of strings should be considered a secondary approach, useful mainly when the need to support additional languages arises later in the development process and was not planned for from the start. While externalization can effectively add multi-language support to existing applications, it can be more difficult and prone to mistakes compared to having a clear internationalization strategy from the beginning.
A text input box where you can type keywords to filter the list of strings. The filtering supports real-time updates, displaying only those strings that match the entered keywords. This is particularly useful for quickly finding specific strings in large projects.
Property Column: Displays the hierarchical list of properties (strings) categorized by their context such as forms, methods, and global variables. Each node can be expanded or collapsed to show or hide nested items.
Text Column: Shows the actual text content of each property. This allows you to see what text is being used in the application, making it easier to identify which strings need to be externalized. Key Column: Displays the i18n key that will be used in the properties file for each string. This key is what will be referenced in the code to fetch the localized string.
Operation Column: Indicates the operation to be performed on each string. Common operations include:
Extern: Marks the string for externalization.
Ignore: Marks the string to be ignored and not externalized.
Checkboxes: Located next to each property to select or deselect strings for the specified operation. This allows for bulk actions on multiple strings at once.
Checkbox to include messages that are stored in the database in the list. This ensures that all possible sources of strings are covered.
Checkbox to display strings that have already been externalized. This helps in reviewing what has been done previously and avoiding duplication.
Checkbox to show messages that have been marked to be ignored. This can be useful to revisit and potentially change the decision to ignore certain strings.
Checkbox to include messages that have no text. This can help identify and clean up unused or placeholder strings.
Checkbox to display only those messages that have been edited during the current session. This helps in focusing on the changes made without distractions.
Input field to specify a prefix that will be added to all generated keys. This is useful for organizing keys systematically, such as by module or feature. The Apply
button saves the changes made.
Executes the externalization process for the selected strings. This moves the selected strings to the external properties file and updates the code references to use these keys.
Closes the wizard without saving any changes made during the current session. This provides a way to exit without applying unwanted modifications.
Here are the steps for sorting fields:
Open the Externalize Strings Wizard: This can be accessed from the Servoy developer Actions menu.
Filter Strings (Optional):
Use the Filter Input Field at the top to search for specific strings by typing part of the string or property name. This feature supports real-time filtering, meaning the list of strings will dynamically update to show only those that match your search criteria. This is useful for narrowing down the list to specific items of interest, especially in large projects with numerous strings.
Review and Select Strings:
Browse through the Properties Tree to review the available strings. The tree is organized hierarchically by context, such as forms and methods, which can be expanded or collapsed to navigate through different sections.
Check or uncheck the boxes next to each string to select or deselect them for externalization. This allows you to specify which strings will be moved to the external properties file. Each node can contain nested items, and selecting a parent node typically selects all its children.
Configure Options:
Show Database Messages: Check this box to include messages stored in the database in the list of strings. Database messages might include user-generated content or system messages that are dynamically stored and need to be localized.
Show Externalized Messages: Check this box to display strings that have already been externalized. This is useful for reviewing previously externalized strings to ensure consistency and to avoid redundant work.
Show Ignored Messages: Check this box to include messages that have been marked to be ignored. This can be useful for revisiting and potentially reconsidering which strings should be excluded from externalization.
Show Messages with Empty Text: Check this box to display messages that have empty text fields. Empty text fields might indicate placeholders or fields that need to be reviewed and possibly filled in or removed.
Show Only Edited Messages: Check this box to display only those messages that have been edited during the current session. This helps in focusing on the changes made without distractions, allowing for a review of all recent modifications before applying them.
Enter Common Prefix for Generated Keys: Enter a common prefix for all generated keys in this input field. Using a common prefix helps in organizing the keys systematically, which can be particularly useful for large projects with many localized strings. For example, you might use prefixes to group keys by module, feature, or language, making it easier to manage and maintain the properties files. Click the Apply button to implement the prefix.
Externalize Strings:
Once you have reviewed and selected the strings, click the Externalize button to move the selected strings to the external properties file. This process involves updating the code references to use the keys defined in the properties file instead of hard-coded strings. Externalizing strings in this way facilitates easier translation and future updates, as changes can be made in the properties files without modifying the codebase.
Cancel Operation:
If you decide not to apply any changes, click the Cancel button to close the wizard without saving. This exits the wizard and discards any modifications made during the current session. Using the cancel option ensures that no unintended changes are applied, providing a safe exit if you are unsure about the modifications.