Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ilteoood:master #1

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bbbbf2a
update pubs
pnghai Jul 5, 2023
56d33da
Merge pull request #208 from pnghai/master
ilteoood Jul 5, 2023
dcbbc27
chore: prepare for new release
ilteoood Jul 5, 2023
4bbb2cc
chore: migrate actions
ilteoood Jul 5, 2023
82b87ce
docs: update readme about where to set localizationDelegates property
pumano Aug 13, 2023
42a4da3
Merge pull request #209 from pumano/feat/update-docs-about-where-lang…
ilteoood Aug 13, 2023
535cf30
chore: deps
ilteoood Aug 15, 2023
a134a55
fix: deprecation warning
ilteoood Aug 15, 2023
21daae1
chore: deps upgrade
ilteoood Dec 29, 2023
5ede131
fix: widget deprecated fields
ilteoood Dec 29, 2023
3f4504f
fix: changelog
ilteoood Dec 29, 2023
67cde8f
fix: intl version
ilteoood Feb 9, 2024
6927fa5
fix: #223
ilteoood Jun 11, 2024
cc2060d
chore: prepare for 0.36.0
ilteoood Jun 11, 2024
fab173a
chore: deps
ilteoood Jun 11, 2024
0a7cb63
fix: devices
ilteoood Jun 11, 2024
bf6c504
fix: drive
ilteoood Jun 11, 2024
39066a6
Merge pull request #224 from ilteoood/fix/223
ilteoood Jun 11, 2024
828432a
chore: make example work again
ilteoood Jul 6, 2024
0f608d0
fix: test
ilteoood Jul 6, 2024
d3047df
Merge pull request #225 from ilteoood/chore/make-example-work-again
ilteoood Jul 6, 2024
ab0efef
fix: 222
ilteoood Jul 6, 2024
cdb77e4
fix: changelog
ilteoood Jul 6, 2024
4769437
fix: prepare for 0.36.1
ilteoood Jul 6, 2024
61dc1b5
Merge pull request #226 from ilteoood/fix/222
ilteoood Jul 6, 2024
8adf53b
fix: enable network client
ilteoood Jul 10, 2024
99d613b
perf: improve network file translation loader
ilteoood Jul 10, 2024
ff55e8b
feat: extract defineLocale function
ilteoood Jul 10, 2024
1d391d5
fix: avoid double call
ilteoood Jul 10, 2024
0cc58e9
fix: make fallbackfile nullable
ilteoood Jul 10, 2024
c664c57
feat: strict types
ilteoood Jul 10, 2024
c288d44
fix: define locale
ilteoood Jul 10, 2024
d0bd062
fix: _loadTranslation
ilteoood Jul 10, 2024
312c950
chore: test for fallback skip
ilteoood Jul 10, 2024
a32db41
Merge pull request #227 from ilteoood/perf/avoid-double-call
ilteoood Jul 10, 2024
8b8ce4a
chore: prepare for v0.36.2
ilteoood Jul 10, 2024
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
11 changes: 8 additions & 3 deletions .github/workflows/flutter-drive-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@ name: Flutter drive Android
on: push
jobs:
drive_android:
runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [21, 29, 31]
target: [default]
fail-fast: true
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run Flutter Driver basic tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/flutter-drive-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ jobs:
strategy:
matrix:
device:
- "iPhone 8"
- "iPhone 11 Pro Max"
- "iPhone 13 Pro Max"
- "iPhone 15"
- "iPhone 15 Plus"
- "iPhone 15 Pro"
- "iPhone 15 Pro Max"
fail-fast: true
runs-on: macos-latest
steps:
- uses: futureware-tech/simulator-action@v2
with:
model: ${{ matrix.device }}
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Run Flutter Driver tests
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Publish
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
- uses: subosito/flutter-action@v2
with:
credential: ${{ secrets.PUB_CREDENTIALS }}
channel: 'stable'
- run: flutter pub get
- run: flutter test
- run: flutter pub publish
8 changes: 4 additions & 4 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Testing
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
- uses: subosito/flutter-action@v2
with:
credential: ${{ secrets.PUB_CREDENTIALS }}
dry_run: true
channel: 'stable'
- run: flutter pub get
- run: flutter test
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,25 @@ Dependencies upgrade

## [0.33.0]
Support for Dart 3 and Flutter 3.10
Fix for #204
Fix for #204

## [0.34.0]
Upgrade http@1.1.0, logging@1.2.0, xml2json@6.2.0, yaml@3.1.2, path@1.8.3
Fix: deprecation warnings

## [0.35.0]
Upgrade intl@0.18.1, xml2json@6.2.2, toml@0.15.0, http@1.1.2
Fix: deprecation warnings

## [0.35.1]
Change intl version to '>=0.17.0-0 <=0.19.0'

## [0.36.0]
Ability to define custom separator

## [0.36.1]
Fix for #222

## [0.36.2]
Fix for #185
Fix for #216
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,14 @@ For example if your translation files located at
`https://example.com/static/en.json` you should configure as follows:

```dart
localizationsDelegates: [
MaterialApp(
localizationsDelegates: [
FlutterI18nDelegate(translationLoader:
NetworkFileTranslationLoader(baseUri: Uri.https("example.com", "static")),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
],
)
```

### `NamespaceFileTranslationLoader` configuration
Expand All @@ -164,12 +166,14 @@ For example `FileTranslationLoader` format:
Example configuration:

```dart
localizationsDelegates: [
MaterialApp(
localizationsDelegates: [
FlutterI18nDelegate(translationLoader:
NamespaceFileTranslationLoader(namespaces: ["home_screen", "about_screen"]),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
],
)
```

Below you can find the name and description of the accepted parameters.
Expand Down
5 changes: 1 addition & 4 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
Expand All @@ -26,14 +27,10 @@
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

Expand Down
39 changes: 37 additions & 2 deletions example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,42 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 60bd88df915880d23877bfc1602e8ddcf4c4dd2a
channel: stable
revision: "7482962148e8d758338d8a28f589f317e1e42ba4"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: android
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: ios
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: linux
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: macos
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: web
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: windows
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
12 changes: 6 additions & 6 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# flutter_i18n_example
# example

Demonstrates how to use the flutter_i18n plugin.
A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
28 changes: 28 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
2 changes: 2 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
40 changes: 24 additions & 16 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,22 +22,31 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
namespace "com.example.example"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.flutter_i18n_example"
minSdkVersion 16
targetSdkVersion 30
applicationId "com.example.example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -54,6 +64,4 @@ flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
dependencies {}
6 changes: 3 additions & 3 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_i18n_example">
<!-- Flutter needs it to communicate with the running application
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
29 changes: 16 additions & 13 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_i18n_example">
<application
android:label="flutter_i18n_example"
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand All @@ -18,15 +19,6 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -38,4 +30,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
Loading