From 7b88dea69333b94f0b93c4de894f51936d12f18d Mon Sep 17 00:00:00 2001 From: Liplum Date: Sun, 26 May 2024 04:41:51 +0800 Subject: [PATCH] [game] l10n --- assets/l10n/en.yaml | 1 + assets/l10n/zh-Hans.yaml | 5 +++-- assets/l10n/zh-Hant.yaml | 11 ++++++----- lib/game/i18n.dart | 2 ++ lib/game/minesweeper/card.dart | 2 +- lib/game/page/records.dart | 4 ++-- lib/game/sudoku/card.dart | 3 +-- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/assets/l10n/en.yaml b/assets/l10n/en.yaml index aad1cf602..5dc43bc42 100644 --- a/assets/l10n/en.yaml +++ b/assets/l10n/en.yaml @@ -859,6 +859,7 @@ game: changeGameModeAction: "Change to {}" loadGame: Load game loadGameFromQrCode: "Load a game of {} from QR code" + noGameRecords: No game records settings: enableHapticFeedback: title: Enable haptic feedback diff --git a/assets/l10n/zh-Hans.yaml b/assets/l10n/zh-Hans.yaml index 143c21ef3..0e7ba4310 100644 --- a/assets/l10n/zh-Hans.yaml +++ b/assets/l10n/zh-Hans.yaml @@ -859,6 +859,7 @@ game: changeGameModeAction: "切换至 {}" loadGame: 加载战局 loadGameFromQrCode: "从二维码中加载游戏 {} 的战局" + noGameRecords: 没有游戏记录 settings: enableHapticFeedback: title: 开启触觉反馈 @@ -879,7 +880,7 @@ game: hard: 困难 records: title: 扫雷游戏记录 - record: "{mode} | {rows}x{columns}上藏有{mines}个地雷" + record: "{mode} | {rows}x{columns} 上藏有 {mines} 个地雷" sudoku: title: 数独 gameMode: @@ -889,7 +890,7 @@ game: hard: 困难 records: title: 数独游戏记录 - record: "{mode} | {blanks} 空位" + record: "{mode} | {blanks} 个空位" wordle: title: Wordle vocabulary: diff --git a/assets/l10n/zh-Hant.yaml b/assets/l10n/zh-Hant.yaml index b4492758e..741de1a2a 100644 --- a/assets/l10n/zh-Hant.yaml +++ b/assets/l10n/zh-Hant.yaml @@ -859,6 +859,7 @@ game: changeGameModeAction: "變更為 {}" loadGame: 載入戰局 loadGameFromQrCode: "從 QR 碼中載入遊戲 {} 的戰局" + noGameRecords: 沒有遊戲記錄 settings: enableHapticFeedback: title: 開啟觸覺回饋 @@ -868,7 +869,7 @@ game: score: 分數 best: 最佳 records: - title: 2048遊戲紀錄 + title: 2048遊戲記錄 record: "最大合成 {maxNumber},達成分數:{score}" minesweeper: title: 掃雷 @@ -878,8 +879,8 @@ game: normal: 普通 hard: 困難 records: - title: 掃雷遊戲紀錄 - record: "{mode} | {rows}x{columns} 藏有 {mines} 地雷" + title: 掃雷遊戲記錄 + record: "{mode} | {rows}x{columns} 藏有 {mines} 個地雷" sudoku: title: 數獨 gameMode: @@ -888,8 +889,8 @@ game: medium: 中等 hard: 困難 records: - title: 數獨遊戲紀錄 - record: "{mode} | {blanks} 空位" + title: 數獨遊戲記錄 + record: "{mode} | {blanks} 個空位" wordle: title: Wordle vocabulary: diff --git a/lib/game/i18n.dart b/lib/game/i18n.dart index 196ff47a7..4f88a2b13 100644 --- a/lib/game/i18n.dart +++ b/lib/game/i18n.dart @@ -15,6 +15,8 @@ class _I18n with CommonI18nMixin, CommonGameI18nMixin { String get loadGame => "$_ns.loadGame".tr(); + String get noGameRecords => "$_ns.noGameRecords".tr(); + String loadGameFromQrCode(String gameName) => "$_ns.loadGameFromQrCode".tr(args: [ "game.$gameName.title".tr(), ]); diff --git a/lib/game/minesweeper/card.dart b/lib/game/minesweeper/card.dart index ab80c4326..7334d2b69 100644 --- a/lib/game/minesweeper/card.dart +++ b/lib/game/minesweeper/card.dart @@ -49,6 +49,6 @@ class _GameAppCardMinesweeperState extends ConsumerState )); StorageMinesweeper.save.delete(); }, - ).sized(w: 280); + ); } } diff --git a/lib/game/page/records.dart b/lib/game/page/records.dart index a42003398..b9d4d76f7 100644 --- a/lib/game/page/records.dart +++ b/lib/game/page/records.dart @@ -7,7 +7,7 @@ import 'package:sit/design/adaptive/swipe.dart'; import 'package:sit/design/widgets/common.dart'; import 'package:sit/game/entity/record.dart'; import 'package:sit/game/storage/record.dart'; - +import "../i18n.dart"; class GameRecordsPage extends ConsumerStatefulWidget { final String title; final GameRecordStorage recordStorage; @@ -46,7 +46,7 @@ class _RecordsMinesweeperPageState extends ConsumerS SliverFillRemaining( child: LeavingBlank( icon: Icons.inbox_outlined, - desc: "No game records", + desc: i18n.noGameRecords, ), ) else diff --git a/lib/game/sudoku/card.dart b/lib/game/sudoku/card.dart index 7c3bd4b87..4f41f6db3 100644 --- a/lib/game/sudoku/card.dart +++ b/lib/game/sudoku/card.dart @@ -6,7 +6,6 @@ import 'package:sit/game/sudoku/entity/pref.dart'; import 'package:sit/game/sudoku/storage.dart'; import 'package:sit/game/widget/mode.dart'; import 'entity/mode.dart'; -import 'entity/save.dart'; import 'package:sit/game/widget/card.dart'; import 'i18n.dart'; @@ -50,6 +49,6 @@ class _GameAppCardSudokuState extends ConsumerState { )); StorageSudoku.save.delete(); }, - ).sized(w: 240); + ); } }