Skip to content

Commit bb15e55

Browse files
Update locale
1 parent 2408f49 commit bb15e55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1885
-701
lines changed

lib/Resources/theme.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/material.dart';
22

33
import '../Utils/app_provider.dart';
4+
import '../Utils/responsive_util.dart';
45
import '../Utils/utils.dart';
56
import 'colors.dart';
67
import 'styles.dart';
@@ -214,4 +215,20 @@ class MyTheme {
214215
? Theme.of(context).scaffoldBackgroundColor
215216
: Theme.of(context).canvasColor;
216217
}
218+
219+
static Color get background {
220+
return Theme.of(rootContext).scaffoldBackgroundColor;
221+
// return Utils.currentBrightness(rootContext) == Brightness.light
222+
// ? Theme.of(rootContext).scaffoldBackgroundColor
223+
// : Theme.of(rootContext).canvasColor;
224+
}
225+
226+
static Color get itemBackground {
227+
if (ResponsiveUtil.isLandscape()) {
228+
return Theme.of(rootContext).canvasColor;
229+
}
230+
return Utils.currentBrightness(rootContext) == Brightness.light
231+
? Theme.of(rootContext).canvasColor
232+
: Theme.of(rootContext).scaffoldBackgroundColor;
233+
}
217234
}

lib/Screens/Info/collection_screen.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class _CollectionScreenState extends State<CollectionScreen>
172172
return _collectionList.isNotEmpty
173173
? _buildMainBody(physics)
174174
: ItemBuilder.buildEmptyPlaceholder(
175-
context: context, text: "暂无合集", physics: physics);
175+
context: context, text: S.current.noCollection, physics: physics);
176176
},
177177
);
178178
default:
@@ -254,7 +254,7 @@ class _CollectionScreenState extends State<CollectionScreen>
254254
overflow: TextOverflow.ellipsis,
255255
),
256256
Text(
257-
"${collection.postCount} · 更新于${Utils.formatTimestamp(collection.lastPublishTime)}",
257+
"${collection.postCount}${S.current.chapter} · ${S.current.updateAt}${Utils.formatTimestamp(collection.lastPublishTime)}",
258258
style: Theme.of(context).textTheme.labelMedium,
259259
maxLines: 1,
260260
overflow: TextOverflow.ellipsis,
@@ -296,7 +296,7 @@ class _CollectionScreenState extends State<CollectionScreen>
296296
return ItemBuilder.buildDesktopAppBar(
297297
context: context,
298298
showBack: true,
299-
title: "我的合集",
299+
title: S.current.myCollections,
300300
);
301301
}
302302
}

lib/Screens/Info/favorite_folder_detail_screen.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import '../../generated/l10n.dart';
21
import 'package:flutter/material.dart';
32
import 'package:loftify/Models/favorites_response.dart';
43
import 'package:loftify/Models/recommend_response.dart';
@@ -17,6 +16,7 @@ import '../../Utils/utils.dart';
1716
import '../../Widgets/General/EasyRefresh/easy_refresh.dart';
1817
import '../../Widgets/Item/item_builder.dart';
1918
import '../../Widgets/PostItem/favorite_folder_post_item_builder.dart';
19+
import '../../generated/l10n.dart';
2020
import '../Post/post_detail_screen.dart';
2121

