From 9a7b02c7fdeb366116590173ee332beefe4ce88e Mon Sep 17 00:00:00 2001 From: Lu Shueh Chou Date: Mon, 16 Sep 2024 09:29:41 +0800 Subject: [PATCH] chore: rename translate prefix --- lib/l10n/app_en.arb | 12 ++++++------ lib/l10n/app_zh.arb | 12 ++++++------ .../order/checkout/checkout_cashier_calculator.dart | 4 ++-- lib/ui/order/checkout/checkout_cashier_snapshot.dart | 2 +- lib/ui/order/order_checkout_page.dart | 4 ++-- test/ui/order/order_checkout_page_test.dart | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index eea00cd8..ca45b68e 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1,6 +1,6 @@ { "@@locale": "en", - "@@last_modified": "2024-09-14T13:02:19.109593Z", + "@@last_modified": "2024-09-16T01:27:44.582362Z", "@@author": "Lu Shueh Chou", "settingTab": "Settings", "settingVersion": "Version: {version}", @@ -1735,11 +1735,11 @@ "orderCheckoutStashDialogRestoreContent": "This action will override the current cart contents.", "orderCheckoutStashDialogDeleteName": "order", "orderCheckoutAttributeTab": "Customer", - "orderCheckoutCashierTab": "Checkout", - "orderCheckoutCashierCalculatorLabelPaid": "Paid", - "orderCheckoutCashierCalculatorLabelChange": "Change", - "orderCheckoutCashierSnapshotLabelChange": "Change: {change}", - "@orderCheckoutCashierSnapshotLabelChange": { + "orderCheckoutDetailsTab": "Details", + "orderCheckoutDetailsCalculatorLabelPaid": "Paid", + "orderCheckoutDetailsCalculatorLabelChange": "Change", + "orderCheckoutDetailsSnapshotLabelChange": "Change: {change}", + "@orderCheckoutDetailsSnapshotLabelChange": { "description": "Change given by the cashier after the customer's payment", "placeholders": { "change": { diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 39b0d034..a853faff 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -1,6 +1,6 @@ { "@@locale": "zh", - "@@last_modified": "2024-09-14T13:02:19.146195Z", + "@@last_modified": "2024-09-16T01:27:44.603687Z", "@@author": "Lu Shueh Chou", "settingTab": "設定", "settingVersion": "版本:{version}", @@ -1735,11 +1735,11 @@ "orderCheckoutStashDialogRestoreContent": "此動作將會覆蓋掉現在購物車內的訂單。", "orderCheckoutStashDialogDeleteName": "訂單", "orderCheckoutAttributeTab": "顧客設定", - "orderCheckoutCashierTab": "收銀機", - "orderCheckoutCashierCalculatorLabelPaid": "付額", - "orderCheckoutCashierCalculatorLabelChange": "找錢", - "orderCheckoutCashierSnapshotLabelChange": "找錢:{change}", - "@orderCheckoutCashierSnapshotLabelChange": { + "orderCheckoutDetailsTab": "訂單細項", + "orderCheckoutDetailsCalculatorLabelPaid": "付額", + "orderCheckoutDetailsCalculatorLabelChange": "找錢", + "orderCheckoutDetailsSnapshotLabelChange": "找錢:{change}", + "@orderCheckoutDetailsSnapshotLabelChange": { "description": "Change given by the cashier after the customer's payment", "placeholders": { "change": { diff --git a/lib/ui/order/checkout/checkout_cashier_calculator.dart b/lib/ui/order/checkout/checkout_cashier_calculator.dart index 5c20ff99..cd2088ef 100644 --- a/lib/ui/order/checkout/checkout_cashier_calculator.dart +++ b/lib/ui/order/checkout/checkout_cashier_calculator.dart @@ -42,7 +42,7 @@ class _CheckoutCashierCalculatorState extends State { _SingleField( key: paidState, id: 'cashier.calculator.paid', - prefix: S.orderCheckoutCashierCalculatorLabelPaid, + prefix: S.orderCheckoutDetailsCalculatorLabelPaid, defaultText: widget.price.value.toCurrency(), errorText: '', ), @@ -50,7 +50,7 @@ class _CheckoutCashierCalculatorState extends State { _SingleField( key: changeState, id: 'cashier.calculator.change', - prefix: S.orderCheckoutCashierCalculatorLabelChange, + prefix: S.orderCheckoutDetailsCalculatorLabelChange, defaultText: '0', errorText: S.orderCheckoutSnackbarPaidFailed, ), diff --git a/lib/ui/order/checkout/checkout_cashier_snapshot.dart b/lib/ui/order/checkout/checkout_cashier_snapshot.dart index d3d022d9..577782a2 100644 --- a/lib/ui/order/checkout/checkout_cashier_snapshot.dart +++ b/lib/ui/order/checkout/checkout_cashier_snapshot.dart @@ -57,7 +57,7 @@ class _CheckoutCashierSnapshotState extends State { Expanded(child: chips), Padding( padding: const EdgeInsets.fromLTRB(kInternalLargeSpacing, 0, kHorizontalSpacing, 0), - child: Text(S.orderCheckoutCashierSnapshotLabelChange(change.toCurrency())), + child: Text(S.orderCheckoutDetailsSnapshotLabelChange(change.toCurrency())), ), ]); } diff --git a/lib/ui/order/order_checkout_page.dart b/lib/ui/order/order_checkout_page.dart index 1a890de7..a55bb24a 100644 --- a/lib/ui/order/order_checkout_page.dart +++ b/lib/ui/order/order_checkout_page.dart @@ -111,7 +111,7 @@ class _MobileState extends State<_Mobile> with SingleTickerProviderStateMixin { controller: _controller, tabs: [ if (widget.hasAttr) Tab(key: const Key('order.details.attr'), text: S.orderCheckoutAttributeTab), - Tab(key: const Key('order.details.order'), text: S.orderCheckoutCashierTab), + Tab(key: const Key('order.details.order'), text: S.orderCheckoutDetailsTab), Tab(key: const Key('order.details.stashed'), text: S.orderCheckoutStashTab), ], ), @@ -319,7 +319,7 @@ class _Desktop extends StatelessWidget { onSelectionChanged: (value) => viewIndex.value = value.first, segments: [ if (hasAttr) ButtonSegment(value: idx++, label: Text(S.orderCheckoutAttributeTab)), - ButtonSegment(value: idx++, label: Text(S.orderCheckoutCashierTab)), + ButtonSegment(value: idx++, label: Text(S.orderCheckoutDetailsTab)), ButtonSegment(value: idx++, label: Text(S.orderCheckoutStashTab)), ], ); diff --git a/test/ui/order/order_checkout_page_test.dart b/test/ui/order/order_checkout_page_test.dart index f8b67e45..d2fefd99 100644 --- a/test/ui/order/order_checkout_page_test.dart +++ b/test/ui/order/order_checkout_page_test.dart @@ -228,7 +228,7 @@ void main() { // only mobile has this change text and allow to drag if (device == Device.mobile) { - expect(find.text(S.orderCheckoutCashierSnapshotLabelChange('2')), findsOneWidget); + expect(find.text(S.orderCheckoutDetailsSnapshotLabelChange('2')), findsOneWidget); await tester.drag( find.byKey(const Key('order.details.ds')), const Offset(0, -408), @@ -274,7 +274,7 @@ void main() { await tester.tapAt(const Offset(400, 161)); await tester.pumpAndSettle(); - expect(find.text(S.orderCheckoutCashierSnapshotLabelChange('62')), findsOneWidget); + expect(find.text(S.orderCheckoutDetailsSnapshotLabelChange('62')), findsOneWidget); } expect(find.byKey(const Key('cashier.snapshot.90')), findsOneWidget); @@ -370,7 +370,7 @@ void main() { await tester.tap(find.byKey(const Key('order.attr.oa-1.oao-1'))); await tester.tap(find.byKey(const Key('order.attr.oa-2.oao-3'))); - await tester.tap(find.text(S.orderCheckoutCashierTab)); + await tester.tap(find.text(S.orderCheckoutDetailsTab)); await tester.pumpAndSettle(); final now = DateTime.now();