-
-
Notifications
You must be signed in to change notification settings - Fork 45
Custom Translations
With the release of 2.0.0 of the Trufi Core, we have a new possibility to integrate custom translations into the Trufi Core.
You will need to pass into the TrufiConfiguration Singleton a custom translation with your translations that you want. This is currently available for title
, tagline
, description
, aboutContent
.
void setupTrotroTranslations(TrufiConfiguration config) {
config.customTranslations
..title = {
// LangKey is possible
Locale("de"): "Trotro App",
// LangKey and CountryKey is possible
Locale("en", "US"): "Trotro App",
Locale("es"): "Trotro App",
Locale("fr"): "Trotro App",
Locale("it"): "Trotro App",
Locale("qu"): "Trotro App",
};
}
There is always a fallback strategy. That being said, it means that if you have set your application with a Locale with language Key and Country Key and it cannot find the CountryKey, it will fall back to the Language Key only version. If this one does not exist, it will fall back to the Trufi App default translation.
customTranslation Language + Country Key > customTranslation with LanguageKey > Default Translation
If you need more specific overwrites, feel free to create an issue here. Or clone the Trufi Core Repository to change the translations directly.
-
Getting Started
-
Translations