forked from baron/baron-sso
i18n 대대적 변경
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import '../../../core/services/auth_proxy_service.dart';
|
||||
import '../../../core/services/auth_token_store.dart';
|
||||
import 'package:userfront/i18n.dart';
|
||||
|
||||
class QRScanScreen extends StatefulWidget {
|
||||
const QRScanScreen({super.key});
|
||||
@@ -143,7 +144,10 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isSuccess = true;
|
||||
_resultMessage = 'QR 승인 완료! PC 화면에서 로그인이 진행됩니다.';
|
||||
_resultMessage = tr(
|
||||
'msg.userfront.qr.approve_success',
|
||||
fallback: 'QR 승인 완료! PC 화면에서 로그인이 진행됩니다.',
|
||||
);
|
||||
_isProcessing = false;
|
||||
});
|
||||
}
|
||||
@@ -152,7 +156,11 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isSuccess = false;
|
||||
_resultMessage = 'QR 승인 실패: $e';
|
||||
_resultMessage = tr(
|
||||
'msg.userfront.qr.approve_error',
|
||||
fallback: 'QR 승인 실패: {{error}}',
|
||||
params: {'error': '$e'},
|
||||
);
|
||||
_isProcessing = false;
|
||||
});
|
||||
}
|
||||
@@ -181,8 +189,13 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
_log.warning('Camera permission request failed: $e');
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('카메라 권한 요청에 실패했습니다. 브라우저/OS 설정을 확인해주세요.'),
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.qr.permission_error',
|
||||
fallback: '카메라 권한 요청에 실패했습니다. 브라우저/OS 설정을 확인해주세요.',
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
);
|
||||
@@ -198,7 +211,9 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
final success = _isSuccess == true;
|
||||
final icon = success ? Icons.check_circle_outline : Icons.error_outline;
|
||||
final color = success ? Colors.green : Colors.red;
|
||||
final title = success ? '승인 완료' : '승인 실패';
|
||||
final title = success
|
||||
? tr('ui.userfront.qr.result_success', fallback: '승인 완료')
|
||||
: tr('ui.userfront.qr.result_failure', fallback: '승인 실패');
|
||||
final message = _resultMessage ?? '';
|
||||
|
||||
return Center(
|
||||
@@ -223,12 +238,12 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
if (!success)
|
||||
FilledButton(
|
||||
onPressed: _resetScan,
|
||||
child: const Text('다시 스캔'),
|
||||
child: Text(tr('ui.userfront.qr.rescan', fallback: '다시 스캔')),
|
||||
),
|
||||
if (success)
|
||||
FilledButton(
|
||||
onPressed: () => context.pop(),
|
||||
child: const Text('닫기'),
|
||||
child: Text(tr('ui.common.close', fallback: '닫기')),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -240,7 +255,7 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Scan QR Code'),
|
||||
title: Text(tr('ui.userfront.qr.title', fallback: 'Scan QR Code')),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => context.pop(),
|
||||
@@ -263,8 +278,15 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
isPermissionDenied
|
||||
? '카메라 권한이 필요합니다.'
|
||||
: '카메라 오류: ${error.errorCode}',
|
||||
? tr(
|
||||
'msg.userfront.qr.permission_required',
|
||||
fallback: '카메라 권한이 필요합니다.',
|
||||
)
|
||||
: tr(
|
||||
'msg.userfront.qr.camera_error',
|
||||
fallback: '카메라 오류: {{error}}',
|
||||
params: {'error': '${error.errorCode}'},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
FilledButton(
|
||||
@@ -273,8 +295,11 @@ class _QRScanScreenState extends State<QRScanScreen> {
|
||||
: _requestCameraPermission,
|
||||
child: Text(
|
||||
_isRequestingCamera
|
||||
? '요청 중...'
|
||||
: '카메라 권한 요청하기',
|
||||
? tr('ui.common.requesting', fallback: '요청 중...')
|
||||
: tr(
|
||||
'ui.userfront.qr.request_permission',
|
||||
fallback: '카메라 권한 요청하기',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user