Skip to content
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4ce6054
feat(v4): update example app
aissat Sep 10, 2023
bba4524
refactoring `AssetLoader` and `RootBundleAssetLoader`
aissat Sep 25, 2023
a784051
feat: create easy_localization_storage_interface.dart
aissat Sep 25, 2023
7d30d13
update easy_localization_app.dart
aissat Sep 25, 2023
cb289d1
add export storage interface
aissat Sep 25, 2023
e8a7c54
update `AssetLoader` docs
aissat Sep 25, 2023
4af688a
refactoring `EasyLocalizationController` update `initEasyLocation` su…
aissat Sep 25, 2023
e982c5a
update generate.dart
aissat Sep 25, 2023
28de687
chore: update pubspec.yaml
aissat Sep 25, 2023
ea585d1
chore: create ar.json, ar.json and en.json
aissat Sep 25, 2023
b5a12c3
feat(test) :update test
aissat Sep 25, 2023
718f3b4
Add caching support to RootBundleAssetLoader
aissat Jun 9, 2026
03df779
Refactor localization controller and improve translation loading
aissat Jun 9, 2026
e989afb
Update dependencies and SDK syntax
aissat Jun 9, 2026
ada9d32
Add performance benchmarking and feedback to locale switch
aissat Jun 9, 2026
b509d2d
Improve translation loading and cache safety
aissat Jun 9, 2026
43e0d0a
Refactor asset loader tests and improve controller initialization
aissat Jun 9, 2026
3c225c4
Make storage interface methods asynchronous
aissat Jun 9, 2026
a02b3e6
Update documentation and API for pluggable storage
aissat Jun 9, 2026
d7e7682
Add compatibility extension for v3 migration
aissat Jun 9, 2026
5e4717e
Add null check to asset loader and add compatibility tests
aissat Jun 9, 2026
2fa3145
Update widget tests for localization configuration
aissat Jun 9, 2026
ed6453f
Update changelog for 4.0.0-dev release
aissat Jun 9, 2026
3d9fd0a
Fix formatting and clean up metadata in CHANGELOG and pubspec
aissat Jun 9, 2026
35ef12a
Add .pubignore file to exclude unnecessary files
aissat Jun 9, 2026
2445fac
fix: untrack .iml .metadata, unignore project.pbxproj from gitignore
aissat Jun 9, 2026
6ee83c0
Remove ephemeral Flutter iOS configuration files
aissat Jun 9, 2026
b7d6ed7
Remove localization-kit from topics in pubspec.yaml
aissat Jun 9, 2026
416935f
Refactor asset loading and storage initialization
aissat Jun 9, 2026
3803012
Fix asset loader tests
aissat Jun 9, 2026
138dea3
Update SDK constraint to support older versions
aissat Jun 9, 2026
17dbe70
Update device locale detection to use PlatformDispatcher
aissat Jun 9, 2026
feefc72
Update version to 4.0.0-dev and document breaking changes
aissat Jun 9, 2026
d2da41b
Add library documentation and refine exports
aissat Jun 9, 2026
35322af
Add pure resolver functions for translation data
aissat Jun 13, 2026
d94ba7c
Add unit tests for resolver functions
aissat Jun 13, 2026
255088e
Clean up test files
aissat Jun 13, 2026
1e59e00
Update SDK constraints and add matcher dependency
aissat Jun 13, 2026
389130b
Fix empty string handling in capitalize and remove unused dependency
aissat Jun 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
Comment on lines +4 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Workflow won’t run for develop-targeted PRs.

This workflow only listens to main/master, but this PR targets develop; tests won’t execute on that integration path unless develop is added.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/playwright.yml around lines 4 - 6, The workflow currently
only triggers on branches: [ main, master ] for both push and pull_request, so
PRs targeting develop won’t run; update the branch filters in the Playwright
workflow by adding "develop" to both branches arrays (the branches lists used
for the push and pull_request triggers) so the workflow will run for pushes and
PRs against develop as well.

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Disable persisted checkout credentials for this read-only test job.

