The UI Assistant’s text settings and components allow you to easily swap between predefined text styles that automatically adjust to the active language. The Dictionary also enables you to easily manage your project’s localization.
The Option Localizer is an abstract class that serves as a base for the Dropdown Localizer and the Option Cycler Localizer components. Both Option Localizers set their required TMP Dropdown’s or Option Cycler’s options based on a list of Localization Sets, and the active Language. This component is responsible for localization only; to avoid running into an issue where the options aren’t displayed correctly (due to the font missing the characters of the localization), please remember to add Text Stylers where necessary.
Option Localizers aren’t required when using Option Syncers, as the latter handles option setup, as well as localization, if needed.
Localization Sets whose correct localizations will override the Dropdown's options.
Adds a Localization Set to the options.
Adds a list of Localization Sets to the options.
Removes a Localization Set from the options.
Clears all options.
Updates options with the Localization Sets when the active Language changes.
The Text Styler sets its required Text Mesh Pro UGUI component’s Font Asset, Font Size, Min Font Size, and Max Font Size values based on the selected Text Style, as well as the active Language. With Localization enabled, it will also update the text displayed, based on the selected Localization Set, and the active Language.
With Localization set to None, the Text Styler will only update the values listed above, but the text itself will remain unchanged. Select this option if your project doesn’t have localization options.
If Localization is set to Localized, the Localization Set property will appear. Clicking on its dropdown will open a popup that lists all of your Localization Sets, with a search bar to help you find the right one for the text in question.
Localization should be set to Static if you want your text to always use a specific Language’s Text Style settings, without changing the text. This is useful when your UI displays texts in multiple languages at once (e.g.: your language selection UI lists all options as text toggles in their own language). Static Text Stylers won’t be affected when the active Language changes.
Style defined in the Text Settings. Determines the text's font asset and font sizes.
Determines which interpolation values of the active Scale Profile will be considered when setting the text’s font size.
When set to true, the text's font size settings will not be overridden.
Determines which Language's settings within the selected Text Style will be applied.
Localization Set whose correct localization will be used to override the text.
The language of the Text Mesh Pro UGUI's text.
Updates the Text Mesh Pro UGUI's font size, minimum font size, maximum font size, word spacing, line spacing, and paragraph spacing values based on the selected Text Style, and sets its text based on the selected Localization Set.
Updates the Text Mesh Pro UGUI's font size, minimum font size, and maximum font size values based on the Scale Settings.
The Text Settings window can be opened via the “Tools/UI Assistant” menu, or, by clicking on the “Open Text Settings” button at the bottom of related components.
A list of Text Styles added to the Text Settings asset. This is handled by the Text Settings editor; please do not add or remove any Text Styles yourself.
A list of Languages added to the Text Settings asset. This is handled by the Text Settings editor; please do not add or remove any Languages yourself.
A list of Localization Sets added to the Text Settings asset. This is handled by the Text Settings editor; please do not add or remove any Localization Sets yourself.
The TextSettings script includes several public methods used by components automatically, or the Text Settings editor window. It is recommended to only use the method below.
Updates all Localizables based on their selected Localization Set.
The active Language that will determine the Font Asset, Font Size, Min Font Size, and Max Font Size values set by Text Stylers. Active Language also determines which texts of your Localization Sets will be displayed.
The index of the active Language, based on the order of Languages set within the Text Settings.
Returns an array of Text Style names listed in the Text Settings.
Returns an array of Language names listed in the Text Settings.
Returns an array of Localization Set names listed in the Text Settings.
Text Styles contain data used by Text Stylers and Dropdown Localizers, and allow you to define style categories for various purposes (e.g.: you can have unique Text Styles for your buttons, headers, lengthy texts, etc.), with different fonts and sizes.
The “Update Text Stylers” button allows you to apply current settings to all Text Stylers in the open scene.
Click on the “Edit” button (gear icon) next to a Text Style to open its editor, or, click on the “New Text Style” button to create a new one – this will automatically open the editor.
The “Apply to All Languages” button allows you to copy the Font Size, Min Font Size, and Max Font Size values corresponding to one Language to all other Languages.
The name of the asset.
A list of Font Assets, Sizes, Min Sizes, Max Sizes for every Language added to the Text Settings.
Updates Styles based on changes made to Languages. Text Settings automatically handles validation.
Returns the Style that corresponds to a specific Language.
A Language represents one of your project’s localization options. Every Language will appear in all of your Text Styles and Localization Sets. The names set in the left column must be in sync with the languages listed in your import sheet’s first row.
The name of the asset.
The name of the language in that language, made visible to the user.
Localization Sets, with the help of Text Stylers, allow you to display text in multiple languages, based on the Language assets you’ve created.
The Text Settings window’s Dictionary contains a list of all of your Localization Sets. Click on the “Edit” button (gear icon) next to a Localization Set to open its editor, or, click on the “New Localization Set” button to create a new one – this will automatically open the editor.
Unique identifier of the Localization Set.
A list of localizations that each correspond to a Language.
Updates Localizations based on changes made to Languages. Text Settings automatically handles validation.
Returns true if there is at least one localization missing from this Localization Set.
Returns the localization that matches the active Language.
Each Localization Set will require you to give it a unique Key for easy identification. The Localization Set editor will list all Languages created in the Text Settings, with an input field for the corresponding localization. Adding or removing Languages will update all existing Localization Sets with the changes, and display a warning icon next to all Localization Sets that have a missing localization.
The Dictionary allows you to import several Localization Sets at once. To use this feature, an Excel or Google Sheets document must be prepared with Keys in the first column, and Languages to its right, matching the Languages tab's order. Please refer to Samples/LocalizationTemplate.xlsx, or the Google Sheets document below for reference.
You have two options when importing your project's localization:
Select the rows you'd like to import, copy them to the clipboard, then click on the "Paste Localization Sets" button. You can include the header row in your selection, as it will be ignored. You must select entire rows rather than specific cells.
If you're using a Google Sheets document, you can click on the "Import Localization Sets" button to import all data at once. To use this feature, your document must be published: go to File/Share/Publish to web, and select Tab-separated values (.tsv) in the popup, then copy the link you receive after publishing into the Dictionary's Localization URL field.
Both options will open a popup where you can select which Localization Sets you would like to import – everything will be selected by default.
Localization Sets can be copied to the clipboard using the Dictionary’s “Copy Localization Sets” button. Once copied, simply paste the text data into the first cell of a new sheet, and your localizations will appear in the format required by the Localization Importer.
Removing Localization Sets in a bulk can be done quickly using the Localization Remover function. Click on the “Remove Localization Sets” button in the Dictionary, select any unwanted Localization Sets, then click on the “Remove Selected” button. By default, none of your Localization Sets will be selected.