Skip to content

Commit 1e00964

Browse files
committed
Fix merge conflicts
2 parents 2065d2c + 1f9f028 commit 1e00964

20 files changed

+195
-85
lines changed

.github/workflows/pr_check.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: PR Check
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
name: Test
10+
uses: ./.github/workflows/test.yml
11+
secrets: inherit

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release to pub.dev
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v[0-9]+.[0-9]+.[0-9]+*'
8+
9+
jobs:
10+
test:
11+
name: Test
12+
uses: ./.github/workflows/test.yml
13+
secrets: inherit
14+
15+
publish:
16+
needs: [test]
17+
name: Publish
18+
permissions:
19+
id-token: write # This is required for authentication using OIDC
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- uses: dart-lang/setup-dart@v1
27+
28+
- uses: subosito/flutter-action@v2
29+
with:
30+
channel: "stable"
31+
32+
- name: Install dependencies
33+
run: dart pub get
34+
35+
- name: code format
36+
run: dart format lib/*/*.dart lib/*.dart
37+
38+
- name: Publish
39+
run: dart pub publish --force

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-java@v1
13+
with:
14+
java-version: '12.x'
15+
- uses: subosito/flutter-action@v1
16+
with:
17+
channel: 'stable'
18+
19+
- name: Install packages dependencies
20+
run: flutter pub get
21+
22+
- name: Analyze the project's Dart code
23+
run: flutter analyze
24+
25+
- name: Run tests
26+
run: flutter test
27+
28+
- name: Run tests coverage
29+
run: flutter test --coverage

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*.ipr
1515
*.iws
1616
.idea/
17+
.vscode/
1718

1819
# The .vscode folder contains launch configuration and tasks you configure in
1920
# VS Code which you may wish to be included in version control, so this line

CHANGELOG.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
## [0.0.1]
1+
## 2.0.1
22

3-
- initial release
3+
- Extend delimiters for csv loader
4+
5+
## 2.0.0
6+
7+
- **BREAKING**: The local `AssetLoader` class deleted, now using the one from
8+
[easy_localization](https://pub.dev/documentation/easy_localization/latest/easy_localization/AssetLoader-class.html) itself.
9+
- **BREAKING**: Depends on [connectivity_plus](https://pub.dev/packages/connectivity_plus) ^4.0.0
10+
and [http](https://pub.dev/packages/http) ^1.0.0.
11+
- Const constructors in:
12+
- `FileAssetLoader`
13+
- `HttpAssetLoader`
14+
- `JsonAssetLoader`
15+
- `TestsAssetLoader`
16+
- `XmlAssetLoader`
17+
- `YamlAssetLoader`
18+
- Fixed deprecations
19+
20+
## 0.0.1
21+
22+
- Initial release.

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
## Release process
4+
5+
1. Make sure that the changelog is updated
6+
7+
2. Make sure that the version in pubspec.yaml is correct
8+
9+
3. Create a release in the github UI. Name the release like the version, but with a v (3.7.5 -> v3.7.5). Name the tag like the release
10+
11+
4. A pipeline will run and deploy the new version to pub.dev

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies:
4040

4141
```
4242

43-
2. Change assetLoader and patch
43+
2. Change assetLoader and path
4444

4545
```dart
4646
...void main(){
@@ -54,4 +54,20 @@ assetLoader: CsvAssetLoader()
5454
...
5555
```
5656

57-
3. All done!.
57+
3. All done!.
58+
59+
60+
### Loaders Specification
61+
62+
#### HttpAssetLoader
63+
64+
In order to use HttpAssetLoader you must provide a path to a folder (i.e. base path) where all your translations are placed like `https://example.com/translations`
65+
66+
Your translations should be created as separate files with `.json` extension. Placing translations as individual files reduces the size of the file to load on application init.
67+
Example:
68+
69+
```
70+
translations/
71+
├── en-US.json
72+
└── uk-UA.json
73+
```

lib/easy_localization_loader.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
library easy_localization_loader;
2-
1+
export 'package:easy_localization_loader/src/csv_asset_loader.dart';
32
export 'package:easy_localization_loader/src/file_asset_loader.dart';
4-
export 'package:easy_localization_loader/src/arb_asset_loader.dart';
5-
export 'package:easy_localization_loader/src/json_asset_loader.dart';
63
export 'package:easy_localization_loader/src/http_asset_loader.dart';
7-
export 'package:easy_localization_loader/src/csv_asset_loader.dart';
8-
export 'package:easy_localization_loader/src/yaml_asset_loader.dart';
9-
export 'package:easy_localization_loader/src/xml_asset_loader.dart';
10-
export 'package:easy_localization_loader/src/tests_asset_loader.dart';
4+
export 'package:easy_localization_loader/src/json_asset_loader.dart';
115
export 'package:easy_localization_loader/src/smart_network_asset_loader.dart';
6+
export 'package:easy_localization_loader/src/tests_asset_loader.dart';
7+
export 'package:easy_localization_loader/src/xml_asset_loader.dart';
8+
export 'package:easy_localization_loader/src/yaml_asset_loader.dart';
9+
export 'package:easy_localization_loader/src/arb_asset_loader.dart';

lib/src/arb_asset_loader.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ import 'dart:ui';
44

55
import 'package:flutter/services.dart';
66

7-
import 'asset_loader.dart';
7+
import 'package:easy_localization/easy_localization.dart';
88

99
class ArbAssetLoader extends AssetLoader {
10+
const ArbAssetLoader();
11+
1012
String getLocalePath(String basePath, Locale locale) {
11-
return '$basePath/${localeToString(locale, separator: "-")}.arb';
13+
return '$basePath/${locale.toStringWithSeparator(separator: "-")}.arb';
1214
}
1315

1416
@override
1517
Future<Map<String, dynamic>> load(String path, Locale locale) async {
1618
var localePath = getLocalePath(path, locale);
1719
log('easy localization loader: load arb file $localePath');
18-
1920
return jsonDecode(await rootBundle.loadString(localePath));
2021
}
2122
}
@@ -32,7 +33,6 @@ class ArbSingleAssetLoader extends AssetLoader {
3233
} else {
3334
log('easy localization loader: arb already loaded, read cache');
3435
}
35-
3636
return jsonData![locale.toString()];
3737
}
3838
}

lib/src/asset_loader.dart

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)