Skip to content

Commit

Permalink
chore: rename translate prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
evan361425 committed Sep 16, 2024
1 parent 84ad38d commit 9a7b02c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -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}",
Expand Down Expand Up @@ -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": {
Expand Down
12 changes: 6 additions & 6 deletions lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
@@ -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}",
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/order/checkout/checkout_cashier_calculator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class _CheckoutCashierCalculatorState extends State<CheckoutCashierCalculator> {
_SingleField(
key: paidState,
id: 'cashier.calculator.paid',
prefix: S.orderCheckoutCashierCalculatorLabelPaid,
prefix: S.orderCheckoutDetailsCalculatorLabelPaid,
defaultText: widget.price.value.toCurrency(),
errorText: '',
),
const Divider(),
_SingleField(
key: changeState,
id: 'cashier.calculator.change',
prefix: S.orderCheckoutCashierCalculatorLabelChange,
prefix: S.orderCheckoutDetailsCalculatorLabelChange,
defaultText: '0',
errorText: S.orderCheckoutSnackbarPaidFailed,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/order/checkout/checkout_cashier_snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _CheckoutCashierSnapshotState extends State<CheckoutCashierSnapshot> {
Expanded(child: chips),
Padding(
padding: const EdgeInsets.fromLTRB(kInternalLargeSpacing, 0, kHorizontalSpacing, 0),
child: Text(S.orderCheckoutCashierSnapshotLabelChange(change.toCurrency())),
child: Text(S.orderCheckoutDetailsSnapshotLabelChange(change.toCurrency())),
),
]);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/order/order_checkout_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
),
Expand Down Expand Up @@ -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)),
],
);
Expand Down
6 changes: 3 additions & 3 deletions test/ui/order/order_checkout_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 9a7b02c

Please sign in to comment.