Hack The Library
#
The LoaderThe loader provides you with the ability to override the default handling of translation file loading.
#
The InterceptorThe interceptor provides you with the ability to manipulate the translation object before it is saved by the service.
#
Missing HandlerThis handler is responsible for handling missing keys. The default handler calls console.warn()
with the key when config.isProdMode is set to false
, and returns an empty string to use as a replacement for the missing key's value.
#
Fallback StrategyThe fallback strategy is responsible for loading the fallback translation file, when the selected active language has failed to load. The default behavior is to load the language set in the config.fallbackLang
, and set it as the new active language.
When you need more control over this functionality, you can define your own strategy:
The getNextLangs
method is called with the failed language, and should return an array containing the next languages to load, in order of preference.