fix(i18n): 印尼语内容缺失时不再回退中文

This commit is contained in:
Vicky authored and trae-solo-agent committed 2026-10-30 17:14:37 +08:00
1 parent 9ef8eb15b0
commit 19196ceb8e
13 files changed
+261 -95

No files matched your search

+13 -3
View File
@@ -12,6 +12,7 @@ import '../../../core/data/services/catalog_controller.dart';
import '../../../core/data/services/category_controller.dart';
import '../../../core/data/services/home_feed_controller.dart';
import '../../../core/data/services/wallet_controller.dart';
import '../../../core/formatting/content_locale_guard.dart';
import '../../../core/theme/app_colors.dart';
import '../../../core/theme/app_dimens.dart';
import '../../../core/widgets/app_pull_to_refresh.dart';
@@ -194,7 +195,10 @@ class _HomeFeedGridState extends State<HomeFeedGrid> {
mainAxisSpacing: AppDimens.homeGridRowGap,
);
}
final dramas = _dramasFor(category);
final dramas = _dramasFor(
category,
Localizations.localeOf(context).languageCode,
);
if (widget.feedController.loadingFirstPage && dramas.isEmpty) {
return const DramaGridSkeleton(
key: Key('home-grid-skeleton'),
@@ -324,8 +328,14 @@ class _HomeFeedGridState extends State<HomeFeedGrid> {
];
}
List<Drama> _dramasFor(HomeGridCategoryShortcut category) {
final dramas = widget.feedController.dramas;
List<Drama> _dramasFor(
HomeGridCategoryShortcut category,
String languageCode,
) {
final dramas = visibleDramasForLocale(
widget.feedController.dramas,
languageCode,
);
final categoryName = category.categoryName.toLowerCase();
if (categoryName.isEmpty) return dramas;
final matched = dramas