Skip to content

Commit

Permalink
chore: l10n_countries v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tsinis committed Jan 24, 2025
1 parent 3a039ed commit 27125eb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
10 changes: 10 additions & 0 deletions packages/l10n_countries/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion packages/l10n_countries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/l10n_countries/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 1 addition & 4 deletions packages/l10n_countries/lib/l10n_countries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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<IsoLocaleMapper<String>> {
/// 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<String, IsoLocaleMapper<String>>? other}) {
Expand Down Expand Up @@ -447,7 +445,6 @@ class CountriesLocaleMapper extends IsoLocaleMapper<IsoLocaleMapper<String>> {
"ee": EeCountriesL10N(),
"el": ElCountriesL10N(),
"en": EnCountriesL10N(),
"en_DG": EnDgCountriesL10N(),
"eo": EoCountriesL10N(),
"es": EsCountriesL10N(),
"et": EtCountriesL10N(),
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions packages/l10n_countries/test/src/l10n_countries_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand Down

0 comments on commit 27125eb

Please sign in to comment.