Skip to content

Commit

Permalink
Merge pull request #110 from alegos27/master
Browse files Browse the repository at this point in the history
Added support for Italian language
  • Loading branch information
Daniel-Ioannou authored Mar 4, 2023
2 parents 56e9818 + df28421 commit 5de0566
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 8 deletions.
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class MyApp extends StatelessWidget {
const Locale('lt'),
const Locale('ku'),
const Locale('nl'),
const Locale('it'),
const Locale.fromSubtags(
languageCode: 'zh',
scriptCode: 'Hans'), // Generic Simplified Chinese 'zh_Hans'
Expand Down
17 changes: 9 additions & 8 deletions lib/src/country_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import 'res/strings/et.dart';
import 'res/strings/fr.dart';
import 'res/strings/gr.dart';
import 'res/strings/hr.dart';
import 'res/strings/it.dart';
import 'res/strings/ku.dart';
import 'res/strings/lt.dart';
import 'res/strings/lv.dart';
import 'res/strings/nb.dart';
import 'res/strings/nl.dart';
import 'res/strings/nn.dart';
import 'res/strings/np.dart';
import 'res/strings/pl.dart';
Expand All @@ -19,9 +23,6 @@ import 'res/strings/ru.dart';
import 'res/strings/tr.dart';
import 'res/strings/tw.dart';
import 'res/strings/uk.dart';
import 'res/strings/lv.dart';
import 'res/strings/lt.dart';
import 'res/strings/nl.dart';

class CountryLocalizations {
final Locale locale;
Expand Down Expand Up @@ -49,8 +50,7 @@ class CountryLocalizations {

/// A [LocalizationsDelegate] that uses [_CountryLocalizationsDelegate.load]
/// to create an instance of this class.
static const LocalizationsDelegate<CountryLocalizations> delegate =
_CountryLocalizationsDelegate();
static const LocalizationsDelegate<CountryLocalizations> delegate = _CountryLocalizationsDelegate();

/// The localized country name for the given country code.
String? countryName({required String countryCode}) {
Expand Down Expand Up @@ -102,16 +102,16 @@ class CountryLocalizations {
return lt[countryCode];
case 'nl':
return nl[countryCode];

case 'it':
return it[countryCode];
case 'en':
default:
return en[countryCode];
}
}
}

class _CountryLocalizationsDelegate
extends LocalizationsDelegate<CountryLocalizations> {
class _CountryLocalizationsDelegate extends LocalizationsDelegate<CountryLocalizations> {
const _CountryLocalizationsDelegate();

@override
Expand Down Expand Up @@ -139,6 +139,7 @@ class _CountryLocalizationsDelegate
'lt',
'lv',
'nl',
'it',
].contains(locale.languageCode);
}

Expand Down
250 changes: 250 additions & 0 deletions lib/src/res/strings/it.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
Map<String, String> it = {
"AF": "Afghanistan",
"AX": "Isole Aland",
"AL": "Albania",
"DZ": "Algeria",
"AS": "Samoa americane",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AG": "Antigua e Barbuda",
"AR": "Argentina",
"AM": "Armenia",
"AW": "Aruba",
"AC": "Isola di Ascensione",
"AU": "Australia",
"AT": "Austria",
"AZ": "Azerbaigian",
"BS": "Bahamas",
"BH": "Bahrein",
"BD": "Bangladesh",
"BB": "Barbados",
"BY": "Bielorussia",
"BE": "Belgio",
"BZ": "Belize",
"BJ": "Benin",
"BM": "Bermuda",
"BT": "Bhutan",
"BO": "Bolivia",
"BA": "Bosnia ed Erzegovina",
"BW": "Botswana",
"BR": "Brasile",
"IO": "Territorio britannico dell'oceano Indiano",
"VG": "Isole Vergini britanniche",
"BN": "Brunei",
"BG": "Bulgaria",
"BF": "Burkina Faso",
"BI": "Burundi",
"KH": "Cambogia",
"CM": "Camerun",
"CA": "Canada",
"CV": "Capo Verde",
"BQ": "Paesi Bassi caraibici",
"KY": "Isole Cayman",
"CF": "Repubblica Centrafricana",
"TD": "Ciad",
"CL": "Cile",
"CN": "Cina",
"CX": "Isola di Natale",
"CC": "Isole Cocos [Keeling]",
"CO": "Colombia",
"KM": "Comore",
"CD": "Repubblica Democratica del Congo",
"CG": "Congo",
"CK": "Isole Cook",
"CR": "Costa Rica",
"CI": "Costa d'Avorio",
"HR": "Croazia",
"CU": "Cuba",
"CW": "Curaçao",
"CY": "Cipro",
"CZ": "Repubblica Ceca",
"DK": "Danimarca",
"DJ": "Gibuti",
"DM": "Dominica",
"DO": "Repubblica Dominicana",
"TL": "Timor Est",
"EC": "Ecuador",
"EG": "Egitto",
"SV": "El Salvador",
"GQ": "Guinea Equatoriale",
"ER": "Eritrea",
"EE": "Estonia",
"ET": "Etiopia",
"FK": "Isole Falkland [Malvine]",
"FO": "Isole Faroe",
"FJ": "Figi",
"FI": "Finlandia",
"FR": "Francia",
"GF": "Guyana francese",
"PF": "Polinesia francese",
"GA": "Gabon",
"GM": "Gambia",
"GE": "Georgia",
"DE": "Germania",
"GH": "Ghana",
"GI": "Gibilterra",
"GR": "Grecia",
"GL": "Groenlandia",
"GD": "Grenada",
"GP": "Guadalupa",
"GU": "Guam",
"GT": "Guatemala",
"GG": "Guernsey",
"GN": "Guinea Conakry",
"GW": "Guinea-Bissau",
"GY": "Guyana",
"HT": "Haiti",
"HM": "Isole Heard e McDonald",
"HN": "Honduras",
"HK": "Hong Kong",
"HU": "Ungheria",
"IS": "Islanda",
"IN": "India",
"ID": "Indonesia",
"IR": "Iran",
"IQ": "Iraq",
"IE": "Irlanda",
"IM": "Isola di Man",
"IL": "Israele",
"IT": "Italia",
"JM": "Giamaica",
"JP": "Giappone",
"JE": "Jersey",
"JO": "Giordania",
"KZ": "Kazakistan",
"KE": "Kenya",
"KI": "Kiribati",
"XK": "Kosovo",
"KW": "Kuwait",
"KG": "Kirghizistan",
"LA": "Laos",
"LV": "Lettonia",
"LB": "Libano",
"LS": "Lesotho",
"LR": "Liberia",
"LY": "Libia",
"LI": "Liechtenstein",
"LT": "Lituania",
"LU": "Lussemburgo",
"MO": "Macao",
"MK": "Macedonia del Nord",
"MG": "Madagascar",
"MW": "Malawi",
"MY": "Malesia",
"MV": "Maldive",
"ML": "Mali",
"MT": "Malta",
"MH": "Isole Marshall",
"MQ": "Martinica",
"MR": "Mauritania",
"MU": "Mauritius",
"YT": "Mayotte",
"MX": "Messico",
"FM": "Micronesia",
"MD": "Moldavia",
"MC": "Monaco",
"MN": "Mongolia",
"ME": "Montenegro",
"MS": "Montserrat",
"MA": "Marocco",
"MZ": "Mozambico",
"MM": "Myanmar",
"NA": "Namibia",
"NR": "Nauru",
"NP": "Nepal",
"NL": "Paesi Bassi",
"NC": "Nuova Caledonia",
"NZ": "Nuova Zelanda",
"NI": "Nicaragua",
"NE": "Niger",
"NG": "Nigeria",
"NU": "Niue",
"NF": "Isola Norfolk",
"KP": "Corea del Nord",
"MP": "Isole Marianne Settentrionali",
"NO": "Norvegia",
"OM": "Oman",
"PK": "Pakistan",
"PW": "Palau",
"PS": "Territori Palestinesi",
"PA": "Panama",
"PG": "Papua Nuova Guinea",
"PY": "Paraguay",
"PE": "Perù",
"PH": "Filippine",
"PL": "Polonia",
"PT": "Portogallo",
"PR": "Portorico",
"QA": "Qatar",
"RE": "Réunion",
"RO": "Romania",
"RU": "Russia",
"RW": "Ruanda",
"BL": "Saint Barthélemy",
"SH": "Sant'Elena",
"KN": "Saint Kitts e Nevis",
"LC": "Saint Lucia",
"MF": "Saint Martin",
"PM": "Saint Pierre e Miquelon",
"VC": "Saint Vincent e Grenadine",
"WS": "Samoa",
"SM": "San Marino",
"ST": "São Tomé e Príncipe",
"SA": "Arabia Saudita",
"SN": "Senegal",
"RS": "Serbia",
"SC": "Seychelles",
"SL": "Sierra Leone",
"SG": "Singapore",
"SX": "Sint Maarten",
"SK": "Slovacchia",
"SI": "Slovenia",
"SB": "Isole Salomone",
"SO": "Somalia",
"ZA": "Sud Africa",
"GS": "Georgia del Sud e Isole Sandwich Meridionali",
"KR": "Corea del Sud",
"SS": "Sud Sudan",
"ES": "Spagna",
"LK": "Sri Lanka",
"SD": "Sudan",
"SR": "Suriname",
"SJ": "Svalbard e Jan Mayen",
"SZ": "Eswatini",
"SE": "Svezia",
"CH": "Svizzera",
"SY": "Siria",
"TW": "Taiwan",
"TJ": "Tagikistan",
"TZ": "Tanzania",
"TH": "Thailandia",
"TG": "Togo",
"TK": "Tokelau",
"TO": "Tonga",
"TT": "Trinidad e Tobago",
"TN": "Tunisia",
"TR": "Turchia",
"TM": "Turkmenistan",
"TC": "Isole Turks e Caicos",
"TV": "Tuvalu",
"VI": "Isole Vergini americane",
"UG": "Uganda",
"UA": "Ucraina",
"AE": "Emirati Arabi Uniti",
"GB": "Regno Unito",
"US": "Stati Uniti",
"UY": "Uruguay",
"UZ": "Uzbekistan",
"VU": "Vanuatu",
"VA": "Città del Vaticano",
"VE": "Venezuela",
"VN": "Vietnam",
"WF": "Wallis e Futuna",
"WW": "Mondo",
"EH": "Sahara Occidentale",
"YE": "Yemen",
"ZM": "Zambia",
"ZW": "Zimbabwe",
"search": "Cerca",
};

0 comments on commit 5de0566

Please sign in to comment.