fix(i18n): 印尼语内容缺失时不再回退中文
This commit is contained in:
1 parent
9ef8eb15b0
commit
19196ceb8e
13 files changed
+261
-95
No files matched your search
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/data/models/drama.dart';
|
||||
import '../../../core/formatting/error_text.dart';
|
||||
import '../../../core/formatting/content_locale_guard.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
import '../../../core/widgets/empty_state.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
@@ -33,10 +34,18 @@ class DiscoverSearchResults extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
if (!loading && error == null && results.isNotEmpty) {
|
||||
final visibleResults = visibleDramasForLocale(
|
||||
results,
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
if (!loading && error == null && visibleResults.isNotEmpty) {
|
||||
return SliverPadding(
|
||||
padding: _topPadding,
|
||||
sliver: SliverDramaGrid(l10n: l10n, dramas: results, onOpen: onOpen),
|
||||
sliver: SliverDramaGrid(
|
||||
l10n: l10n,
|
||||
dramas: visibleResults,
|
||||
onOpen: onOpen,
|
||||
),
|
||||
);
|
||||
}
|
||||
return SliverPadding(
|
||||
|
||||
Reference in new issue
Block a user