Localization Generation
How does LocaleStation generate localization?
LocaleStation uses JSON as the format that stores information about each language, including cultures and localized strings. You can define a new language easily in the format shown below. For example, here is one for English:
This language file contains the necessary parameters to allow LocaleStation to generate classes related to each language. The following information is stored:
lang
: Contains a three-letter ID for a language, such aseng
,spa
,ind
, etc.name
: Contains a full name for a language, such as English, Spanish, Hindi, etc.cultures
: Contains a list of valid cultures by their IDs, such asen-US
,sp-AR
,hi-IN
, etc.locs
: An array of locale information objects that consist of:loc
: Localization ID (must match but not necessarily exist for every language)text
: Final localized text to return
Once you're done defining new localization files, you'll have to import them to your project files as additional files. For example, if you've stored language files under Resources/Languages
, you'll have to add the below item to the project:
Once the build succeeds, you can access the LocalStrings
class, which will be explained in the below page:
You can use the following additional properties:
AptLocDisableLocalization
: Specifies whether to exclude a localization file from the list of localization files to be parsed. Only effective if you're using wildcards to specify language paths, like below:AptLocDisableInvalidCultureWarnings
: Specifies whether to disable invalid culture warnings or not. If you disabled invalid culture warnings, invalid cultures will be considered valid. Otherwise, warnings will be issued for every invalid culture, removing them from the list of language cultures.
Last updated