Skip to content

Commit 7467dfc

Browse files
authored
feat(l10n): add l10n (#17)
1 parent ef54c3e commit 7467dfc

File tree

5 files changed

+258
-1
lines changed

5 files changed

+258
-1
lines changed

l10n.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
arb-dir: lib/src/l10n
2+
template-arb-file: app_en.arb
3+
output-localization-file: app_localizations.dart

lib/src/app.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
23

34
import 'routes.dart';
45
import 'theme.dart';
@@ -11,6 +12,9 @@ class App extends StatelessWidget {
1112
Widget build(BuildContext context) {
1213
return MaterialApp(
1314
title: 'Create Invoice',
15+
onGenerateTitle: (context) => AppLocalizations.of(context)!.appTitle,
16+
localizationsDelegates: AppLocalizations.localizationsDelegates,
17+
supportedLocales: AppLocalizations.supportedLocales,
1418
theme: theme,
1519
darkTheme: darkTheme,
1620
themeMode: ThemeMode.system,

lib/src/l10n/app_en.arb

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
{
2+
"appTitle": "Create invoice",
3+
"@appTitle": {
4+
"description": "App title for the root app"
5+
},
6+
"addItem": "Add item",
7+
"@addItem": {
8+
"description": "A title for add item page"
9+
},
10+
"itemName": "Item name",
11+
"@itemName": {
12+
"description": "A title for item name text field"
13+
},
14+
"price": "Price",
15+
"@price": {
16+
"description": "A title for price text field"
17+
},
18+
"discount": "Discount",
19+
"@discount": {
20+
"description": "A title for discount text field"
21+
},
22+
"usePercentage": "Use percentage",
23+
"@usePercentage": {
24+
"description": "A hint text for discount text field"
25+
},
26+
"addRecipient": "Add recipient",
27+
"@addRecipient": {
28+
"description": "A title for recipient page"
29+
},
30+
"name": "Name",
31+
"@name": {
32+
"description": "A title for name text field"
33+
},
34+
"address": "Address",
35+
"@address": {
36+
"description": "A title for address text field"
37+
},
38+
"thankNote": "Thank you for your business! Please complete the remaining balance by the due date to avoid late fees. If you have any questions, feel free to contact us.",
39+
"@thankNote": {
40+
"description": "A thank note for invoice"
41+
},
42+
"selectCurrency": "Select currency",
43+
"@selectCurrency": {
44+
"description": "A title for select currency page"
45+
},
46+
"editCurrency": "Edit currency",
47+
"@editCurrency": {
48+
"description": "A title for edit currency page"
49+
},
50+
"cont": "Continue",
51+
"@cont": {
52+
"description": "An action text for continue button"
53+
},
54+
"editItem": "Edit item",
55+
"@editItem": {
56+
"description": "A title for edit item page"
57+
},
58+
"save": "Save",
59+
"@save": {
60+
"description": "An action text for save button"
61+
},
62+
"editRecipient": "Edit recipient",
63+
"@editRecipient": {
64+
"description": "A title for edit recipient page"
65+
},
66+
"editStore": "Edit store info",
67+
"@editStore": {
68+
"description": "A title for edit store info page"
69+
},
70+
"storeName": "Store name",
71+
"@storeName": {
72+
"description": "A title for store name text field"
73+
},
74+
"billedTo": "Billed to",
75+
"@billedTo": {
76+
"description": "A leading text for recipient"
77+
},
78+
"delete": "Delete",
79+
"@delete": {
80+
"description": "An action text for delete button"
81+
},
82+
"manageStore": "Manage store",
83+
"@manageStore": {
84+
"description": "An action text for manage store button"
85+
},
86+
"recipient": "Recipient",
87+
"@recipient": {
88+
"description": "A title for recipient page"
89+
},
90+
"failedToLoad": "Failed to load",
91+
"@failedToLoad": {
92+
"description": "A text to explain load failure"
93+
},
94+
"noData": "No data",
95+
"@noData": {
96+
"description": "A text to explain no data"
97+
},
98+
"fillInvoiceDetails": "Fill invoice details",
99+
"@fillInvoiceDetails": {
100+
"description": "An action text for fill invoice details button"
101+
},
102+
"permissionDenied": "Permission denied",
103+
"@permissionDenied": {
104+
"description": "A text to explain permission was denied"
105+
},
106+
"invoiceDetails": "Invoice details",
107+
"@invoiceDetails": {
108+
"description": "A title for invoice details form"
109+
},
110+
"paid": "Paid",
111+
"@paid": {
112+
"description": "A title for paid text field"
113+
},
114+
"paymentDetails": "Payment details",
115+
"@paymentDetails": {
116+
"description": "A text divider for payment details section"
117+
},
118+
"accountNumber": "Account number",
119+
"@accountNumber": {
120+
"description": "A title for account number text field"
121+
},
122+
"accountHolderName": "Account holder name",
123+
"@accountHolderName": {
124+
"description": "A title for account holder name text field"
125+
},
126+
"swiftCode": "Swift code",
127+
"@swiftCode": {
128+
"description": "A title for swift code text field"
129+
},
130+
"Tax": "Tax",
131+
"@Tax": {
132+
"description": "A title for tax text field"
133+
},
134+
"inPercent": "In percent",
135+
"@inPercent": {
136+
"description": "A text helper for tax text field"
137+
},
138+
"dueDateRange": "Due date range",
139+
"@dueDateRange": {
140+
"description": "A text for due date range text field"
141+
},
142+
"noPurchaseItem": "Can't proceed, there's no purchase item",
143+
"@noPurchaseItem": {
144+
"description": "A text for no purchase item message"
145+
},
146+
"qty": "Qty",
147+
"@qty": {
148+
"description": "A text for qty cell"
149+
},
150+
"preview": "Preview",
151+
"@preview": {
152+
"description": "A title for preview page"
153+
},
154+
"backToHome": "Back to home",
155+
"@backToHome": {
156+
"description": "An action text for back to home button"
157+
},
158+
"invoice": "Invoice",
159+
"@invoice": {
160+
"description": "A title for invoice"
161+
},
162+
"amount": "Amount",
163+
"@amount": {
164+
"description": "A title for amount cell"
165+
},
166+
"date": "Date",
167+
"@date": {
168+
"description": "A leading text for date info"
169+
},
170+
"dueDate": "Due date",
171+
"@dueDate": {
172+
"description": "A leading text for due date info"
173+
},
174+
"subtotal": "Subtotal",
175+
"@subtotal": {
176+
"description": "A leading text for subtotal info"
177+
},
178+
"totalDiscount": "Total discount",
179+
"@totalDiscount": {
180+
"description": "A leading text for total discount info"
181+
},
182+
"grandTotal": "Grand total",
183+
"@grandTotal": {
184+
"description": "A leading text for grand total info"
185+
},
186+
"leftOver": "Left over",
187+
"@leftOver": {
188+
"description": "A leading text for left over info"
189+
},
190+
"bank": "Bank",
191+
"@bank": {
192+
"description": "A leading text for bank info"
193+
},
194+
"successfullyDownloaded": "File successfully downloaded",
195+
"@successfullyDownloaded": {
196+
"description": "A message after file successfully downloaded"
197+
}
198+
}

lib/src/l10n/app_id.arb

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"appTitle": "Buat faktur",
3+
"addItem": "Tambah item",
4+
"itemName": "Nama item",
5+
"price": "Harga",
6+
"discount": "Diskon",
7+
"usePercentage": "Gunakan persenan",
8+
"addRecipient": "Tambah penerima",
9+
"name": "Nama",
10+
"address": "Alamat",
11+
"thankNote": "Terima kasih atas bisnis Anda! Silakan lunasi sisa saldo sebelum tanggal jatuh tempo untuk menghindari denda keterlambatan. Jika Anda memiliki pertanyaan, jangan ragu untuk menghubungi kami.",
12+
"selectCurrency": "Pilih mata uang",
13+
"editCurrency": "Atur mata uang",
14+
"cont": "Lanjutkan",
15+
"editItem": "Atur item",
16+
"save": "Simpan",
17+
"editRecipient": "Atur penerima",
18+
"editStore": "Atur info toko",
19+
"storeName": "Nama toko",
20+
"billedTo": "Ditagih ke",
21+
"delete": "Hapus",
22+
"manageStore": "Kelola toko",
23+
"recipient": "Penerima",
24+
"failedToLoad": "Gagal untuk memuat",
25+
"noData": "Tidak ada data",
26+
"fillInvoiceDetails": "Isi detil faktur",
27+
"permissionDenied": "Izin ditolak",
28+
"invoiceDetails": "Detil faktur",
29+
"paid": "Dibayar",
30+
"paymentDetails": "Detil",
31+
"accountNumber": "Nomor akun",
32+
"accountHolderName": "Atas nama",
33+
"swiftCode": "Kode swift",
34+
"Tax": "Pajak",
35+
"inPercent": "Dalam persen",
36+
"dueDateRange": "Jarak jatuh tempo",
37+
"noPurchaseItem": "Tidak dapat melanjutkan, tidak ada item pembelian",
38+
"qty": "Qty",
39+
"backToHome": "Kembali ke home",
40+
"invoice": "Faktur",
41+
"amount": "Jumlah",
42+
"date": "Tanggal",
43+
"dueDate": "Jatuh tempo",
44+
"subtotal": "Subtotal",
45+
"totalDiscount": "Total diskon",
46+
"grandTotal": "Grand total",
47+
"leftOver": "Sisa",
48+
"bank": "Bank",
49+
"successfullyDownloaded": "Berkas berhasil diunduh"
50+
}

pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ environment:
3030
dependencies:
3131
flutter:
3232
sdk: flutter
33+
flutter_localizations:
34+
sdk: flutter
35+
intl: any
3336

3437
# The following adds the Cupertino Icons font to your application.
3538
# Use with the CupertinoIcons class for iOS style icons.
3639
cupertino_icons: ^1.0.8
37-
intl: ^0.20.2
3840
permission_handler: ^11.3.1
3941
image_picker: ^1.1.2
4042
printing: ^5.14.0

0 commit comments

Comments
 (0)