How fallback mechanisms work
masterWhen a translation key is not found, i18n.lua follows this search order:
- Locale Ancestry: It looks in the current locale's parents. Parents are determined by splitting the locale string by hyphens (
-). For example, if the locale isen-US, it will checkenif the key is missing inen-US. - Fallback Locale: If not found in the ancestry, it searches the 'fallback locale' (which defaults to
en). If the fallback locale has parents, those are searched as well. - Default Key: If all locales fail, it looks for a special
defaultkey within the provided translation data. - Nil: If none of the above succeed, the function returns
nil.