add localization for no_country text
This commit is contained in:
@@ -21,7 +21,6 @@ class CountryLocalizations {
|
|||||||
late Map<String, String> _localizedStrings;
|
late Map<String, String> _localizedStrings;
|
||||||
|
|
||||||
Future<bool> load() async {
|
Future<bool> load() async {
|
||||||
print('locale.languageCode: ${locale.languageCode}');
|
|
||||||
String jsonString = await rootBundle.loadString(
|
String jsonString = await rootBundle.loadString(
|
||||||
'packages/country_code_picker/i18n/${locale.languageCode}.json');
|
'packages/country_code_picker/i18n/${locale.languageCode}.json');
|
||||||
Map<String, dynamic> jsonMap = json.decode(jsonString);
|
Map<String, dynamic> jsonMap = json.decode(jsonString);
|
||||||
|
|||||||
@@ -264,5 +264,6 @@
|
|||||||
"RS": "Serbia",
|
"RS": "Serbia",
|
||||||
"SX": "Sint Maarten (Dutch part)",
|
"SX": "Sint Maarten (Dutch part)",
|
||||||
"SS": "South Sudan",
|
"SS": "South Sudan",
|
||||||
"XK": "Kosovo"
|
"XK": "Kosovo",
|
||||||
|
"no_country": "No country found"
|
||||||
}
|
}
|
||||||
@@ -248,5 +248,6 @@
|
|||||||
"ZA": "Sudafrica",
|
"ZA": "Sudafrica",
|
||||||
"ZM": "Zambia",
|
"ZM": "Zambia",
|
||||||
"ZW": "Zimbabwe",
|
"ZW": "Zimbabwe",
|
||||||
"XK": "Kosovo"
|
"XK": "Kosovo",
|
||||||
|
"no_country": "Nessun paese trovato"
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:country_code_picker/country_code.dart';
|
import 'package:country_code_picker/country_code.dart';
|
||||||
|
import 'package:country_code_picker/country_localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/// selection dialog used for selection of the country code
|
/// selection dialog used for selection of the country code
|
||||||
@@ -176,7 +177,8 @@ class _SelectionDialogState extends State<SelectionDialog> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Center(
|
return Center(
|
||||||
child: Text('No country found'),
|
child: Text(CountryLocalizations.of(context)?.translate('no_country') ??
|
||||||
|
'No country found'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user