From 27125eb686b5059d4de37baea7fda62bd412dbb0 Mon Sep 17 00:00:00 2001 From: Roman Cinis <52065414+tsinis@users.noreply.github.com> Date: Sat, 25 Jan 2025 00:17:06 +0100 Subject: [PATCH] chore: `l10n_countries` v1.0.0 --- packages/l10n_countries/CHANGELOG.md | 10 ++++++++++ packages/l10n_countries/README.md | 3 ++- packages/l10n_countries/example/lib/main.dart | 2 +- packages/l10n_countries/lib/l10n_countries.dart | 5 +---- .../lib/src/data/en_dg_countries_l10n.data.dart | 12 ------------ .../l10n_countries/test/src/l10n_countries_test.dart | 4 ++-- 6 files changed, 16 insertions(+), 20 deletions(-) delete mode 100644 packages/l10n_countries/lib/src/data/en_dg_countries_l10n.data.dart diff --git a/packages/l10n_countries/CHANGELOG.md b/packages/l10n_countries/CHANGELOG.md index 951a5a3f..b9ddd94c 100644 --- a/packages/l10n_countries/CHANGELOG.md +++ b/packages/l10n_countries/CHANGELOG.md @@ -1,3 +1,13 @@ +## 1.0.0 + +🎉 First stable release! + +DOCUMENTATION + +- Improved documentation and example. +- Removed duplicated localization. +- Fixed typos in the README. + ## 0.1.0 - Initial release. diff --git a/packages/l10n_countries/README.md b/packages/l10n_countries/README.md index c2779971..26617d75 100644 --- a/packages/l10n_countries/README.md +++ b/packages/l10n_countries/README.md @@ -43,7 +43,7 @@ void main() { final mapper = CountriesLocaleMapper(); /// Define some ISO codes to localize (e.g., `USA` for United States, - ///`RUS` for Russian Federation, and `POL` for Poland). + /// `RUS` for Russian Federation, and `POL` for Poland). final isoCodes = {"USA", "RUS", "POL"}; /// Localize the codes with an optional main locale (e.g., "sk" for Slovak), @@ -72,6 +72,7 @@ void main() { - **High code coverage**: The code in this package has 100% code coverage, providing confidence in its reliability and stability. - **Comprehensive documentation**: This package provides full documentation for every non-code generated public member, usually with examples, ensuring clarity and ease of use. - **Industry adopted**: This package is actively used in production by numerous European companies, ensuring its efficacy and robustness in real-world scenarios. +- **Lightweight**: This package keeps under 500 KB, ensuring it fits within the pub cache limit. This leads to quick, low-bandwidth downloads and faster caching, minimizing resource impact. - **MIT license**: This package and sources are released under the MIT license, which is a permissive license that allows users to use, modify, and distribute the code with minimal restrictions. The MIT license is considered better than most other open-source licenses because it provides flexibility and allows users to incorporate the code into their projects without worrying about legal implications. ### Additional information diff --git a/packages/l10n_countries/example/lib/main.dart b/packages/l10n_countries/example/lib/main.dart index 8be5af45..db40e203 100644 --- a/packages/l10n_countries/example/lib/main.dart +++ b/packages/l10n_countries/example/lib/main.dart @@ -7,7 +7,7 @@ void main() { final mapper = CountriesLocaleMapper(); /// Define some ISO codes to localize (e.g., `USA` for United States, - ///`RUS` for Russian Federation, and `POL` for Poland). + /// `RUS` for Russian Federation, and `POL` for Poland). final isoCodes = {"USA", "RUS", "POL"}; /// Localize the codes with an optional main locale (e.g., "sk" for Slovak), diff --git a/packages/l10n_countries/lib/l10n_countries.dart b/packages/l10n_countries/lib/l10n_countries.dart index 1a40a529..4a2af9f9 100644 --- a/packages/l10n_countries/lib/l10n_countries.dart +++ b/packages/l10n_countries/lib/l10n_countries.dart @@ -47,7 +47,6 @@ import "src/data/dz_countries_l10n.data.dart"; import "src/data/ee_countries_l10n.data.dart"; import "src/data/el_countries_l10n.data.dart"; import "src/data/en_countries_l10n.data.dart"; -import "src/data/en_dg_countries_l10n.data.dart"; import "src/data/eo_countries_l10n.data.dart"; import "src/data/es_countries_l10n.data.dart"; import "src/data/et_countries_l10n.data.dart"; @@ -243,7 +242,6 @@ export "src/data/dz_countries_l10n.data.dart"; export "src/data/ee_countries_l10n.data.dart"; export "src/data/el_countries_l10n.data.dart"; export "src/data/en_countries_l10n.data.dart"; -export "src/data/en_dg_countries_l10n.data.dart"; export "src/data/eo_countries_l10n.data.dart"; export "src/data/es_countries_l10n.data.dart"; export "src/data/et_countries_l10n.data.dart"; @@ -402,7 +400,7 @@ export "src/iso_locale_mapper.dart"; /// Provides country names translations for different locales. // ignore: prefer-match-file-name, it's main library file. class CountriesLocaleMapper extends IsoLocaleMapper> { - /// Provides names translations for 194 locales, with the option to + /// Provides names translations for 193 locales, with the option to /// add more translations via the [other] parameter. // ignore: avoid-non-empty-constructor-bodies,on purpose. CountriesLocaleMapper({Map>? other}) { @@ -447,7 +445,6 @@ class CountriesLocaleMapper extends IsoLocaleMapper> { "ee": EeCountriesL10N(), "el": ElCountriesL10N(), "en": EnCountriesL10N(), - "en_DG": EnDgCountriesL10N(), "eo": EoCountriesL10N(), "es": EsCountriesL10N(), "et": EtCountriesL10N(), diff --git a/packages/l10n_countries/lib/src/data/en_dg_countries_l10n.data.dart b/packages/l10n_countries/lib/src/data/en_dg_countries_l10n.data.dart deleted file mode 100644 index c541e55b..00000000 --- a/packages/l10n_countries/lib/src/data/en_dg_countries_l10n.data.dart +++ /dev/null @@ -1,12 +0,0 @@ -// ignore_for_file: avoid-unnecessary-collections -import "../iso_locale_mapper.dart"; - -/// Contains 1 translation(s). -/// Provides translations for the English language -/// and `DG` country/region code locale. -class EnDgCountriesL10N extends IsoLocaleMapper { - /// Provides country translations for the `en_DG` locale. - EnDgCountriesL10N() { - map.addAll({"UNK": "Kosovo"}); - } -} diff --git a/packages/l10n_countries/test/src/l10n_countries_test.dart b/packages/l10n_countries/test/src/l10n_countries_test.dart index 344c9fa1..861a88cc 100644 --- a/packages/l10n_countries/test/src/l10n_countries_test.dart +++ b/packages/l10n_countries/test/src/l10n_countries_test.dart @@ -14,14 +14,14 @@ void main() => group("$CountriesLocaleMapper", () { group("constructor", () { test("creates instance with default data", () { expect(mapper, isNotNull); - expect(mapper.map.length, 194); + expect(mapper.map.length, 193); }); test("allows adding custom translations", () { final customMapper = CountriesLocaleMapper( other: {"custom": AfCountriesL10N()}, ); - expect(customMapper.map.length, 195); + expect(customMapper.map.length, 194); expect(customMapper.map["custom"], isNotNull); }); });