diff --git a/lib/country_localizations.dart b/lib/country_localizations.dart index bfa8032..3020f78 100644 --- a/lib/country_localizations.dart +++ b/lib/country_localizations.dart @@ -21,7 +21,6 @@ class CountryLocalizations { late Map _localizedStrings; Future load() async { - print('locale.languageCode: ${locale.languageCode}'); String jsonString = await rootBundle.loadString( 'packages/country_code_picker/i18n/${locale.languageCode}.json'); Map jsonMap = json.decode(jsonString); diff --git a/lib/i18n/en.json b/lib/i18n/en.json index db1d529..68e89d8 100644 --- a/lib/i18n/en.json +++ b/lib/i18n/en.json @@ -264,5 +264,6 @@ "RS": "Serbia", "SX": "Sint Maarten (Dutch part)", "SS": "South Sudan", - "XK": "Kosovo" + "XK": "Kosovo", + "no_country": "No country found" } \ No newline at end of file diff --git a/lib/i18n/it.json b/lib/i18n/it.json index b229392..b7ce5f0 100644 --- a/lib/i18n/it.json +++ b/lib/i18n/it.json @@ -248,5 +248,6 @@ "ZA": "Sudafrica", "ZM": "Zambia", "ZW": "Zimbabwe", - "XK": "Kosovo" + "XK": "Kosovo", + "no_country": "Nessun paese trovato" } \ No newline at end of file diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index 34f3168..176d0ee 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -1,4 +1,5 @@ import 'package:country_code_picker/country_code.dart'; +import 'package:country_code_picker/country_localizations.dart'; import 'package:flutter/material.dart'; /// selection dialog used for selection of the country code @@ -176,7 +177,8 @@ class _SelectionDialogState extends State { } return Center( - child: Text('No country found'), + child: Text(CountryLocalizations.of(context)?.translate('no_country') ?? + 'No country found'), ); }