Skip to content

Commit

Permalink
[game] l10n
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed May 25, 2024
1 parent c5c94c0 commit 7b88dea
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions assets/l10n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions assets/l10n/zh-Hans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ game:
changeGameModeAction: "切换至 {}"
loadGame: 加载战局
loadGameFromQrCode: "从二维码中加载游戏 {} 的战局"
noGameRecords: 没有游戏记录
settings:
enableHapticFeedback:
title: 开启触觉反馈
Expand All @@ -879,7 +880,7 @@ game:
hard: 困难
records:
title: 扫雷游戏记录
record: "{mode} | {rows}x{columns}上藏有{mines}个地雷"
record: "{mode} | {rows}x{columns} 上藏有 {mines} 个地雷"
sudoku:
title: 数独
gameMode:
Expand All @@ -889,7 +890,7 @@ game:
hard: 困难
records:
title: 数独游戏记录
record: "{mode} | {blanks} 空位"
record: "{mode} | {blanks} 个空位"
wordle:
title: Wordle
vocabulary:
Expand Down
11 changes: 6 additions & 5 deletions assets/l10n/zh-Hant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ game:
changeGameModeAction: "變更為 {}"
loadGame: 載入戰局
loadGameFromQrCode: "從 QR 碼中載入遊戲 {} 的戰局"
noGameRecords: 沒有遊戲記錄
settings:
enableHapticFeedback:
title: 開啟觸覺回饋
Expand All @@ -868,7 +869,7 @@ game:
score: 分數
best: 最佳
records:
title: 2048遊戲紀錄
title: 2048遊戲記錄
record: "最大合成 {maxNumber},達成分數:{score}"
minesweeper:
title: 掃雷
Expand All @@ -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:
Expand All @@ -888,8 +889,8 @@ game:
medium: 中等
hard: 困難
records:
title: 數獨遊戲紀錄
record: "{mode} | {blanks} 空位"
title: 數獨遊戲記錄
record: "{mode} | {blanks} 個空位"
wordle:
title: Wordle
vocabulary:
Expand Down
2 changes: 2 additions & 0 deletions lib/game/i18n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]);
Expand Down
2 changes: 1 addition & 1 deletion lib/game/minesweeper/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ class _GameAppCardMinesweeperState extends ConsumerState<GameAppCardMinesweeper>
));
StorageMinesweeper.save.delete();
},
).sized(w: 280);
);
}
}
4 changes: 2 additions & 2 deletions lib/game/page/records.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<TRecord extends GameRecord> extends ConsumerStatefulWidget {
final String title;
final GameRecordStorage<TRecord> recordStorage;
Expand Down Expand Up @@ -46,7 +46,7 @@ class _RecordsMinesweeperPageState<TRecord extends GameRecord> extends ConsumerS
SliverFillRemaining(
child: LeavingBlank(
icon: Icons.inbox_outlined,
desc: "No game records",
desc: i18n.noGameRecords,
),
)
else
Expand Down
3 changes: 1 addition & 2 deletions lib/game/sudoku/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -50,6 +49,6 @@ class _GameAppCardSudokuState extends ConsumerState<GameAppCardSudoku> {
));
StorageSudoku.save.delete();
},
).sized(w: 240);
);
}
}

0 comments on commit 7b88dea

Please sign in to comment.