feat(i18n): add redesign strings and translate Escuchar rename to 11 locales

This commit is contained in:
2026-07-29 16:35:30 +02:00
parent 2959941485
commit 3ec41bb31e
27 changed files with 2715 additions and 909 deletions
+36
View File
@@ -0,0 +1,36 @@
import 'dart:convert';
import 'dart:io';
/// All 13 supported locale codes backing `lib/l10n/app_*.arb`.
///
/// `flutter test` always runs with the working directory set to the
/// package root, so `lib/l10n/...` below resolves correctly without any
/// extra path juggling.
const List<String> supportedArbLocales = [
'ar',
'bn',
'de',
'en',
'es',
'fr',
'hi',
'id',
'it',
'ja',
'pt',
'ru',
'zh',
];
/// Reads and decodes `lib/l10n/app_<locale>.arb` as a JSON map.
Map<String, dynamic> readArb(String locale) {
final file = File('lib/l10n/app_$locale.arb');
return json.decode(file.readAsStringSync()) as Map<String, dynamic>;
}
/// Real translation keys only -- excludes ICU metadata entries (`@key`)
/// and the `@@locale` marker, which are not themselves translatable
/// strings.
Set<String> realKeys(Map<String, dynamic> arb) {
return arb.keys.where((key) => !key.startsWith('@')).toSet();
}