import 'package:flutter_test/flutter_test.dart'; import 'package:tane/i18n/strings.g.dart'; /// Japanese (`ja`) is the CJK reference locale — fitting, since the app's own /// name is Japanese (種, *tane*, "seed"). It proves the CJK path end to end: /// the locale is wired, core strings resolve in Japanese, and untranslated /// keys fall back to the English base (slang `fallback_strategy: base_locale`). void main() { test('ja is a supported locale', () { expect( AppLocaleUtils.supportedLocales.map((l) => l.languageCode), contains('ja'), ); }); test('core strings resolve in Japanese', () { final ja = AppLocale.ja.buildSync(); expect(ja.menu.inventory, '在庫'); expect(ja.common.save, '保存'); expect(ja.settings.langJa, '日本語'); }); test('untranslated keys fall back to the English base', () { final ja = AppLocale.ja.buildSync(); final en = AppLocale.en.buildSync(); // `menu.plantares` is left untranslated in ja (a coined feature name), so // it must surface the English text rather than a blank or a key. expect(ja.menu.plantares, en.menu.plantares); expect(ja.menu.plantares, isNotEmpty); }); }