Skip to content

Commit 9f8ac89

Browse files
committed
add semantic labels
1 parent e46dd4a commit 9f8ac89

File tree

11 files changed

+67
-17
lines changed

11 files changed

+67
-17
lines changed

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 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+
3271990C25BBF9C8008EA00E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
3536
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3637
40360520B75D3E668845C254 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3738
6462689146C9FF38DFEA397D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
@@ -171,6 +172,7 @@
171172
knownRegions = (
172173
en,
173174
Base,
175+
"zh-Hans",
174176
);
175177
mainGroup = 97C146E51CF9000F007C117D;
176178
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
@@ -291,6 +293,7 @@
291293
isa = PBXVariantGroup;
292294
children = (
293295
97C147001CF9000F007C117D /* Base */,
296+
3271990C25BBF9C8008EA00E /* zh-Hans */,
294297
);
295298
name = LaunchScreen.storyboard;
296299
sourceTree = "<group>";
@@ -302,6 +305,7 @@
302305
isa = XCBuildConfiguration;
303306
buildSettings = {
304307
ALWAYS_SEARCH_USER_PATHS = NO;
308+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
305309
CLANG_ANALYZER_NONNULL = YES;
306310
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
307311
CLANG_CXX_LIBRARY = "libc++";
@@ -386,6 +390,7 @@
386390
isa = XCBuildConfiguration;
387391
buildSettings = {
388392
ALWAYS_SEARCH_USER_PATHS = NO;
393+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
389394
CLANG_ANALYZER_NONNULL = YES;
390395
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
391396
CLANG_CXX_LIBRARY = "libc++";
@@ -441,6 +446,7 @@
441446
isa = XCBuildConfiguration;
442447
buildSettings = {
443448
ALWAYS_SEARCH_USER_PATHS = NO;
449+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
444450
CLANG_ANALYZER_NONNULL = YES;
445451
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
446452
CLANG_CXX_LIBRARY = "libc++";

ios/Runner/Info.plist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
15-
<key>CFBundleLocalizations</key>
16-
<array>
17-
<string>en</string>
18-
<string>zh_CN</string>
19-
</array>
2015
<key>CFBundleName</key>
2116
<string>fluent_reader_lite</string>
2217
<key>CFBundlePackageType</key>
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@
8181
"allLoaded": "All loaded",
8282
"removeAd": "Remove Ad",
8383
"getApiKey": "Get API ID & Key",
84-
"getApiKeyHint": "In \"Preferences\" > \"Developer\""
84+
"getApiKeyHint": "In \"Preferences\" > \"Developer\"",
85+
"prev": "Previous",
86+
"next": "Next"
8587
}

lib/l10n/intl_zh.arb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@
8181
"allLoaded": "已全部加载",
8282
"removeAd": "移除广告",
8383
"getApiKey": "获取 API ID & KEY",
84-
"getApiKeyHint": "在 “偏好设置” > “开发者” 下"
84+
"getApiKeyHint": "在 “偏好设置” > “开发者” 下",
85+
"prev": "前一项",
86+
"next": "后一项"
8587
}

lib/models/items_model.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class ItemsModel with ChangeNotifier {
7979
final items = await Global.service.fetchItems();
8080
final batch = Global.db.batch();
8181
for (var item in items) {
82+
if (!Global.sourcesModel.has(item.source)) continue;
8283
_items[item.id] = item;
8384
batch.insert(
8485
"items",

lib/pages/article_page.dart

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,24 @@ class ArticlePageState extends State<ArticlePage> {
136136
if (isSourceFeed == null) isSourceFeed = arguments.item2;
137137
final resolvedDarkGrey = MyColors.dynamicDarkGrey.resolveFrom(context);
138138
final viewOptions = {
139-
0: Padding(child: Icon(Icons.rss_feed, color: resolvedDarkGrey), padding: EdgeInsets.symmetric(horizontal: 8)),
140-
1: Icon(Icons.article_outlined, color: resolvedDarkGrey),
141-
2: Icon(Icons.language, color: resolvedDarkGrey),
139+
0: Padding(
140+
child: Icon(
141+
Icons.rss_feed,
142+
color: resolvedDarkGrey,
143+
semanticLabel: S.of(context).rssText,
144+
),
145+
padding: EdgeInsets.symmetric(horizontal: 8),
146+
),
147+
1: Icon(
148+
Icons.article_outlined,
149+
color: resolvedDarkGrey,
150+
semanticLabel: S.of(context).loadFull,
151+
),
152+
2: Icon(
153+
Icons.language,
154+
color: resolvedDarkGrey,
155+
semanticLabel: S.of(context).loadWebpage,
156+
),
142157
};
143158
return Selector2<ItemsModel, SourcesModel, Tuple2<RSSItem, RSSSource>>(
144159
selector: (context, itemsModel, sourcesModel) {
@@ -186,29 +201,42 @@ class ArticlePageState extends State<ArticlePage> {
186201
return CupertinoToolbar(
187202
items: [
188203
CupertinoToolbarItem(
189-
icon: item.hasRead ? CupertinoIcons.circle : CupertinoIcons.smallcircle_fill_circle,
204+
icon: item.hasRead
205+
? CupertinoIcons.circle
206+
: CupertinoIcons.smallcircle_fill_circle,
207+
semanticLabel: item.hasRead
208+
? S.of(context).markUnread
209+
: S.of(context).markRead,
190210
onPressed: () {
191211
Global.itemsModel.updateItem(item.id, read: !item.hasRead);
192212
},
193213
),
194214
CupertinoToolbarItem(
195-
icon: item.starred ? CupertinoIcons.star_fill : CupertinoIcons.star,
215+
icon: item.starred
216+
? CupertinoIcons.star_fill
217+
: CupertinoIcons.star,
218+
semanticLabel: item.starred
219+
? S.of(context).star
220+
: S.of(context).unstar,
196221
onPressed: () {
197222
Global.itemsModel.updateItem(item.id, starred: !item.starred);
198223
},
199224
),
200225
CupertinoToolbarItem(
201226
icon: CupertinoIcons.share,
227+
semanticLabel: S.of(context).share,
202228
onPressed: () { Share.share(item.link); },
203229
),
204230
CupertinoToolbarItem(
205231
icon: CupertinoIcons.chevron_up,
232+
semanticLabel: S.of(context).prev,
206233
onPressed: idx <= 0 ? null : () {
207234
loadNewItem(feed.iids[idx - 1]);
208235
},
209236
),
210237
CupertinoToolbarItem(
211238
icon: CupertinoIcons.chevron_down,
239+
semanticLabel: S.of(context).next,
212240
onPressed: (idx == -1 || (idx == feed.iids.length - 1 && feed.allLoaded))
213241
? null
214242
: () async {

lib/pages/home_page.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ class _HomePageState extends State<HomePage> {
9797
builder: (context, hasService, child) {
9898
if (!hasService) return SetupPage();
9999
return ScreenTypeLayout.builder(
100+
breakpoints: ScreenBreakpoints(
101+
tablet: 640,
102+
watch: 0,
103+
desktop: 1600,
104+
),
100105
mobile: (context) => buildLeft(context),
101106
tablet: (context) {
102107
final left = buildLeft(context, isMobile: false);

lib/pages/item_list_page.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ class _ItemListPageState extends State<ItemListPage> {
306306
children: [
307307
CupertinoButton(
308308
padding: EdgeInsets.zero,
309-
child: Icon(CupertinoIcons.checkmark_circle),
309+
child: Icon(
310+
CupertinoIcons.checkmark_circle,
311+
semanticLabel: S.of(context).markAll,
312+
),
310313
onPressed: _openMarkAllModal,
311314
),
312315
Consumer<FeedsModel>(
@@ -316,7 +319,8 @@ class _ItemListPageState extends State<ItemListPage> {
316319
padding: EdgeInsets.zero,
317320
child: Icon((feed.filterType != FilterType.All || feed.search.length > 0)
318321
? CupertinoIcons.line_horizontal_3_decrease_circle_fill
319-
: CupertinoIcons.line_horizontal_3_decrease_circle
322+
: CupertinoIcons.line_horizontal_3_decrease_circle,
323+
semanticLabel: S.of(context).filter,
320324
),
321325
onPressed: _openFilterModal,
322326
);

lib/pages/subscription_list_page.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,18 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> {
118118
children: [
119119
CupertinoButton(
120120
padding: EdgeInsets.zero,
121-
child: Icon(CupertinoIcons.checkmark_circle),
121+
child: Icon(
122+
CupertinoIcons.checkmark_circle,
123+
semanticLabel: S.of(context).markAll,
124+
),
122125
onPressed: _openMarkAllModal,
123126
),
124127
CupertinoButton(
125128
padding: EdgeInsets.zero,
126-
child: Icon(CupertinoIcons.settings),
129+
child: Icon(
130+
CupertinoIcons.settings,
131+
semanticLabel: S.of(context).settings,
132+
),
127133
onPressed: _openSettings,
128134
),
129135
],

0 commit comments

Comments
 (0)