Set persist-credentials: false on actions/checkout; this job does not need repo write credentials and reducing token exposure hardens the pipeline.

🧰 Tools
🪛 zizmor (1.25.2)

[warning] 12-12: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/playwright.yml at line 12, Update the Playwright
workflow's checkout step to disable persisted credentials by adding
persist-credentials: false to the actions/checkout@v4 invocation; locate the
existing uses: actions/checkout@v4 step in the workflow and add the
persist-credentials: false key under that step so the job does not retain repo
write credentials.

Source: Linters/SAST tools

- uses: actions/setup-node@v4
Comment on lines +12 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pin GitHub Actions to commit SHAs instead of floating tags.

Using @v4 leaves the workflow open to upstream tag retargeting/supply-chain risk and violates the reported policy check.

Also applies to: 22-22

🧰 Tools
🪛 zizmor (1.25.2)

[warning] 12-12: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 13-13: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/playwright.yml around lines 12 - 13, The workflow uses
floating tags for actions (uses: actions/checkout@v4 and uses:
actions/setup-node@v4) which must be pinned to commit SHAs; update those two
uses entries to reference the exact commit SHAs from the respective GitHub repos
(e.g., actions/checkout@<commit-sha> and actions/setup-node@<commit-sha>) by
looking up the desired release commit in each action's repo and replacing the
`@v4` tags with the corresponding SHAs so the workflow no longer relies on
retargetable tags.

Source: Linters/SAST tools

with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,5 @@ coverage/lcov.info
pubspec.lock
.idea/codeStyles/Project.xml

example/ios/Runner.xcodeproj/project.pbxproj

# Allow
!/bin/
91 changes: 55 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

### [4.0.0-dev]

- **BREAKING**: Moved `path` and `supportedLocales` into `AssetLoader` instead of `EasyLocalization` widget
- **BREAKING**: `AssetLoader.load()` signature changed from `load(String path, Locale locale)` to `load({Locale? locale})`
- **BREAKING**: `ensureInitialized()` now takes `assetLoader` and optional `storage` instead of no params
- **BREAKING**: Removed `useFallbackTranslationsForEmptyResources` (v4 always falls back for empty keys; use `useFallbackTranslations` to control the behavior at the feature level)
- **BREAKING**: Removed `ignorePluralRules` (plural rules are now always applied; override by returning a single form in your translations if needed)
- **BREAKING**: Removed `extraAssetLoaders` (compose multiple sources in a custom `AssetLoader` instead)
- Added `IEasyLocalizationStorage` interface with `SharedPreferencesStorage` and `InMemoryStorage` implementations
- Added `CachedAssetLoader` and `OptimizedAssetLoader` with built-in caching
- Fixed fallback translations bug: base-locale `null` entries no longer overwrite real fallback values
- Fixed `useOnlyLangCode` with country-code locales (static `_locale` race condition)
- Fixed `ListTile` ink-splash warnings in example app
- Added `EasyLocalizationCompat` extension with `withConfig()` and `migrateAssetLoader()` helpers for v3→v4 migration
- Updated README and example for v4 API

Comment thread
coderabbitai[bot] marked this conversation as resolved.
### [3.0.3]

- replace log() with stdout.writeln()
Expand Down Expand Up @@ -60,6 +76,7 @@
```dart
context.locale = locale;
```

:information_source: No breaking changes, you can use old the static method `EasyLocalization.of(context)`

### [2.2.2]
Expand All @@ -85,6 +102,7 @@ context.locale = locale;
```

- Added support Custom assets loaders [Easy Localization Loader](https://github.com/aissat/easy_localization_loader).

- Added support CSV files.

```dart
Expand Down Expand Up @@ -134,7 +152,7 @@ context.locale = locale;

```json
{
"msg_named": "{} مكتوبة باللغة {lang}",
"msg_named": "{} مكتوبة باللغة {lang}"
}
```

