From a90be84a5ea3d54f5da2bda0b016ee287b65ce3f Mon Sep 17 00:00:00 2001 From: alexsandersarmento Date: Tue, 6 May 2025 11:21:29 -0300 Subject: [PATCH 1/4] Add countryComparator parameter to country picker and list bottom sheet --- lib/country_picker.dart | 2 ++ lib/src/country_list_bottom_sheet.dart | 14 ++++---- lib/src/country_list_view.dart | 46 ++++++++++---------------- 3 files changed, 26 insertions(+), 36 deletions(-) diff --git a/lib/country_picker.dart b/lib/country_picker.dart index fd9dce4..456bf64 100644 --- a/lib/country_picker.dart +++ b/lib/country_picker.dart @@ -68,6 +68,7 @@ void showCountryPicker({ bool useRootNavigator = false, bool moveAlongWithKeyboard = false, Widget header = const SizedBox.shrink(), + int Function(Country a, Country b)? countryComparator, }) { assert( exclude == null || countryFilter == null, @@ -90,5 +91,6 @@ void showCountryPicker({ useRootNavigator: useRootNavigator, moveAlongWithKeyboard: moveAlongWithKeyboard, header: header, + countryComparator: countryComparator, ); } diff --git a/lib/src/country_list_bottom_sheet.dart b/lib/src/country_list_bottom_sheet.dart index 3bfd06d..78fb5ac 100644 --- a/lib/src/country_list_bottom_sheet.dart +++ b/lib/src/country_list_bottom_sheet.dart @@ -21,6 +21,7 @@ void showCountryListBottomSheet({ bool useRootNavigator = false, bool moveAlongWithKeyboard = false, Widget header = const SizedBox.shrink(), + int Function(Country a, Country b)? countryComparator, }) { showModalBottomSheet( context: context, @@ -42,6 +43,7 @@ void showCountryListBottomSheet({ moveAlongWithKeyboard, customFlagBuilder, header, + countryComparator, ), ).whenComplete(() { if (onClosed != null) onClosed(); @@ -62,15 +64,14 @@ Widget _builder( bool moveAlongWithKeyboard, CustomFlagBuilder? customFlagBuilder, Widget header, + int Function(Country a, Country b)? countryComparator, ) { final device = MediaQuery.of(context).size.height; final statusBarHeight = MediaQuery.of(context).padding.top; - final height = countryListTheme?.bottomSheetHeight ?? - device - (statusBarHeight + (kToolbarHeight / 1.5)); + final height = countryListTheme?.bottomSheetHeight ?? device - (statusBarHeight + (kToolbarHeight / 1.5)); final width = countryListTheme?.bottomSheetWidth; - Color? _backgroundColor = countryListTheme?.backgroundColor ?? - Theme.of(context).bottomSheetTheme.backgroundColor; + Color? _backgroundColor = countryListTheme?.backgroundColor ?? Theme.of(context).bottomSheetTheme.backgroundColor; if (_backgroundColor == null) { if (Theme.of(context).brightness == Brightness.light) { @@ -87,9 +88,7 @@ Widget _builder( ); return Padding( - padding: moveAlongWithKeyboard - ? MediaQuery.of(context).viewInsets - : EdgeInsets.zero, + padding: moveAlongWithKeyboard ? MediaQuery.of(context).viewInsets : EdgeInsets.zero, child: Container( height: height, width: width, @@ -116,6 +115,7 @@ Widget _builder( showWorldWide: showWorldWide, showSearch: showSearch, customFlagBuilder: customFlagBuilder, + countryComparator: countryComparator, ), ), ], diff --git a/lib/src/country_list_view.dart b/lib/src/country_list_view.dart index 2752ce5..c99e1ef 100644 --- a/lib/src/country_list_view.dart +++ b/lib/src/country_list_view.dart @@ -48,6 +48,9 @@ class CountryListView extends StatefulWidget { /// Custom builder function for flag widget final CustomFlagBuilder? customFlagBuilder; + /// An optional argument for country comparator + final int Function(Country a, Country b)? countryComparator; + const CountryListView({ Key? key, required this.onSelect, @@ -60,6 +63,7 @@ class CountryListView extends StatefulWidget { this.showWorldWide = false, this.showSearch = true, this.customFlagBuilder, + this.countryComparator, }) : assert( exclude == null || countryFilter == null, 'Cannot provide both exclude and countryFilter', @@ -86,9 +90,10 @@ class _CountryListViewState extends State { _searchController = TextEditingController(); _countryList = _countryService.getAll(); - - _countryList = - countryCodes.map((country) => Country.from(json: country)).toList(); + if (widget.countryComparator != null) { + _countryList.sort(widget.countryComparator!); + } + _countryList = countryCodes.map((country) => Country.from(json: country)).toList(); //Remove duplicates country if not use phone code if (!widget.showPhoneCode) { @@ -141,9 +146,7 @@ class _CountryListViewState extends State { @override Widget build(BuildContext context) { - final String searchLabel = - CountryLocalizations.of(context)?.countryName(countryCode: 'search') ?? - 'Search'; + final String searchLabel = CountryLocalizations.of(context)?.countryName(countryCode: 'search') ?? 'Search'; return Column( children: [ @@ -152,8 +155,7 @@ class _CountryListViewState extends State { TextField( autofocus: _searchAutofocus, controller: _searchController, - style: - widget.countryListTheme?.searchTextStyle ?? _defaultTextStyle, + style: widget.countryListTheme?.searchTextStyle ?? _defaultTextStyle, decoration: widget.countryListTheme?.inputDecoration ?? InputDecoration( labelText: searchLabel, @@ -189,8 +191,7 @@ class _CountryListViewState extends State { } Widget _listRow(Country country) { - final TextStyle _textStyle = - widget.countryListTheme?.textStyle ?? _defaultTextStyle; + final TextStyle _textStyle = widget.countryListTheme?.textStyle ?? _defaultTextStyle; final bool isRtl = Directionality.of(context) == TextDirection.rtl; @@ -200,9 +201,7 @@ class _CountryListViewState extends State { color: Colors.transparent, child: InkWell( onTap: () { - country.nameLocalized = CountryLocalizations.of(context) - ?.countryName(countryCode: country.countryCode) - ?.replaceAll(RegExp(r"\s+"), " "); + country.nameLocalized = CountryLocalizations.of(context)?.countryName(countryCode: country.countryCode)?.replaceAll(RegExp(r"\s+"), " "); widget.onSelect(country); Navigator.pop(context); }, @@ -213,10 +212,7 @@ class _CountryListViewState extends State { Row( children: [ const SizedBox(width: 20), - if (widget.customFlagBuilder == null) - _flagWidget(country) - else - widget.customFlagBuilder!(country), + if (widget.customFlagBuilder == null) _flagWidget(country) else widget.customFlagBuilder!(country), if (widget.showPhoneCode && !country.iswWorldWide) ...[ const SizedBox(width: 15), SizedBox( @@ -233,10 +229,7 @@ class _CountryListViewState extends State { ), Expanded( child: Text( - CountryLocalizations.of(context) - ?.countryName(countryCode: country.countryCode) - ?.replaceAll(RegExp(r"\s+"), " ") ?? - country.name, + CountryLocalizations.of(context)?.countryName(countryCode: country.countryCode)?.replaceAll(RegExp(r"\s+"), " ") ?? country.name, style: _textStyle, ), ), @@ -257,9 +250,7 @@ class _CountryListViewState extends State { } Widget _emojiText(Country country) => Text( - country.iswWorldWide - ? '\uD83C\uDF0D' - : Utils.countryCodeToEmoji(country.countryCode), + country.iswWorldWide ? '\uD83C\uDF0D' : Utils.countryCodeToEmoji(country.countryCode), style: TextStyle( fontSize: widget.countryListTheme?.flagSize ?? 25, fontFamilyFallback: widget.countryListTheme?.emojiFontFamilyFallback, @@ -268,15 +259,12 @@ class _CountryListViewState extends State { void _filterSearchResults(String query) { List _searchResult = []; - final CountryLocalizations? localizations = - CountryLocalizations.of(context); + final CountryLocalizations? localizations = CountryLocalizations.of(context); if (query.isEmpty) { _searchResult.addAll(_countryList); } else { - _searchResult = _countryList - .where((c) => c.startsWith(query, localizations)) - .toList(); + _searchResult = _countryList.where((c) => c.startsWith(query, localizations)).toList(); } setState(() => _filteredList = _searchResult); From 871281d6f743ec5f72bb3b4da732ee6c91cc16b0 Mon Sep 17 00:00:00 2001 From: alexsandersarmento Date: Tue, 6 May 2025 13:40:06 -0300 Subject: [PATCH 2/4] Refactor country list initialization and localization handling in CountryListView --- lib/src/country_list_view.dart | 97 +++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 32 deletions(-) diff --git a/lib/src/country_list_view.dart b/lib/src/country_list_view.dart index c99e1ef..ab943c0 100644 --- a/lib/src/country_list_view.dart +++ b/lib/src/country_list_view.dart @@ -83,47 +83,81 @@ class _CountryListViewState extends State { late TextEditingController _searchController; late bool _searchAutofocus; bool _isSearching = false; + bool _dependenciesInitialized = false; // Flag to run didChangeDependencies logic once @override void initState() { super.initState(); _searchController = TextEditingController(); + _searchAutofocus = widget.searchAutofocus; - _countryList = _countryService.getAll(); - if (widget.countryComparator != null) { - _countryList.sort(widget.countryComparator!); - } - _countryList = countryCodes.map((country) => Country.from(json: country)).toList(); - - //Remove duplicates country if not use phone code - if (!widget.showPhoneCode) { - final ids = _countryList.map((e) => e.countryCode).toSet(); - _countryList.retainWhere((country) => ids.remove(country.countryCode)); - } - - if (widget.favorite != null) { - _favoriteList = _countryService.findCountriesByCode(widget.favorite!); - } - - if (widget.exclude != null) { - _countryList.removeWhere( - (element) => widget.exclude!.contains(element.countryCode), - ); - } + // Initial load of countries (without localized names yet) + _countryList = countryCodes.map((countryData) => Country.from(json: countryData)).toList(); + _filteredList = []; // Initialize to avoid late errors before didChangeDependencies + } - if (widget.countryFilter != null) { - _countryList.removeWhere( - (element) => !widget.countryFilter!.contains(element.countryCode), - ); + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + if (!_dependenciesInitialized) { + // Initialize localized names for all countries in the main list + for (final country in _countryList) { + country.initLocalizedName(context); + } + + // Initialize localized name for the static 'World Wide' instance if shown + if (widget.showWorldWide) { + Country.initWorldWideLocalizedName(context); + } + + // Sort the main list if a comparator is provided + // This is done after nameLocalized is initialized + if (widget.countryComparator != null) { + _countryList.sort(widget.countryComparator); + } + + if (!widget.showPhoneCode) { + final ids = _countryList.map((e) => e.countryCode).toSet(); + _countryList.retainWhere((country) => ids.remove(country.countryCode)); + } + + if (widget.exclude != null) { + _countryList.removeWhere( + (element) => widget.exclude!.contains(element.countryCode), + ); + } + + if (widget.countryFilter != null) { + _countryList.removeWhere( + (element) => !widget.countryFilter!.contains(element.countryCode), + ); + } + + // Initialize favorites list and their localized names + if (widget.favorite != null && widget.favorite!.isNotEmpty) { + // Assuming _countryService.findCountriesByCode fetches fresh instances + // or instances that might not have initLocalizedName called. + final List tempFavoriteList = _countryService.findCountriesByCode(widget.favorite!); + for (final favCountry in tempFavoriteList) { + favCountry.initLocalizedName(context); // Ensure localized name is set + } + _favoriteList = tempFavoriteList; + } + + // Build the initial _filteredList + _rebuildFilteredList(); + + _dependenciesInitialized = true; } + } - _filteredList = []; + void _rebuildFilteredList() { + _filteredList.clear(); if (widget.showWorldWide) { _filteredList.add(Country.worldWide); } _filteredList.addAll(_countryList); - - _searchAutofocus = widget.searchAutofocus; } @override @@ -175,8 +209,8 @@ class _CountryListViewState extends State { Expanded( child: ListView( children: [ - if (_favoriteList != null && !_isSearching) ...[ - ..._favoriteList!.map((currency) => _listRow(currency)), + if (_favoriteList != null && _favoriteList!.isNotEmpty && !_isSearching) ...[ + ..._favoriteList!.map((country) => _listRow(country)), const Padding( padding: EdgeInsets.symmetric(horizontal: 20.0), child: Divider(thickness: 1), @@ -201,7 +235,6 @@ class _CountryListViewState extends State { color: Colors.transparent, child: InkWell( onTap: () { - country.nameLocalized = CountryLocalizations.of(context)?.countryName(countryCode: country.countryCode)?.replaceAll(RegExp(r"\s+"), " "); widget.onSelect(country); Navigator.pop(context); }, @@ -229,7 +262,7 @@ class _CountryListViewState extends State { ), Expanded( child: Text( - CountryLocalizations.of(context)?.countryName(countryCode: country.countryCode)?.replaceAll(RegExp(r"\s+"), " ") ?? country.name, + country.nameLocalized, // Use the pre-initialized localized name style: _textStyle, ), ), From 730af465d79908e41d75afb3398e906090d9dafb Mon Sep 17 00:00:00 2001 From: alexsandersarmento Date: Tue, 6 May 2025 13:40:10 -0300 Subject: [PATCH 3/4] Refactor localized name handling in Country model and update startsWith method --- lib/src/country.dart | 46 +++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/lib/src/country.dart b/lib/src/country.dart index 6461a58..67a1a73 100644 --- a/lib/src/country.dart +++ b/lib/src/country.dart @@ -32,8 +32,8 @@ class Country { ///The country name in English final String name; - ///The country name localized - late String? nameLocalized; + ///The country name localized. It will be initialized after the Country object is created. + late String nameLocalized; ///An example of a telephone number without the phone code final String example; @@ -55,9 +55,15 @@ class Country { ) String get displayNameNoE164Cc => displayNameNoCountryCode; - String? getTranslatedName(BuildContext context) { - return CountryLocalizations.of(context) - ?.countryName(countryCode: countryCode); + /// Initializes the localized name for the country. + /// Uses the translated name if available, otherwise falls back to the English name. + void initLocalizedName(BuildContext context) { + nameLocalized = CountryLocalizations.of(context)?.countryName(countryCode: countryCode)?.replaceAll(RegExp(r"\s+"), " ") ?? name; + } + + /// Initializes the localized name for the 'World Wide' static instance. + static void initWorldWideLocalizedName(BuildContext context) { + worldWide.nameLocalized = CountryLocalizations.of(context)?.countryName(countryCode: worldWide.countryCode)?.replaceAll(RegExp(r"\s+"), " ") ?? worldWide.name; } Country({ @@ -67,7 +73,6 @@ class Country { required this.geographic, required this.level, required this.name, - this.nameLocalized = '', required this.example, required this.displayName, required this.displayNameNoCountryCode, @@ -112,6 +117,7 @@ class Country { data['geographic'] = geographic; data['level'] = level; data['name'] = name; + data['nameLocalized'] = nameLocalized; data['example'] = example; data['display_name'] = displayName; data['full_example_with_plus_sign'] = fullExampleWithPlusSign; @@ -120,41 +126,33 @@ class Country { return data; } - bool startsWith(String query, CountryLocalizations? localizations) { - String _query = query; - if (query.startsWith("+")) { - _query = query.replaceAll("+", "").trim(); + /// Checks if the country's properties (name, code, phone code, localized name) start with the query. + /// The [localizations] parameter is no longer used as [nameLocalized] is pre-initialized. + bool startsWith(String query, CountryLocalizations? localizations /* not used anymore */) { + String lowerCaseQuery = query.toLowerCase(); + if (lowerCaseQuery.startsWith("+")) { + lowerCaseQuery = lowerCaseQuery.replaceAll("+", "").trim(); } - return phoneCode.startsWith(_query.toLowerCase()) || - name.toLowerCase().startsWith(_query.toLowerCase()) || - countryCode.toLowerCase().startsWith(_query.toLowerCase()) || - (localizations - ?.countryName(countryCode: countryCode) - ?.toLowerCase() - .startsWith(_query.toLowerCase()) ?? - false); + if (lowerCaseQuery.isEmpty) return true; + + return phoneCode.startsWith(lowerCaseQuery) || name.toLowerCase().startsWith(lowerCaseQuery) || countryCode.toLowerCase().startsWith(lowerCaseQuery) || nameLocalized.toLowerCase().startsWith(lowerCaseQuery); } bool get iswWorldWide => countryCode == Country.worldWide.countryCode; @override - String toString() => 'Country(countryCode: $countryCode, name: $name)'; + String toString() => 'Country(countryCode: $countryCode, name: $name, nameLocalized: $nameLocalized)'; @override bool operator ==(Object other) { if (other is Country) { return other.countryCode == countryCode; } - return super == other; } @override int get hashCode => countryCode.hashCode; - /// provides country flag as emoji. - /// Can be displayed using - /// - ///```Text(country.flagEmoji)``` String get flagEmoji => Utils.countryCodeToEmoji(countryCode); } From 514bd9757832ae14126f4f5c8b068d9990459337 Mon Sep 17 00:00:00 2001 From: alexsandersarmento Date: Tue, 6 May 2025 13:40:14 -0300 Subject: [PATCH 4/4] Fix Portuguese localization errors in country names and update comments for clarity --- lib/src/res/strings/pt.dart | 84 ++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/lib/src/res/strings/pt.dart b/lib/src/res/strings/pt.dart index fd6bf41..76534d6 100644 --- a/lib/src/res/strings/pt.dart +++ b/lib/src/res/strings/pt.dart @@ -1,13 +1,13 @@ Map pt = { "AF": "Afeganistão", - "AX": "Ilhas Aland", + "AX": "Ilhas Åland", "AL": "Albânia", "DZ": "Argélia", "AS": "Samoa Americana", "AD": "Andorra", "AO": "Angola", - "AI": "Enguia", - "AG": "Antiga e barbuda", + "AI": "Anguila", + "AG": "Antígua e Barbuda", "AR": "Argentina", "AM": "Armênia", "AW": "Aruba", @@ -16,24 +16,24 @@ Map pt = { "AT": "Áustria", "AZ": "Azerbaijão", "BS": "Bahamas", - "BH": "Bahrain", + "BH": "Bahrein", "BD": "Bangladesh", "BB": "Barbados", "BY": "Belarus", "BE": "Bélgica", "BZ": "Belize", "BJ": "Benin", - "BM": "Ilhas Bermudas", + "BM": "Bermudas", "BT": "Butão", "BO": "Bolívia", "BA": "Bósnia e Herzegovina", - "BW": "Botswana", + "BW": "Botsuana", "BR": "Brasil", "IO": "Território Britânico do Oceano Índico", "VG": "Ilhas Virgens Britânicas", "BN": "Brunei", "BG": "Bulgária", - "BF": "Burkina faso", + "BF": "Burkina Faso", "BI": "Burundi", "KH": "Camboja", "CM": "Camarões", @@ -41,12 +41,12 @@ Map pt = { "CV": "Cabo Verde", "BQ": "Bonaire, Santo Eustáquio e Saba", "KY": "Ilhas Cayman", - "CF": "República Centro-Africano", + "CF": "República Centro-Africana", "TD": "Chade", - "CL": "Pimenta", + "CL": "Chile", "CN": "China", - "CX": "Ilha do Natal", - "CC": "Ilhas Cocos", + "CX": "Ilha Christmas", + "CC": "Ilhas Cocos (Keeling)", "CO": "Colômbia", "KM": "Comores", "CD": "República Democrática do Congo", @@ -56,17 +56,17 @@ Map pt = { "CI": "Costa do Marfim", "HR": "Croácia", "CU": "Cuba", - "CW": "Curaçao", + "CW": "Curaçau", "CY": "Chipre", - "CZ": "Republica Checa", + "CZ": "Chéquia", // ou República Tcheca (menos comum agora) "DK": "Dinamarca", "DJ": "Djibouti", "DM": "Dominica", "DO": "República Dominicana", - "TL": "Timor Leste", + "TL": "Timor-Leste", "EC": "Equador", "EG": "Egito", - "SV": "O salvador", + "SV": "El Salvador", "GQ": "Guiné Equatorial", "ER": "Eritreia", "EE": "Estônia", @@ -86,13 +86,13 @@ Map pt = { "GI": "Gibraltar", "GR": "Grécia", "GL": "Groenlândia", - "GD": "Grenade", + "GD": "Granada", "GP": "Guadalupe", "GU": "Guam", "GT": "Guatemala", "GG": "Guernsey", - "GN": "Guiné Conakry", - "GW": "Guiné Bissau", + "GN": "Guiné", // Geralmente refere-se a Guiné-Conacri + "GW": "Guiné-Bissau", "GY": "Guiana", "HT": "Haiti", "HM": "Ilhas Heard e McDonald", @@ -110,7 +110,7 @@ Map pt = { "IT": "Itália", "JM": "Jamaica", "JP": "Japão", - "JE": "Agasalho", + "JE": "Jersey", "JO": "Jordânia", "KZ": "Cazaquistão", "KE": "Quênia", @@ -128,28 +128,28 @@ Map pt = { "LT": "Lituânia", "LU": "Luxemburgo", "MO": "Macau", - "MK": "Macedônia", - "MG": "Madagáscar", + "MK": "Macedônia do Norte", // Nome atual + "MG": "Madagascar", "MW": "Malawi", "MY": "Malásia", "MV": "Maldivas", "ML": "Mali", - "MT": "Malte", + "MT": "Malta", "MH": "Ilhas Marshall", "MQ": "Martinica", "MR": "Mauritânia", - "MU": "Mauricio", + "MU": "Maurício", "YT": "Mayotte", "MX": "México", "FM": "Micronésia", - "MD": "Moldova", + "MD": "Moldávia", "MC": "Mônaco", "MN": "Mongólia", "ME": "Montenegro", "MS": "Montserrat", "MA": "Marrocos", "MZ": "Moçambique", - "MM": "Mianmar", + "MM": "Mianmar (Birmânia)", // Ambas as formas são usadas "NA": "Namíbia", "NR": "Nauru", "NP": "Nepal", @@ -161,15 +161,15 @@ Map pt = { "NG": "Nigéria", "NU": "Niue", "NF": "Ilha Norfolk", - "KP": "Coréia do Norte", + "KP": "Coreia do Norte", "MP": "Ilhas Marianas do Norte", "NO": "Noruega", "OM": "Omã", "PK": "Paquistão", "PW": "Palau", - "PS": "Territórios Palestinos", + "PS": "Palestina", // Territórios Palestinos ou Estado da Palestina "PA": "Panamá", - "PG": "Papua Nova Guiné", + "PG": "Papua-Nova Guiné", "PY": "Paraguai", "PE": "Peru", "PH": "Filipinas", @@ -181,29 +181,29 @@ Map pt = { "RO": "Romênia", "RU": "Rússia", "RW": "Ruanda", - "BL": "San Bartolome", - "SH": "Santa Helena", + "BL": "São Bartolomeu", + "SH": "Santa Helena, Ascensão e Tristão da Cunha", // Nome completo "KN": "São Cristóvão e Neves", "LC": "Santa Lúcia", - "MF": "São Martim", + "MF": "São Martinho (Parte Francesa)", "PM": "São Pedro e Miquelão", - "VC": "São Vicente", + "VC": "São Vicente e Granadinas", "WS": "Samoa", "SM": "San Marino", "ST": "São Tomé e Príncipe", "SA": "Arábia Saudita", "SN": "Senegal", "RS": "Sérvia", - "SC": "Seychelles", + "SC": "Seicheles", "SL": "Serra Leoa", - "SG": "Cingapura", - "SX": "Sint Maarten", + "SG": "Singapura", + "SX": "Sint Maarten (Parte Holandesa)", "SK": "Eslováquia", "SI": "Eslovênia", "SB": "Ilhas Salomão", "SO": "Somália", "ZA": "África do Sul", - "GS": "Geórgia do Sul e Ilhas Sandwich do Sul", + "GS": "Ilhas Geórgia do Sul e Sandwich do Sul", "KR": "Coreia do Sul", "SS": "Sudão do Sul", "ES": "Espanha", @@ -211,9 +211,9 @@ Map pt = { "SD": "Sudão", "SR": "Suriname", "SJ": "Svalbard e Jan Mayen", - "SZ": "Suazilândia", + "SZ": "Eswatini", // Novo nome (anteriormente Suazilândia) "SE": "Suécia", - "CH": "Suíço", + "CH": "Suíça", "SY": "Síria", "TW": "Taiwan", "TJ": "Tajiquistão", @@ -224,7 +224,7 @@ Map pt = { "TO": "Tonga", "TT": "Trinidad e Tobago", "TN": "Tunísia", - "TR": "Peru", + "TR": "Turquia", "TM": "Turcomenistão", "TC": "Ilhas Turcas e Caicos", "TV": "Tuvalu", @@ -241,10 +241,10 @@ Map pt = { "VE": "Venezuela", "VN": "Vietnã", "WF": "Wallis e Futuna", - "WW": "Mundo Todo", + "WW": "Mundo", // ou "Mundo Todo" "EH": "Saara Ocidental", - "YE": "Iémen", + "YE": "Iêmen", "ZM": "Zâmbia", "ZW": "Zimbábue", - "search": "Procurar", + "search": "Buscar", // ou "Pesquisar" };