Skip to content

Commit 2c81ff2

Browse files
authored
Fixed: i18n files appear on build: aissat#497 aissat#540 (aissat#593)
* Fixed: i18n files appear on build: aissat#497 aissat#540 * Changed tests Test will now work even if the folder i18n is not specified in pubspec.yaml
1 parent d80400e commit 2c81ff2

File tree

3 files changed

+30
-34
lines changed

3 files changed

+30
-34
lines changed

pubspec.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,3 @@ dev_dependencies:
2626
flutter_test:
2727
sdk: flutter
2828
flutter_lints: ^2.0.1
29-
30-
flutter:
31-
assets:
32-
- i18n/

test/easy_localization_context_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void main() async {
6060
(WidgetTester tester) async {
6161
await tester.runAsync(() async {
6262
await tester.pumpWidget(EasyLocalization(
63-
path: 'i18n',
63+
path: '../../i18n',
6464
saveLocale: false,
6565
useOnlyLangCode: true,
6666
supportedLocales: const [Locale('ar')],
@@ -83,7 +83,7 @@ void main() async {
8383
(WidgetTester tester) async {
8484
await tester.runAsync(() async {
8585
await tester.pumpWidget(EasyLocalization(
86-
path: 'i18n',
86+
path: '../../i18n',
8787
saveLocale: false,
8888
useOnlyLangCode: true,
8989
// fallbackLocale:Locale('en') ,
@@ -115,7 +115,7 @@ void main() async {
115115
(WidgetTester tester) async {
116116
await tester.runAsync(() async {
117117
await tester.pumpWidget(EasyLocalization(
118-
path: 'i18n',
118+
path: '../../i18n',
119119
// fallbackLocale:Locale('en') ,
120120
supportedLocales: const [
121121
Locale('en', 'US'),
@@ -138,7 +138,7 @@ void main() async {
138138
(WidgetTester tester) async {
139139
await tester.runAsync(() async {
140140
await tester.pumpWidget(EasyLocalization(
141-
path: 'i18n',
141+
path: '../../i18n',
142142
// fallbackLocale:Locale('en') ,
143143
supportedLocales: const [
144144
Locale('en', 'US'),
@@ -160,7 +160,7 @@ void main() async {
160160
(WidgetTester tester) async {
161161
await tester.runAsync(() async {
162162
await tester.pumpWidget(EasyLocalization(
163-
path: 'i18n',
163+
path: '../../i18n',
164164
supportedLocales: const [
165165
Locale('en', 'US'),
166166
Locale('ar', 'DZ')
@@ -181,7 +181,7 @@ void main() async {
181181
(WidgetTester tester) async {
182182
await tester.runAsync(() async {
183183
await tester.pumpWidget(EasyLocalization(
184-
path: 'i18n',
184+
path: '../../i18n',
185185
supportedLocales: const [
186186
Locale('en', 'US'),
187187
Locale('ar', 'DZ')
@@ -207,7 +207,7 @@ void main() async {
207207
(WidgetTester tester) async {
208208
await tester.runAsync(() async {
209209
await tester.pumpWidget(EasyLocalization(
210-
path: 'i18n',
210+
path: '../../i18n',
211211
supportedLocales: const [
212212
Locale('en', 'US'),
213213
Locale('ar', 'DZ')
@@ -228,7 +228,7 @@ void main() async {
228228
(WidgetTester tester) async {
229229
await tester.runAsync(() async {
230230
await tester.pumpWidget(EasyLocalization(
231-
path: 'i18n',
231+
path: '../../i18n',
232232
supportedLocales: const [
233233
Locale('en', 'US'),
234234
Locale('ar', 'DZ')

test/easy_localization_widget_test.dart

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void main() async {
120120
(WidgetTester tester) async {
121121
await tester.runAsync(() async {
122122
await tester.pumpWidget(EasyLocalization(
123-
path: 'i18n',
123+
path: '../../i18n',
124124
assetLoader: const RootBundleAssetLoader(),
125125
supportedLocales: const [Locale('en', 'US')],
126126
child: const MyApp(),
@@ -150,7 +150,7 @@ void main() async {
150150
(WidgetTester tester) async {
151151
await tester.runAsync(() async {
152152
await tester.pumpWidget(EasyLocalization(
153-
path: 'i18n',
153+
path: '../../i18n',
154154
supportedLocales: const [Locale('en', 'US')],
155155
child: const MyApp(),
156156
));
@@ -198,7 +198,7 @@ void main() async {
198198
(WidgetTester tester) async {
199199
await tester.runAsync(() async {
200200
await tester.pumpWidget(EasyLocalization(
201-
path: 'i18n',
201+
path: '../../i18n',
202202
supportedLocales: const [Locale('en', 'US')],
203203
child: const MyApp(),
204204
));
@@ -241,7 +241,7 @@ void main() async {
241241
(WidgetTester tester) async {
242242
await tester.runAsync(() async {
243243
await tester.pumpWidget(EasyLocalization(
244-
path: 'i18n',
244+
path: '../../i18n',
245245
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
246246
child: const MyApp(),
247247
));
@@ -299,7 +299,7 @@ void main() async {
299299
(WidgetTester tester) async {
300300
await tester.runAsync(() async {
301301
await tester.pumpWidget(EasyLocalization(
302-
path: 'i18n',
302+
path: '../../i18n',
303303
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
304304
child: const MyApp(),
305305
));
@@ -340,7 +340,7 @@ void main() async {
340340
(WidgetTester tester) async {
341341
await tester.runAsync(() async {
342342
await tester.pumpWidget(EasyLocalization(
343-
path: 'i18n',
343+
path: '../../i18n',
344344
saveLocale: false,
345345
useOnlyLangCode: true,
346346
supportedLocales: const [Locale('en'), Locale('ar')],
@@ -366,7 +366,7 @@ void main() async {
366366
(WidgetTester tester) async {
367367
await tester.runAsync(() async {
368368
await tester.pumpWidget(EasyLocalization(
369-
path: 'i18n',
369+
path: '../../i18n',
370370
saveLocale: false,
371371
useOnlyLangCode: true,
372372
supportedLocales: const [Locale('en'), Locale('ar')],
@@ -392,7 +392,7 @@ void main() async {
392392
(WidgetTester tester) async {
393393
await tester.runAsync(() async {
394394
await tester.pumpWidget(EasyLocalization(
395-
path: 'i18n',
395+
path: '../../i18n',
396396
saveLocale: false,
397397
useOnlyLangCode: true,
398398
supportedLocales: const [Locale('ar')],
@@ -417,7 +417,7 @@ void main() async {
417417
(WidgetTester tester) async {
418418
await tester.runAsync(() async {
419419
await tester.pumpWidget(EasyLocalization(
420-
path: 'i18n',
420+
path: '../../i18n',
421421
saveLocale: false,
422422
useOnlyLangCode: true,
423423
// fallbackLocale:Locale('en') ,
@@ -448,7 +448,7 @@ void main() async {
448448
(WidgetTester tester) async {
449449
await tester.runAsync(() async {
450450
await tester.pumpWidget(EasyLocalization(
451-
path: 'i18n',
451+
path: '../../i18n',
452452
// fallbackLocale:Locale('en') ,
453453
supportedLocales: const [Locale('en'), Locale('ar')],
454454
child: const MyApp(), //
@@ -470,7 +470,7 @@ void main() async {
470470
(WidgetTester tester) async {
471471
await tester.runAsync(() async {
472472
await tester.pumpWidget(EasyLocalization(
473-
path: 'i18n',
473+
path: '../../i18n',
474474
// fallbackLocale:Locale('en') ,
475475
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
476476
child: const MyApp(), //
@@ -493,7 +493,7 @@ void main() async {
493493
(WidgetTester tester) async {
494494
await tester.runAsync(() async {
495495
await tester.pumpWidget(EasyLocalization(
496-
path: 'i18n',
496+
path: '../../i18n',
497497
startLocale: const Locale('ar', 'DZ'),
498498
// fallbackLocale:Locale('en') ,
499499
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
@@ -527,7 +527,7 @@ void main() async {
527527
(WidgetTester tester) async {
528528
await tester.runAsync(() async {
529529
await tester.pumpWidget(EasyLocalization(
530-
path: 'i18n',
530+
path: '../../i18n',
531531
saveLocale: true,
532532
// fallbackLocale:Locale('en') ,
533533
useOnlyLangCode: true,
@@ -560,7 +560,7 @@ void main() async {
560560
(WidgetTester tester) async {
561561
await tester.runAsync(() async {
562562
await tester.pumpWidget(EasyLocalization(
563-
path: 'i18n',
563+
path: '../../i18n',
564564
saveLocale: true,
565565
// fallbackLocale:Locale('en') ,
566566
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
@@ -584,7 +584,7 @@ void main() async {
584584
(WidgetTester tester) async {
585585
await tester.runAsync(() async {
586586
await tester.pumpWidget(EasyLocalization(
587-
path: 'i18n',
587+
path: '../../i18n',
588588
saveLocale: false,
589589
// fallbackLocale:Locale('en') ,
590590
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
@@ -617,7 +617,7 @@ void main() async {
617617
(WidgetTester tester) async {
618618
await tester.runAsync(() async {
619619
await tester.pumpWidget(EasyLocalization(
620-
path: 'i18n',
620+
path: '../../i18n',
621621
// fallbackLocale:Locale('en') ,
622622
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
623623
child: const MyApp(), // Locale('en', 'US'), Locale('ar','DZ')
@@ -638,7 +638,7 @@ void main() async {
638638
(WidgetTester tester) async {
639639
await tester.runAsync(() async {
640640
await tester.pumpWidget(EasyLocalization(
641-
path: 'i18n',
641+
path: '../../i18n',
642642
// fallbackLocale:Locale('en') ,
643643
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
644644
child: const MyApp(), // Locale('en', 'US'), Locale('ar','DZ')
@@ -658,7 +658,7 @@ void main() async {
658658
(WidgetTester tester) async {
659659
await tester.runAsync(() async {
660660
await tester.pumpWidget(EasyLocalization(
661-
path: 'i18n',
661+
path: '../../i18n',
662662
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
663663
child: const MyApp(), // Locale('en', 'US'), Locale('ar','DZ')
664664
));
@@ -677,7 +677,7 @@ void main() async {
677677
(WidgetTester tester) async {
678678
await tester.runAsync(() async {
679679
await tester.pumpWidget(EasyLocalization(
680-
path: 'i18n',
680+
path: '../../i18n',
681681
supportedLocales: const [
682682
Locale('en', 'US'),
683683
Locale('ar', 'DZ')
@@ -705,7 +705,7 @@ void main() async {
705705
(WidgetTester tester) async {
706706
await tester.runAsync(() async {
707707
await tester.pumpWidget(EasyLocalization(
708-
path: 'i18n',
708+
path: '../../i18n',
709709
supportedLocales: const [Locale('en', 'US'), Locale('ar', 'DZ')],
710710
child: const MyApp(), // Locale('en', 'US'), Locale('ar','DZ')
711711
));
@@ -724,7 +724,7 @@ void main() async {
724724
(WidgetTester tester) async {
725725
await tester.runAsync(() async {
726726
await tester.pumpWidget(EasyLocalization(
727-
path: 'i18n',
727+
path: '../../i18n',
728728
supportedLocales: const [
729729
Locale('en', 'US'),
730730
Locale('ar', 'DZ')
@@ -750,7 +750,7 @@ void main() async {
750750

751751
group('Context extensions tests', () {
752752
final testWidget = EasyLocalization(
753-
path: 'i18n',
753+
path: '../../i18n',
754754
supportedLocales: const [
755755
Locale('en', 'US'),
756756
Locale('ar', 'DZ')

0 commit comments

Comments
 (0)