All user-facing strings in ErgoKawsay live in a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Cristiang1021/ErgoKawsay/llms.txt
Use this file to discover all available pages before exploring further.
translations.yaml file. A Python generator script converts them to a Dart constant class at lib/core/localization/tr.dart. There are no .arb files, no flutter_gen dependency, and no Flutter intl tooling — just a simple, reviewable plain-text source of truth that non-developers can read and edit.
Supported Locales
| Code | Language |
|---|---|
es | Spanish |
qu | Kichwa (Quechua) |
translations.yaml Structure
Each string is nested under a feature key. The leaf nodes havees and kichwa sub-keys:
es and kichwa keys, it treats that node as a leaf and emits two Dart constants.
Regenerating Translations
Edit translations.yaml
Open
translations.yaml at the project root. Add a new key under the appropriate feature namespace with both es and kichwa sub-keys, or update an existing string.Using Translations in Code
The generatedTr class exposes every string as a pair of static const String fields — one suffixed Es and one suffixed Qu. A static helper Tr.pick(bool isKichwa, String es, String qu) selects the right string at runtime:
AppLocalizations
AppLocalizations implements LocalizationsDelegate<AppLocalizations> and provides a Flutter-idiomatic API on top of the Tr constants. It reads the current locale from the Locale object passed to it and exposes named string getters:
AppLocalizations.delegate is registered in MaterialApp.localizationsDelegates alongside the Flutter standard delegates. The supportedLocales list is [Locale('es'), Locale('qu')].
The class also exposes a welcomeByHour(int hour) helper that returns the appropriate morning / afternoon / evening greeting based on the hour of day.
Kichwa Locale Workaround
Kichwa (qu) is not included in flutter_localizations, so Flutter would throw an error when trying to resolve Material and Widgets strings for that locale. ErgoKawsay works around this with two private custom delegates:
_KichwaMaterialDelegate— extendsLocalizationsDelegate<MaterialLocalizations>and returns Spanish Material localizations for thequlocale._KichwaWidgetsDelegate— extendsLocalizationsDelegate<WidgetsLocalizations>and returns Spanish Widgets localizations for thequlocale.
GlobalMaterialLocalizations.delegate and GlobalWidgetsLocalizations.delegate in the localizationsDelegates list so that they intercept the qu locale first.
LocaleController
LocaleController(StorageService) is a ChangeNotifier that manages the active Locale across the app. It is provided at the root of the widget tree via Provider.
setLocale() persists the choice to StorageService, updates the Locale object, and calls notifyListeners(), which triggers a full rebuild of MaterialApp with the new locale.