Skip to content

Commit 35bca6d

Browse files
committed
update localizations
1 parent ab36f0e commit 35bca6d

File tree

12 files changed

+46
-10
lines changed

12 files changed

+46
-10
lines changed

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
/* Begin PBXFileReference section */
3333
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3434
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
324ACECE25C909AD00CD3591 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
3536
32561D9E25BE823400DBD252 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
3637
3271990C25BBF9C8008EA00E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
3738
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
@@ -175,6 +176,7 @@
175176
en,
176177
Base,
177178
"zh-Hans",
179+
es,
178180
);
179181
mainGroup = 97C146E51CF9000F007C117D;
180182
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
@@ -296,6 +298,7 @@
296298
children = (
297299
97C147001CF9000F007C117D /* Base */,
298300
3271990C25BBF9C8008EA00E /* zh-Hans */,
301+
324ACECE25C909AD00CD3591 /* es */,
299302
);
300303
name = LaunchScreen.storyboard;
301304
sourceTree = "<group>";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

lib/l10n/intl_en.arb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"allArticles": "All Articles",
2+
"all": "All Articles",
3+
"unread": "Unread",
4+
"starred": "Starred",
5+
"allArticles": "All articles",
36
"allSubscriptions": "All subscriptions",
47
"filter": "Filter",
58
"feed": "Feed",

lib/l10n/intl_es.arb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2+
"all": "Todos",
3+
"unread": "Sin leídos",
4+
"starred": "Favoritos",
25
"allArticles": "Todos los artículos",
36
"allSubscriptions": "Todas las suscripciones",
47
"filter": "Filtrar",
5-
"feed": "Alimentador",
8+
"feed": "Artículos",
69
"subscriptions": "Suscriptores",
710
"groups": "Grupos",
811
"settings": "Ajustes",

lib/l10n/intl_zh.arb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"all": "全部文章",
3+
"unread": "未读文章",
4+
"starred": "星标文章",
25
"allArticles": "全部文章",
36
"allSubscriptions": "全部订阅源",
47
"filter": "筛选",

lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class MyApp extends StatelessWidget {
111111
locale: globalModel.locale,
112112
supportedLocales: [
113113
const Locale("en"),
114+
const Locale("es"),
114115
const Locale("zh"),
115116
],
116117
localeResolutionCallback: (_locale, supportedLocales) {

lib/pages/item_list_page.dart

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,24 @@ class _ItemListPageState extends State<ItemListPage> {
263263
);
264264
}
265265

266+
Widget _titleFromFilter() => Consumer<FeedsModel>(
267+
builder: (context, feedsModel, child) {
268+
String text;
269+
switch (getFeed().filterType) {
270+
case FilterType.Unread:
271+
text = S.of(context).unread;
272+
break;
273+
case FilterType.Starred:
274+
text = S.of(context).starred;
275+
break;
276+
default:
277+
text = S.of(context).all;
278+
break;
279+
}
280+
return Text(text, overflow: TextOverflow.ellipsis);
281+
},
282+
);
283+
266284
@override
267285
Widget build(BuildContext context) {
268286
final String title = ModalRoute.of(context).settings.arguments;
@@ -275,8 +293,8 @@ class _ItemListPageState extends State<ItemListPage> {
275293
? 260
276294
: MediaQuery.of(context).size.width - 60,
277295
),
278-
child: Text(
279-
title ?? S.of(context).allArticles,
296+
child: title == null ? _titleFromFilter() : Text(
297+
title,
280298
overflow: TextOverflow.ellipsis,
281299
),
282300
),

lib/pages/settings/general_page.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ class _GeneralPageState extends State<GeneralPage> {
131131
final localeItems = ListTileGroup.fromOptions(
132132
[
133133
Tuple2(S.of(context).followSystem, null),
134-
Tuple2("English", Locale("en")),
135-
Tuple2("中文(简体)", Locale("zh")),
134+
const Tuple2("English", Locale("en")),
135+
const Tuple2("Español", Locale("es")),
136+
const Tuple2("中文(简体)", Locale("zh")),
136137
],
137138
globalModel.locale,
138139
(l) { globalModel.locale = l; },

lib/pages/subscription_list_page.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:fluent_reader_lite/pages/group_list_page.dart';
1111
import 'package:fluent_reader_lite/pages/home_page.dart';
1212
import 'package:fluent_reader_lite/utils/colors.dart';
1313
import 'package:fluent_reader_lite/utils/global.dart';
14+
import 'package:fluent_reader_lite/utils/store.dart';
1415
import 'package:flutter/cupertino.dart';
1516
import 'package:flutter/material.dart';
1617
import 'package:flutter/services.dart';
@@ -33,7 +34,7 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> {
3334
List<String> sids;
3435
String title;
3536
bool transitioning = false;
36-
bool unreadOnly = false;
37+
bool unreadOnly = Store.sp.getBool(StoreKeys.UNREAD_SUBS_ONLY) ?? false;
3738

3839
void _onScrollTop() {
3940
if (widget.scrollTopNotifier.index == 1 && !Navigator.of(context).canPop()) {
@@ -117,6 +118,7 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> {
117118
HapticFeedback.mediumImpact();
118119
setState(() { unreadOnly = !unreadOnly; });
119120
_onScrollTop();
121+
Store.sp.setBool(StoreKeys.UNREAD_SUBS_ONLY, unreadOnly);
120122
}
121123

122124
void _dismissTip() {
@@ -295,7 +297,7 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> {
295297
navigationBar,
296298
SyncControl(),
297299
if (Global.sourcesModel.showUnreadTip) _buildUnreadTip(),
298-
if (sids != null) Consumer<SourcesModel>(
300+
if (sids != null && sids.length > 0) Consumer<SourcesModel>(
299301
builder: (context, sourcesModel, child) {
300302
var count = sids
301303
.map((sid) => sourcesModel.getSource(sid))

lib/utils/store.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ abstract class StoreKeys {
88
static const GROUPS = "groups";
99
static const ERROR_LOG = "errorLog";
1010
static const UNCATEGORIZED = "uncategorized";
11+
static const UNREAD_SUBS_ONLY = "unreadSubsOnly";
1112

1213
// General
1314
static const THEME = "theme";

0 commit comments

Comments
 (0)