Skip to content

Commit

Permalink
chore: l10n_languages v1.0.0 (#286)
Browse files Browse the repository at this point in the history
* feat: update `l10n_languages` package to version 1.0.0

* ci!: removed obsolete publish files and fix backup

* docs: release v1 with improved docs and fixed typos

* chore: move changelog entries for v1.0.0

* refactor: address @coderabbitai code review comments

* ci: update tag pattern for package publishing workflow
  • Loading branch information
tsinis authored Jan 24, 2025
1 parent 66f4713 commit 3036fb5
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
mirror-to-gitlab:
name: 💾 Backup to GitLab
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: 📚 Git checkout
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/publish_packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: publish_packages

on:
push:
branches: [main]
tags:
- "[a-z]+_[a-z]+-v[0-9].[0-9].[0-9]"

jobs:
publish:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Extract package name from the tag
id: extract
run: |
TAG="${GITHUB_REF#refs/tags/}"
PACKAGE_NAME="${TAG%%-v*}"
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Call shared publish workflow
uses: ./.github/workflows/publish_to_pub_workflow.yaml
with:
package_name: ${{ steps.extract.outputs.package_name }}
tag: ${{ github.ref }}
17 changes: 0 additions & 17 deletions .github/workflows/publish_sealed_countries.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/publish_sealed_currencies.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/publish_sealed_languages.yaml

This file was deleted.

File renamed without changes.
17 changes: 0 additions & 17 deletions .github/workflows/publish_world_countries.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/publish_world_flags.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/verify_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
detect-packages:
name: 🔍 Detect Changed Packages
runs-on: ubuntu-latest
timeout-minutes: 25
timeout-minutes: 15
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
steps:
Expand All @@ -37,7 +37,7 @@ jobs:
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
verify-packages:
name: 🛃 Verify ${{ matrix.package }}
name: Verify ${{ matrix.package }}
needs: detect-packages
if: fromJson(needs.detect-packages.outputs.packages)[0] != null
strategy:
Expand Down
9 changes: 9 additions & 0 deletions packages/l10n_languages/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.0.0

🎉 First stable release!

DOCUMENTATION

- Improved documentation and example.
- Fixed typos in the README.

## 0.1.0

- Initial release.
6 changes: 4 additions & 2 deletions packages/l10n_languages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
[![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Pub package](https://img.shields.io/pub/v/l10n_languages.svg)](https://pub.dev/packages/l10n_languages)

This ISO-driven, pure Dart, fully tested and dependency-free package provides translations for language names in `157` different locales. For Flutter ready widgets (like language picker) please use [world_countries](https://pub.dev/packages/world_countries) package. For Dart-only use - it's reccomended to use together with [sealed_languages](https://pub.dev/packages/sealed_languages) package.
This ISO-driven, pure Dart, fully tested and dependency-free package provides translations for language names in `157` different locales. For Flutter ready widgets (like language picker) please use [world_countries](https://pub.dev/packages/world_countries) package. For Dart-only use - it's recommended to use together with [sealed_languages](https://pub.dev/packages/sealed_languages) package.

### Features

- 157 locales supported out of the box.
- Three-letter ISO 639-2/T Terminological code lookup.
- Fallback locale support.
- Allows injecting custom translations to extend/modify existing ones.
- Alternative names support.

### Getting started
Expand Down Expand Up @@ -43,7 +44,7 @@ void main() {
final mapper = LanguagesLocaleMapper();
/// Define some ISO codes to localize (e.g., `ENG` for English,
///`RUS` for Russian, etc.).
/// `RUS` for Russian, etc.).
final isoCodes = {"ENG", "RUS", "POL"};
/// Localize the codes with an optional main locale (e.g., "sk" for Slovak),
Expand Down Expand Up @@ -72,6 +73,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_languages/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void main() {
final mapper = LanguagesLocaleMapper();

/// Define some ISO codes to localize (e.g., `ENG` for English,
///`RUS` for Russian, etc.).
/// `RUS` for Russian, etc.).
final isoCodes = {"ENG", "RUS", "POL"};

/// Localize the codes with an optional main locale (e.g., "sk" for Slovak),
Expand Down
2 changes: 1 addition & 1 deletion packages/l10n_languages/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.1.0
version: 1.0.0
name: l10n_languages
description: Provides language names translations (for 157 different locales).
maintainer: Roman Cinis
Expand Down

0 comments on commit 3036fb5

Please sign in to comment.