feat(l10n): 국제화(L10n) 시스템 도입 및 하드코딩 텍스트 변환
- flutter_localizations 및 intl 패키지 추가 - l10n.yaml 설정 파일 및 app_ko.arb 메시지 파일 생성 - 모든 화면(app, front, game_play, new_character, save_picker)의 하드코딩 텍스트를 L10n 키로 변환 - 테스트 파일에 localizationsDelegates 추가하여 L10n 지원
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
import 'package:askiineverdie/l10n/app_localizations.dart';
|
||||
import 'package:askiineverdie/src/core/model/game_state.dart';
|
||||
import 'package:askiineverdie/src/features/new_character/new_character_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
/// 테스트용 MaterialApp 래퍼 (localization 포함)
|
||||
Widget _buildTestApp(Widget child) {
|
||||
return MaterialApp(
|
||||
localizationsDelegates: L10n.localizationsDelegates,
|
||||
supportedLocales: L10n.supportedLocales,
|
||||
home: child,
|
||||
);
|
||||
}
|
||||
|
||||
void main() {
|
||||
testWidgets('NewCharacterScreen renders main sections', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(home: NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
_buildTestApp(NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
);
|
||||
|
||||
// 화면 타이틀 확인
|
||||
@@ -29,7 +39,7 @@ void main() {
|
||||
|
||||
testWidgets('Unroll button exists and can be tapped', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(home: NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
_buildTestApp(NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
);
|
||||
|
||||
// Unroll 버튼 확인
|
||||
@@ -50,8 +60,8 @@ void main() {
|
||||
GameState? createdState;
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: NewCharacterScreen(
|
||||
_buildTestApp(
|
||||
NewCharacterScreen(
|
||||
onCharacterCreated: (state) {
|
||||
createdState = state;
|
||||
},
|
||||
@@ -81,7 +91,7 @@ void main() {
|
||||
|
||||
testWidgets('Stats section displays all six stats', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(home: NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
_buildTestApp(NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
);
|
||||
|
||||
// 능력치 라벨들이 표시되는지 확인
|
||||
@@ -98,7 +108,7 @@ void main() {
|
||||
|
||||
testWidgets('Name text field exists', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(home: NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
_buildTestApp(NewCharacterScreen(onCharacterCreated: (_) {})),
|
||||
);
|
||||
|
||||
// TextField 확인 (이름 입력 필드)
|
||||
|
||||
Reference in New Issue
Block a user