2222
class FavoriteFolderDetailScreen extends StatefulWidget {
@@ -41,7 +41,7 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
4141
SimpleBlogInfo? _creatorInfo;
4242
final List<FavoritePostDetailData> _posts = [];
4343
final List<ArchiveData> _archiveDataList = [];
44-
FavoriteFolderDetailLayoutMode _layoutMode =
44+
final FavoriteFolderDetailLayoutMode _layoutMode =
4545
FavoriteFolderDetailLayoutMode.nineGrid;
4646
bool _loading = false;
4747
final EasyRefreshController _refreshController = EasyRefreshController();
@@ -165,7 +165,7 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
165165
}
166166
widgets.add(ItemBuilder.buildTitle(
167167
context,
168-
title: "${e.desc}(${e.count}篇)",
168+
title: S.current.descriptionWithPostCount(e.desc, e.count.toString()),
169169
topMargin: 16,
170170
bottomMargin: 0,
171171
));
@@ -195,7 +195,7 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
195195
wh: 160),
196196
onTap: () {
197197
if (FavoriteFolderPostItemBuilder.isInvalid(_posts[trueIndex])) {
198-
IToast.showTop("无效内容");
198+
IToast.showTop(S.current.invalidContent);
199199
} else {
200200
RouteUtil.pushPanelCupertinoRoute(
201201
context,
@@ -240,7 +240,7 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
240240
return ItemBuilder.buildDesktopAppBar(
241241
context: context,
242242
showBack: true,
243-
title: _favoriteFolder?.name ?? "收藏夹详情",
243+
title: _favoriteFolder?.name ?? S.current.favoriteFolderDetail,
244244
actions: [
245245
// ItemBuilder.buildIconButton(
246246
// context: context,

lib/Screens/Info/favorite_folder_list_screen.dart

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import '../../generated/l10n.dart';
21
import 'dart:io';
32

43
import 'package:flutter/material.dart';
@@ -20,6 +19,7 @@ import '../../Widgets/BottomSheet/bottom_sheet_builder.dart';
2019
import '../../Widgets/BottomSheet/input_bottom_sheet.dart';
2120
import '../../Widgets/General/EasyRefresh/easy_refresh.dart';
2221
import '../../Widgets/Item/item_builder.dart';
22+
import '../../generated/l10n.dart';
2323

2424
class FavoriteFolderListScreen extends StatefulWidget {
2525
const FavoriteFolderListScreen({super.key});
@@ -186,19 +186,19 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
186186
),
187187
),
188188
copyText: item.name ?? "",
189-
toastText: "已复制收藏夹名称",
189+
toastText: S.current.haveCopiedFolderName,
190190
),
191191
const SizedBox(height: 10),
192192
ItemBuilder.buildCopyItem(context,
193193
child: Text(
194-
"ID: ${item.id}",
194+
S.current.folderId(item.id.toString()),
195195
style: Theme.of(context).textTheme.titleSmall,
196196
),
197197
copyText: item.id.toString(),
198-
toastText: "已复制收藏夹ID"),
198+
toastText: S.current.haveCopiedFolderID),
199199
const SizedBox(height: 10),
200200
Text(
201-
"${item.postCount}",
201+
"${item.postCount}${S.current.chapter}",
202202
style: Theme.of(context).textTheme.titleSmall,
203203
),
204204
],
@@ -212,16 +212,16 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
212212
BottomSheetBuilder.showBottomSheet(
213213
context,
214214
(sheetContext) => InputBottomSheet(
215-
buttonText: "确认",
216-
title: "编辑收藏夹名称",
217-
hint: "输入收藏夹名称",
215+
buttonText: S.current.confirm,
216+
title: S.current.editFolderTitle,
217+
hint: S.current.inputFolderTitle,
218218
text: item.name ?? "",
219219
onConfirm: (text) {
220220
var tmp = item;
221221
tmp.name = text;
222222
UserApi.editFolder(folder: tmp).then((value) {
223223
if (value['code'] == 0) {
224-
IToast.showTop("编辑成功");
224+
IToast.showTop(S.current.editSuccess);
225225
item.name = text;
226226
setState(() {});
227227
} else {
@@ -243,14 +243,15 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
243243
onTap: () {
244244
DialogBuilder.showConfirmDialog(
245245
context,
246-
title: "删除收藏夹",
247-
message: "确定删除收藏夹 ${item.name} ?删除后,其中的文章也将取消收藏",
246+
title: S.current.deleteFolder,
247+
message:
248+
S.current.deleteFolderMessage(item.name.toString()),
248249
messageTextAlign: TextAlign.center,
249250
onTapConfirm: () async {
250251
UserApi.deleteFolder(folderId: item.id ?? 0)
251252
.then((value) {
252253
if (value['code'] == 0) {
253-
IToast.showTop("删除成功");
254+
IToast.showTop(S.current.deleteSuccess);
254255
_refreshController.callRefresh();
255256
} else {
256257
IToast.showTop(value['msg']);
@@ -271,14 +272,14 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
271272
BottomSheetBuilder.showBottomSheet(
272273
context,
273274
(sheetContext) => InputBottomSheet(
274-
buttonText: "确认",
275-
title: "新建收藏夹",
276-
hint: "输入收藏夹名称",
275+
buttonText: S.current.confirm,
276+
title: S.current.newFolder,
277+
hint: S.current.inputFolderTitle,
277278
text: "",
278279
onConfirm: (text) {
279280
UserApi.createFolder(name: text).then((value) {
280281
if (value['code'] == 0) {
281-
IToast.showTop("创建成功");
282+
IToast.showTop(S.current.createSuccess);
282283
_refreshController.callRefresh();
283284
} else {
284285
IToast.showTop(value['msg']);
@@ -295,7 +296,7 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
295296
return ItemBuilder.buildDesktopAppBar(
296297
context: context,
297298
showBack: true,
298-
title: "我的收藏",
299+
title: S.current.myFavorites,
299300
actions: [
300301
// ItemBuilder.buildIconButton(
301302
// context: context,

lib/Screens/Info/following_follower_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import 'package:loftify/Resources/theme.dart';
77
import 'package:loftify/Utils/hive_util.dart';
88
import 'package:waterfall_flow/waterfall_flow.dart';
99

10-
import '../../generated/l10n.dart';
1110
import '../../Models/user_response.dart';
1211
import '../../Utils/enums.dart';
1312
import '../../Utils/ilogger.dart';
1413
import '../../Utils/itoast.dart';
1514
import '../../Widgets/General/EasyRefresh/easy_refresh.dart';
1615
import '../../Widgets/Item/item_builder.dart';
16+
import '../../generated/l10n.dart';
1717

1818
class FollowingFollowerScreen extends StatefulWidget {
1919
FollowingFollowerScreen({
@@ -181,7 +181,7 @@ class _FollowingFollowerScreenState extends State<FollowingFollowerScreen>
181181
context: context,
182182
showBack: true,
183183
title:
184-
"${widget.followingMode == FollowingMode.follower ? "粉丝列表" : "关注列表"}($total)",
184+
"${widget.followingMode == FollowingMode.follower ? S.current.followerList : S.current.followingList}($total)",
185185
);
186186
}
187187
}

lib/Screens/Info/grain_screen.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class _GrainScreenState extends State<GrainScreen>
166166
return _grainList.isNotEmpty
167167
? _buildMainBody(physics)
168168
: ItemBuilder.buildEmptyPlaceholder(
169-
context: context, text: "暂无粮单", physics: physics);
169+
context: context, text: S.current.noGrain, physics: physics);
170170
},
171171
);
172172
default:
@@ -245,7 +245,7 @@ class _GrainScreenState extends State<GrainScreen>
245245
overflow: TextOverflow.ellipsis,
246246
),
247247
Text(
248-
"${grain.postCount} · 更新于${Utils.formatTimestamp(grain.updateTime)}",
248+
"${grain.postCount}${S.current.chapter} · ${S.current.updateAt}${Utils.formatTimestamp(grain.updateTime)}",
249249
style: Theme.of(context).textTheme.labelMedium,
250250
maxLines: 1,
251251
overflow: TextOverflow.ellipsis,
@@ -286,7 +286,7 @@ class _GrainScreenState extends State<GrainScreen>
286286
return ItemBuilder.buildDesktopAppBar(
287287
context: context,
288288
showBack: true,
289-
title: "我的粮单",
289+
title: S.current.myGrains,
290290
actions: [
291291
ItemBuilder.buildBlankIconButton(context),
292292
const SizedBox(width: 5),

0 commit comments

Comments
 (0)