Complete and revise every shipped locale against the current English source, preserve locale-specific plurals, and map script-specific Chinese locales through device, Intl, duration, and Plex boundaries. Co-authored-by: emgeje <mgj@mgj.hu> Co-authored-by: junyou1998 <junyou1998@gmail.com>
35 lines
1.2 KiB
Dart
35 lines
1.2 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:plezy/i18n/strings.g.dart';
|
|
|
|
void main() {
|
|
test('completed locale entries override the English fallback', () async {
|
|
final english = await AppLocale.en.build();
|
|
final englishValues = <String>[
|
|
english.videoControls.showPlaybackControls,
|
|
english.videoControls.hidePlaybackControls,
|
|
english.settings.tvCornerSpotlightBackdrop,
|
|
english.settings.tvCornerSpotlightBackdropDescription,
|
|
];
|
|
|
|
expect(englishValues, everyElement(isNotEmpty));
|
|
|
|
for (final locale in AppLocale.values.where((locale) => locale != AppLocale.en)) {
|
|
final translations = await locale.build();
|
|
final localizedValues = <String>[
|
|
translations.videoControls.showPlaybackControls,
|
|
translations.videoControls.hidePlaybackControls,
|
|
translations.settings.tvCornerSpotlightBackdrop,
|
|
translations.settings.tvCornerSpotlightBackdropDescription,
|
|
];
|
|
|
|
for (var index = 0; index < localizedValues.length; index++) {
|
|
expect(
|
|
localizedValues[index],
|
|
isNot(englishValues[index]),
|
|
reason: '${locale.name} must provide its own completed translation at index $index',
|
|
);
|
|
}
|
|
}
|
|
});
|
|
}
|