- For i18n on Fandom Developers Wiki, see Project:I18n.
The term i18n means internationalization - the separation of UI and content locale. Web developers apply i18n to their userscripts, to ensure the following:
- scripts will scale to Fandom's locale ranges
- scripts can be adapted to different languages and regions
Internationalisation is followed by script localization (numeronym: l10n) - the addition of locale-specific content into the UI.
Locale
The locale is a language and region parameter that defines the user's preference. On Fandom, wikis have set language codes and users have a language preference to reflect their locale. These can also be overridden by the ?uselang URL parameter.
Internationalisation
i18n purpose
The goal of i18n is to adapt the underlying layout or UI logic in a script, so that it isn't locale specific. That makes it possible to accommodate locale-specific content down the line, like message translations.
In general however, locale differences could possibly change layout (reading direction) and measurement systems (metric and Imperial units), even though it is mostly important for translation on Fandom.
i18n process
The i18n process involves dividing content by locale, and storing it separately from the UI in the script. This improves the user experience for developers and content translators.
i18n benefits
There are benefits to i18n:
- Better semantics - it aligns with the separation of content and logic very neatly (ex. messages are cached properly for Dev scripts as JSON)
- Less locale specific:
- Increased maintainability - easier to modify and extend a script with new features
- Increased capacity for locale-specific content
Localization
Purpose of l10n
The purpose of l10n is to ensure scripts are suitable for users from a specific locale. The I18n-js library has a message function that targets the user's locale automatically.
Note that l10n requires i18n, so that the UI is not partly or entirely fixed to the code author's language or region.
l10n process
The l10n process is longer than i18n - content is extended to fit a new locale, mainly through message translation. This is usually done through editing JSON or individual system messages.
Benefits of l10n
Here are some benefits to l10n:
- Increases diversity by accommodating users with needs that aren't met by a different locale.
- Prevent user confusion from missing locale support. For example, Mexican users don't see one English rail module header on a Spanish wiki's rail.