feat(l10n): 장비/아이템 동적 이름 한국어 번역 지원

- pq_logic.dart: 구조화된 결과 타입 (EquipResult, ItemResult) 추가
- pq_logic.dart: 구조화된 생성 함수 (winEquipStructured, winItemStructured 등) 추가
- GameDataL10n: 구조화된 결과 렌더링 함수 추가 (renderEquipResult, renderItemResult)
- GameDataL10n: 문자열 파싱 기반 번역 함수 추가 (translateEquipString, translateItemString)
- game_play_screen.dart: 장비/아이템 목록에 번역 함수 적용
This commit is contained in:
JiWoong Sul
2025-12-11 18:36:51 +09:00
parent ebb0e0dda6
commit d4acd3503b
3 changed files with 411 additions and 13 deletions

View File

@@ -510,19 +510,20 @@ class _GamePlayScreenState extends State<GamePlayScreen>
Widget _buildEquipmentList(GameState state) {
// 원본 Main.dfm Equips ListView - 11개 슬롯
// (슬롯 레이블, 장비 이름, 슬롯 인덱스) 튜플
final l10n = L10n.of(context);
final equipment = [
(l10n.equipWeapon, state.equipment.weapon),
(l10n.equipShield, state.equipment.shield),
(l10n.equipHelm, state.equipment.helm),
(l10n.equipHauberk, state.equipment.hauberk),
(l10n.equipBrassairts, state.equipment.brassairts),
(l10n.equipVambraces, state.equipment.vambraces),
(l10n.equipGauntlets, state.equipment.gauntlets),
(l10n.equipGambeson, state.equipment.gambeson),
(l10n.equipCuisses, state.equipment.cuisses),
(l10n.equipGreaves, state.equipment.greaves),
(l10n.equipSollerets, state.equipment.sollerets),
(l10n.equipWeapon, state.equipment.weapon, 0),
(l10n.equipShield, state.equipment.shield, 1),
(l10n.equipHelm, state.equipment.helm, 2),
(l10n.equipHauberk, state.equipment.hauberk, 3),
(l10n.equipBrassairts, state.equipment.brassairts, 4),
(l10n.equipVambraces, state.equipment.vambraces, 5),
(l10n.equipGauntlets, state.equipment.gauntlets, 6),
(l10n.equipGambeson, state.equipment.gambeson, 7),
(l10n.equipCuisses, state.equipment.cuisses, 8),
(l10n.equipGreaves, state.equipment.greaves, 9),
(l10n.equipSollerets, state.equipment.sollerets, 10),
];
return ListView.builder(
@@ -530,6 +531,10 @@ class _GamePlayScreenState extends State<GamePlayScreen>
padding: const EdgeInsets.symmetric(horizontal: 8),
itemBuilder: (context, index) {
final equip = equipment[index];
// 장비 이름 번역 (슬롯 인덱스 사용)
final translatedName = equip.$2.isNotEmpty
? GameDataL10n.translateEquipString(context, equip.$2, equip.$3)
: '-';
return Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Row(
@@ -540,7 +545,7 @@ class _GamePlayScreenState extends State<GamePlayScreen>
),
Expanded(
child: Text(
equip.$2.isNotEmpty ? equip.$2 : '-',
translatedName,
style: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.bold,
@@ -587,11 +592,16 @@ class _GamePlayScreenState extends State<GamePlayScreen>
);
}
final item = state.inventory.items[index - 1];
// 아이템 이름 번역
final translatedName = GameDataL10n.translateItemString(
context,
item.name,
);
return Row(
children: [
Expanded(
child: Text(
item.name,
translatedName,
style: const TextStyle(fontSize: 11),
overflow: TextOverflow.ellipsis,
),