feat(i18n): full RTL/CJK support — fonts, Japanese locale, directional fixes

Bundle Noto Sans Arabic + Noto Sans JP (SIL OFL 1.1) as per-glyph fallbacks
for both the UI text theme and every generated PDF, so RTL (Arabic) and CJK
render on all platforms — including desktop, where the system font may lack
them — instead of tofu. A shared pdf_fonts.dart centralizes the PDF theme and
the three label/catalog/recovery services reuse it.

Add Japanese (ja) as the CJK reference locale — fittingly, the app's own name
is Japanese (種, tane, 'seed'). Core strings translated; the rest fall back to
English via slang. Wired into supportedLocales (automatic) and the settings
picker.

Fix three physical Alignment.centerLeft -> AlignmentDirectional.centerStart in
variety_detail_screen, and make month-abbreviation and avatar-initial
truncation grapheme-safe (.characters) so CJK text is never cut mid-character.

Tests: CJK/Arabic PDF glyph render, ja locale resolution + English fallback.
The chat-bubble mirroring flagged by the audit was verified correct (already
respects Directionality) and left unchanged.
This commit is contained in:
vjrj 2026-07-14 11:11:19 +02:00
parent 41ea6735d2
commit baa8867287
31 changed files with 686 additions and 104 deletions

View file

@ -265,6 +265,7 @@ class _Translations$settings$es extends Translations$settings$en {
@override String get langPt => 'Português';
@override String get langFr => 'Français';
@override String get langDe => 'Deutsch';
@override String get langJa => '日本語';
@override String get about => 'Acerca de';
@override String get aboutText => 'Inventario local y cifrado para semillas tradicionales. AGPL-3.0.';
@override String get aboutOpen => 'Acerca de Tane';
@ -1490,6 +1491,7 @@ extension on TranslationsEs {
'settings.langPt' => 'Português',
'settings.langFr' => 'Français',
'settings.langDe' => 'Deutsch',
'settings.langJa' => '日本語',
'settings.about' => 'Acerca de',
'settings.aboutText' => 'Inventario local y cifrado para semillas tradicionales. AGPL-3.0.',
'settings.aboutOpen' => 'Acerca de Tane',
@ -1924,9 +1926,9 @@ extension on TranslationsEs {
'sale.add' => 'Registrar venta',
'sale.empty' => 'Aún no hay ventas. Anota aquí lo que vendes o compras.',
'sale.iSold' => 'Vendí',
'sale.iBought' => 'Compré',
_ => null,
} ?? switch (path) {
'sale.iBought' => 'Compré',
'sale.direction' => '¿Vendes o compras?',
'sale.counterparty' => '¿Con quién?',
'sale.counterpartyHint' => 'Una persona o un colectivo (opcional)',