meta data for this page
l10n is a shorthand notation for localisation, which allows players from different countries to play the game in their native language. It may be helpful to understand the basics of Localisation in Winter Resort Simulator if you want to create mods in more than one language.
In general, we strongly recommend to use localisation, even if you are just working on one language. It can happen that members of the community volunteer to translate your mod, therefore it is good to already use localisation from the very beginning on.
The basic concept is simple: The localisation system stores many strings (i.e. texts). You can register each string in multiple languages, and game will automatically return the correct language as defined by the player.
The game's main languages are:
en: English (Default and fallback language)
Additionally, there are four translations available:
In case a text is not available in the language selected by the player, the game will automatically fall back to the English text. Therefore, please make sure that you always register all keys in English as well!
l10n.add(language, key, value)
Registers a text in the given
language (string, e.g.
en). The text will be identified by its
key (string) and its value (returned e.g. by
l10n.get()) will be equal to
function l10n.add(language, key, value)
Returns the correct translation for
key. If the text cannot be found,
fallback (optional string) will be returned. In case no
fallback is specified, it will return
function l10n.get(key, fallback)
key (string), the function will
l10n.get(key:sub(2))if key starts with a dollar sign (
$), or otherwise
Using this function, it is possible to allow both untranslated text (starting with any letter or character except
$) and translated texts (starting with
$ and then containing the text's
Returns the currently active language (e.g.
Returns the user's system language (e.g.
Sets the currently active language to
language. Note that this will not change any texts that have been translated before changing the language (those will remain in the previously active language).
Displays a length of
value metres (float) in the appropriate form for the currently active language, i.e. a value of
1 will be translated as
3.28 ftin case the current language is
1.00 mfor all other languages.
All contents of this page may be used for modding use for Winter Resort Simulator - Season 2 only. Any use exceeding this regulation is not permitted.
Copyright (C) HR Innoways, 2021. All Rights Reserved.