Skip to content

Commit

Permalink
Undo the breaking change of file names (aissat#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyinkin committed Jun 27, 2023
1 parent b24e85c commit 93f83d9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

- **BREAKING**: The local `AssetLoader` class deleted, now using the one from
[easy_localization](https://pub.dev/documentation/easy_localization/latest/easy_localization/AssetLoader-class.html) itself.
- **BREAKING**: `JsonAssetLoader`, `XmlAssetLoader`, and `YamlAssetLoader` now use `_` instead of `-` when converting a locale to a file name.
- **BREAKING**: Depends on [connectivity_plus](https://pub.dev/packages/connectivity_plus) ^4.0.0
and [http](https://pub.dev/packages/http) ^1.0.0.
- Const constructors in:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/json_asset_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class JsonAssetLoader extends AssetLoader {
const JsonAssetLoader();

String getLocalePath(String basePath, Locale locale) {
return '$basePath/$locale.json';
return '$basePath/${locale.toStringWithSeparator(separator: "-")}.json';
}

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/xml_asset_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class XmlAssetLoader extends AssetLoader {
const XmlAssetLoader();

String getLocalePath(String basePath, Locale locale) {
return '$basePath/$locale.xml';
return '$basePath/${locale.toStringWithSeparator(separator: "-")}.xml';
}

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/yaml_asset_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class YamlAssetLoader extends AssetLoader {
const YamlAssetLoader();

String getLocalePath(String basePath, Locale locale) {
return '$basePath/$locale.yaml';
return '$basePath/${locale.toStringWithSeparator(separator: "-")}.yaml';
}

@override
Expand Down

0 comments on commit 93f83d9

Please sign in to comment.