fix(i18n): 去掉印尼语内容完整性过滤,缺失时回退中文
This commit is contained in:
1 parent
c307903c42
commit
3bc79ad8e2
12 files changed
+17
-123
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/core/data/models/drama.dart';
|
||||
import 'package:fruitshorts/core/formatting/localized_content.dart';
|
||||
import 'package:fruitshorts/core/formatting/content_locale_guard.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations_en.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations_id.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations_zh.dart';
|
||||
@@ -77,7 +76,7 @@ void main() {
|
||||
expect(localizedDramaSynopsis(zh, custom), 'Custom synopsis');
|
||||
});
|
||||
|
||||
test('should_not_fall_back_to_chinese_when_indonesian_copy_is_missing', () {
|
||||
test('should_fall_back_to_chinese_when_indonesian_copy_is_missing', () {
|
||||
const drama = Drama(
|
||||
id: 'missing-id-copy',
|
||||
title: '古城',
|
||||
@@ -87,35 +86,8 @@ void main() {
|
||||
posterUrl: '/files/poster.png',
|
||||
);
|
||||
|
||||
expect(drama.localizedTitle('id'), isEmpty);
|
||||
expect(drama.localizedSynopsis('id'), isEmpty);
|
||||
});
|
||||
|
||||
test('should_filter_incomplete_indonesian_content_from_visible_list', () {
|
||||
const complete = Drama(
|
||||
id: 'complete-id-copy',
|
||||
title: 'Kota Lama',
|
||||
synopsis: 'Kisah dari kota lama.',
|
||||
titleLocales: {'id': 'Kota Lama'},
|
||||
synopsisLocales: {'id': 'Kisah dari kota lama.'},
|
||||
posterUrl: '/files/complete.png',
|
||||
);
|
||||
const incomplete = Drama(
|
||||
id: 'incomplete-id-copy',
|
||||
title: '古城',
|
||||
synopsis: '中文简介',
|
||||
titleLocales: {'zh': '古城'},
|
||||
synopsisLocales: {'zh': '中文简介'},
|
||||
posterUrl: '/files/incomplete.png',
|
||||
);
|
||||
|
||||
expect(isDramaCompleteForLocale(complete, 'id'), isTrue);
|
||||
expect(isDramaCompleteForLocale(incomplete, 'id'), isFalse);
|
||||
expect(visibleDramasForLocale([complete, incomplete], 'id'), [complete]);
|
||||
expect(visibleDramasForLocale([complete, incomplete], 'en'), [
|
||||
complete,
|
||||
incomplete,
|
||||
]);
|
||||
expect(drama.localizedTitle('id'), '古城');
|
||||
expect(drama.localizedSynopsis('id'), '中文简介');
|
||||
});
|
||||
|
||||
test('should_ignore_raw_catalog_text_when_drama_is_seeded', () {
|
||||
|
||||
Reference in new issue
Block a user