From bba38e68450935a04647139af5caae401e83f3e2 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 11 Sep 2024 22:03:43 +0800 Subject: [PATCH] :globe_with_meridians: Localize daily sign history chart --- assets/locales/en_us.json | 5 +++++ assets/locales/zh_cn.json | 5 +++++ lib/screens/dashboard.dart | 4 ++-- lib/widgets/daily_sign/history_chart.dart | 14 +++++++++----- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/assets/locales/en_us.json b/assets/locales/en_us.json index 42c8a48..7e89e81 100644 --- a/assets/locales/en_us.json +++ b/assets/locales/en_us.json @@ -26,12 +26,17 @@ "messages": "Messages", "messagesUnreadCount": "@count messages unread", "dailySign": "Daily Sign", + "dailySignAction": "Sign Today", + "dailySignHistoryAction": "View History", "dailySignNone": "You haven't sign today", "dailySignTier0": "Everything may not be good", "dailySignTier1": "Something may be wrong", "dailySignTier2": "Just so so", "dailySignTier3": "Something may goes well", "dailySignTier4": "Everything will be awesome", + "dailySignHistoryTitle": "Fortune History", + "dailySignHistoryRecent": "Recent Fortune", + "dailySignHistoryReward": "Reward Trends", "dashboardFooter": "Don't be serious, just for fun.", "visitProfilePage": "Visit Profile Page", "profilePage": "Page", diff --git a/assets/locales/zh_cn.json b/assets/locales/zh_cn.json index d7571a3..784360e 100644 --- a/assets/locales/zh_cn.json +++ b/assets/locales/zh_cn.json @@ -34,12 +34,17 @@ "messages": "消息", "messagesUnreadCount": "@count 条未读的消息", "dailySign": "签到", + "dailySignAction": "烧香拜佛", + "dailySignHistoryAction": "查看运势历史", "dailySignNone": "今日未拜访佛祖", "dailySignTier0": "诸事不宜", "dailySignTier1": "有些不宜", "dailySignTier2": "平平淡淡", "dailySignTier3": "有些事宜", "dailySignTier4": "诸事皆宜", + "dailySignHistoryTitle": "运势历史", + "dailySignHistoryRecent": "近期运势", + "dailySignHistoryReward": "成果趋势", "dashboardFooter": "占卜多少沾点玩,人生还得靠实力", "visitProfilePage": "造访个人主页", "profilePage": "主页", diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index a5cb515..747b70a 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -197,12 +197,12 @@ class _DashboardScreenState extends State { }, child: _signRecord == null ? IconButton( - tooltip: '上香求签', + tooltip: 'dailySignAction'.tr, icon: const Icon(Icons.local_fire_department), onPressed: _signingDaily ? null : _signDaily, ) : IconButton( - tooltip: '查看运势历史', + tooltip: 'dailySignHistoryAction'.tr, icon: const Icon(Icons.history), onPressed: () { showDialog( diff --git a/lib/widgets/daily_sign/history_chart.dart b/lib/widgets/daily_sign/history_chart.dart index cc028aa..3e3c1ee 100644 --- a/lib/widgets/daily_sign/history_chart.dart +++ b/lib/widgets/daily_sign/history_chart.dart @@ -24,7 +24,7 @@ class DailySignHistoryChartDialog extends StatelessWidget { title: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text('运势历史'), + Text('dailySignHistoryTitle'.tr), Text( '${DateFormat('yyyy/MM/dd').format(_firstRecordDate!)} - ${DateFormat('yyyy/MM/dd').format(DateTime.now())}', style: TextStyle( @@ -46,8 +46,10 @@ class DailySignHistoryChartDialog extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('近期运势', style: Theme.of(context).textTheme.titleMedium) - .paddingOnly(bottom: 18), + Text( + 'dailySignHistoryRecent'.tr, + style: Theme.of(context).textTheme.titleMedium, + ).paddingOnly(bottom: 18), SizedBox( height: 180, width: max(640, MediaQuery.of(context).size.width), @@ -147,8 +149,10 @@ class DailySignHistoryChartDialog extends StatelessWidget { ), ).marginOnly(right: 24, bottom: 8, top: 8), const Gap(16), - Text('功德趋势', style: Theme.of(context).textTheme.titleMedium) - .paddingOnly(bottom: 18), + Text( + 'dailySignHistoryReward'.tr, + style: Theme.of(context).textTheme.titleMedium, + ).paddingOnly(bottom: 18), SizedBox( height: 180, width: max(640, MediaQuery.of(context).size.width),