Expand All @@ -153,7 +171,7 @@ context.locale = locale;
```

- generate the json Loader in a dart class

```cmd
flutter pub run easy_localization:generate
```
Expand Down Expand Up @@ -198,7 +216,7 @@ this version came with many updates, here are the main ones:
- Hiding `EasyLocalizationProvider`
- refactor and update approach localization for more details see [example:](https://github.com/aissat/easy_localization/tree/master/example)

``` dart
```dart
// Now V2.0.0
runApp(EasyLocalization(
child: MyApp(),
Expand All @@ -221,18 +239,18 @@ this version came with many updates, here are the main ones:

- added Support for context

``` dart
tr("key", context: context),
plural("key", 1 , context: context),
```
```dart
tr("key", context: context),
plural("key", 1 , context: context),
```

## [1.4.1]

- optimized and clean code
- fixed many issues
- added extension for Strings

``` dart
```dart
// after 1.4.1
Text('title'.tr()),
Text('switch'.tr( gender: _gender ? "female" : "male")),
Expand All @@ -243,14 +261,14 @@ this version came with many updates, here are the main ones:

- refactor code changed call ~~`AppLocalizations.of(context).tr()`~~ ~~`AppLocalizations.of(context).plural()`~~ to `tr()` and `plural()`

``` dart
```dart
// after 1.4.0
Text(
tr('switch', gender: _gender ? "female" : "male"),
),
```

``` dart
```dart
// before 1.4.0
Text(
AppLocalizations.of(context).tr('switch', gender: _gender ? "female" : "male"),
Expand All @@ -259,75 +277,77 @@ this version came with many updates, here are the main ones:

- added Flutter extension for Text widget

``` dart
```dart
// after 1.4.0
Text('switch').tr( gender: _gender ? "female" : "male"),
Text('counter').plural(counter),
```

## [1.3.5]

- merge `gender()` and `tr()` .
- merge `gender()` and `tr()` .

``` json
```json
{
"gender":{
"gender": {
"male": "Hi man ;)",
"female": "Hello girl :)"
}
}
```

``` dart
```dart
new Text(
AppLocalizations.of(context).tr('switch', gender: _gender ? "female" : "male"),
),
```

- use parameters `args` for gender.
``` json

```json
{
"gender":{
"gender": {
"male": "Hi man ;) {}",
"female": "Hello girl :) {}"
}
}
```

``` dart
```dart
new Text(
AppLocalizations.of(context).tr('switch', args:["Naama"] gender: _gender ? "female" : "male"),
),
```

## [1.3.4]

- adeed Gender [female,male] `gender()` .
- adeed Gender [female,male] `gender()` .

``` json
```json
{
"gender":{
"gender": {
"male": "Hi man ;)",
"female": "Hello girl :)"
}
}
```

``` dart
```dart
new Text(
AppLocalizations.of(context).gender('switch', _gender ? "female" : "male"),
),
`
```

## [1.3.3+1]

- updated `plural()` thanks [shushper](https://github.com/shushper) .
- updated `plural()` thanks [shushper](https://github.com/shushper) .

``` json
```json
{
"text": {
"day": {
"zero":"{} дней",
"zero": "{} дней",
"one": "{} день",
"two": "{} дня",
"few": "{} дня",
Expand All @@ -340,28 +360,27 @@ this version came with many updates, here are the main ones:

## [1.3.3]

- removed `data.savedLocale` .
- removed `data.savedLocale` .
- optimized and clean code
- fixed many issues

## [1.3.2]

- `plural()` added property resolver for nested key translations

``` json
```json
{
"text": {
"day": {
"zero": "day",
"one": "day",
"other": "days"
"text": {
"day": {
"zero": "day",
"one": "day",
"other": "days"
}
}
}

```

``` dart
```dart
new Text(
AppLocalizations.of(context).plural("text.day", 2),
),
Expand All @@ -388,7 +407,7 @@ this version came with many updates, here are the main ones:
- Added property resolver for nested key translations
- return translate key if the element or path not exist

``` json
```json
{
"title": "Hello",
"msg": "Hello {} in the {} world ",
Expand Down
Loading