You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A much requested feature for kanna was i18n, this will be implemented within our framework so any of our applications (and those who use the framework) are able to have it also out of the box.
This manager has to extend the BaseManager so it can load up all the translation files.
Configuration
A new field has to be added to the IConfig interface for configuring the i18n manager.
Accessible anywhere through AkitaNeru via <AkitaNeru>.i18n.
The class should therefore be called I18nManager and have a public property resources, of type Map<string, ITranslationFile>, as well as a method <I18nManager>.find(resource: string, tag: LanguageTag): string that returns the translated resource or the default resource if it is not yet translated, if both aren't found, silently throw an error.
Files
Translation files should be JSONs and are to follow this interface:
interfaceITranslationFile{language?: LanguageTag// The language this file translates, i.e. English.messages?: {[key: string]: string|string[]}// The translations itself.}
A much requested feature for kanna was i18n, this will be implemented within our framework so any of our applications (and those who use the framework) are able to have it also out of the box.
This manager has to extend the BaseManager so it can load up all the translation files.
Configuration
A new field has to be added to the
IConfig
interface for configuring the i18n manager.Features
AkitaNeru
via<AkitaNeru>.i18n
.The class should therefore be called
I18nManager
and have a public propertyresources
, of typeMap<string, ITranslationFile>
, as well as a method<I18nManager>.find(resource: string, tag: LanguageTag): string
that returns the translated resource or the default resource if it is not yet translated, if both aren't found, silently throw an error.Files
Translation files should be JSONs and are to follow this interface:
Language tag references
The text was updated successfully, but these errors were encountered: