Skip to content

Commit 37071e6

Browse files
committed
Support custom overwrite
Support run on demand Optimize windows ipc Optimize windows arm64 Optimize build Optimize some details Update core
1 parent 672eacc commit 37071e6

377 files changed

Lines changed: 36315 additions & 8643 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/i18n.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Scan `lib/` for hardcoded Chinese strings and internationalize them following the project's ARB conventions.
2+
3+
## Instructions
4+
5+
You are performing i18n extraction for a Flutter project that uses the Flutter Intl plugin with ARB files.
6+
7+
### Project localization context
8+
9+
- **ARB files**: `arb/intl_en.arb`, `arb/intl_zh_CN.arb`, `arb/intl_ja.arb`, `arb/intl_ru.arb`
10+
- **Key conventions**: camelCase, flat keys (no nesting, no `@` metadata), semantic naming
11+
- Short labels: `rule`, `global`, `direct`, `edit`, `confirm`
12+
- Descriptive suffix `Desc`: `themeDesc`, `tunDesc`, `logsDesc`
13+
- Validation suffix: `profileNameNullValidationDesc`
14+
- **Generated code**: `lib/l10n/l10n.dart` (DO NOT edit generated files)
15+
- **Access patterns**:
16+
- In widgets with BuildContext: `context.appLocalizations.key` (import `common.dart`)
17+
- In controllers/providers/non-widget code: `currentAppLocalizations.key` (import `app_localizations.dart`)
18+
19+
### Step 1: Find hardcoded Chinese strings
20+
21+
Use Grep to search `lib/` for Chinese characters. The regex pattern for Chinese characters is `[\x{4e00}-\x{9fff}]`.
22+
23+
Important filters:
24+
- **Exclude** `lib/l10n/` (generated localization files)
25+
- **Exclude** lines that already use `appLocalizations` or `currentAppLocalizations`
26+
- **Exclude** false positives that are NOT Chinese text:
27+
- Arrow symbols: `` `` `` `` (Unicode arrows, not CJK)
28+
- Middle dot: `·` (U+00B7, not CJK)
29+
- Command symbol: `` (U+2318, not CJK)
30+
- Other CJK punctuation that is used as UI symbols, not translatable text
31+
32+
For each match, read the surrounding context (5-10 lines) to understand:
33+
- What the string represents (label, error message, tooltip, dialog text, etc.)
34+
- Whether it's inside a widget (has `BuildContext` available) or non-widget code
35+
- Whether it appears in a `Text()`, `TextSpan()`, `title:`, `label:`, or other text position
36+
37+
### Step 2: Generate ARB keys
38+
39+
For each hardcoded Chinese string:
40+
41+
1. **Choose a key name** following project conventions:
42+
- Use the Chinese meaning to derive an English camelCase key
43+
- Keep it concise: `createConfig` not `createAConfigurationForTheProfile`
44+
- Use `Desc` suffix for descriptive/explanatory text
45+
- Use existing similar keys as reference (check `arb/intl_en.arb` for patterns)
46+
47+
2. **Determine the English translation** (the value for `intl_en.arb`)
48+
49+
3. **Determine the Chinese translation** (the value for `intl_zh_CN.arb`) — this is the original hardcoded string
50+
51+
4. **For ja and ru**: use the English translation as a placeholder (translators will fill these in later)
52+
53+
### Step 3: Update ARB files
54+
55+
For each new key, add it to all 4 ARB files. Read each ARB file first to find the right insertion point (alphabetical order is not required, but appending near the end is clean).
56+
57+
Format: add a new line like `"keyName": "value",` before the closing `}`.
58+
59+
### Step 4: Replace hardcoded strings in Dart files
60+
61+
Replace each hardcoded Chinese string with the appropriate localization call:
62+
63+
- If inside a widget BuildContext: `context.appLocalizations.keyName`
64+
- If in controller/provider code: `currentAppLocalizations.keyName`
65+
66+
Ensure the correct import exists:
67+
- For `context.appLocalizations`: the file should import `common.dart` (check if it already does)
68+
- For `currentAppLocalizations`: the file should import `app_localizations.dart` (check if it already does)
69+
70+
If the file uses string interpolation (e.g., `'创建 $name 配置'`), convert to the ARB parameterized format:
71+
- In ARB: `"keyName": "Create $name config"`
72+
- In Dart: `currentAppLocalizations.keyName(name)`
73+
74+
### Step 5: Report changes
75+
76+
After all modifications, output a summary:
77+
1. List each file modified and what changed
78+
2. List each new ARB key added with its translations
79+
3. Remind the user to run code generation if needed:
80+
```
81+
dart run build_runner build --delete-conflicting-outputs
82+
```
83+
or trigger Flutter Intl regeneration in their IDE.
84+
85+
### Important notes
86+
87+
- Only extract strings that are user-facing UI text. Do NOT extract:
88+
- Comments (lines starting with `//`)
89+
- Log messages (unless they appear in the UI)
90+
- Variable names or identifiers
91+
- String literals used as keys/identifiers (not displayed to users)
92+
- If a Chinese string is split across multiple lines or concatenations, merge them into a single ARB entry
93+
- If a string contains dynamic content (variables, URLs), use ARB parameter syntax `$variableName`

.github/workflows/build.yaml

Lines changed: 65 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,57 @@ env:
88
IS_STABLE: ${{ !contains(github.ref, '-') }}
99

1010
jobs:
11+
# test:
12+
# name: Test
13+
# runs-on: ubuntu-latest
14+
# steps:
15+
# - name: Checkout
16+
# uses: actions/checkout@v4
17+
# with:
18+
# submodules: recursive
19+
#
20+
# - name: Setup Flutter
21+
# uses: subosito/flutter-action@v2
22+
# with:
23+
# channel: stable
24+
# flutter-version: 3.41.9
25+
# cache: true
26+
#
27+
# - name: Install dependencies
28+
# run: flutter pub get
29+
#
30+
# - name: Analyze
31+
# run: flutter analyze --no-fatal-infos
32+
#
33+
# - name: Run tests
34+
# run: flutter test --reporter expanded
35+
1136
build:
37+
# needs: [ test ]
1238
runs-on: ${{ matrix.os }}
1339
strategy:
1440
matrix:
1541
include:
16-
- platform: android
17-
os: ubuntu-latest
18-
- platform: windows
19-
os: Windows-2022
20-
arch: amd64
21-
- platform: linux
22-
os: ubuntu-22.04
23-
arch: amd64
24-
- platform: macos
25-
os: macos-15-intel
26-
arch: amd64
27-
- platform: macos
28-
os: macos-latest
29-
arch: arm64
42+
# - platform: android
43+
# os: ubuntu-latest
3044
# - platform: windows
31-
# os: windows-11-arm
45+
# os: Windows-2022
46+
# arch: amd64
47+
# - platform: linux
48+
# os: ubuntu-22.04
49+
# arch: amd64
50+
# - platform: macos
51+
# os: macos-15-intel
52+
# arch: amd64
53+
# - platform: macos
54+
# os: macos-latest
3255
# arch: arm64
33-
- platform: linux
34-
os: ubuntu-24.04-arm
56+
- platform: windows
57+
os: windows-11-arm
3558
arch: arm64
59+
# - platform: linux
60+
# os: ubuntu-24.04-arm
61+
# arch: arm64
3662

3763
steps:
3864
- name: Setup rust
@@ -64,28 +90,40 @@ jobs:
6490
cache-dependency-path: |
6591
core/go.sum
6692
93+
- name: Enable git long paths (Windows)
94+
if: startsWith(matrix.os, 'windows')
95+
run: git config --global core.longpaths true
96+
6797
- name: Setup Flutter
6898
if: ${{ !(startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')) }}
6999
uses: subosito/flutter-action@v2
70100
with:
71101
channel: stable
72-
flutter-version: 3.35.7
102+
flutter-version: 3.41.9
73103
cache: true
74104
- name: Setup Flutter With Other
75105
if: startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')
76106
uses: subosito/flutter-action@v2
77107
with:
78108
channel: master
79-
flutter-version: 3.35.7
109+
flutter-version: 3.44.0-0.1.pre
80110
cache: true
81111

112+
- name: Setup NDK
113+
if: startsWith(matrix.platform,'android')
114+
uses: nttld/setup-ndk@v1
115+
with:
116+
ndk-version: r28c
117+
add-to-path: true
118+
link-to-sdk: true
119+
82120
- name: Get Flutter Dependency
83121
run: |
84122
flutter --version
85123
flutter pub get
86124
87125
- name: Setup
88-
run: dart setup.dart ${{ matrix.platform }} ${{ matrix.arch && format('--arch {0}', matrix.arch) }} ${{ env.IS_STABLE == 'true' && '--env stable' || '' }}
126+
run: dart setup.dart ${{ matrix.platform }} ${{ env.IS_STABLE == 'true' && '--env stable' || '' }} -v
89127

90128
- name: Upload
91129
uses: actions/upload-artifact@v4
@@ -213,15 +251,18 @@ jobs:
213251
if: env.IS_STABLE == 'true'
214252
run: |
215253
cd ./dist
216-
for file in $(find . -type f -not -name "*.sha256"); do
217-
sha256sum "$file" > "${file}.sha256"
218-
done
254+
mkdir -p checksums
255+
for file in $(find . -maxdepth 1 -type f); do
256+
sha256sum "$file" > "checksums/$(basename "$file").sha256"
257+
done
219258
220259
- name: Release
221260
if: ${{ env.IS_STABLE == 'true' }}
222261
uses: softprops/action-gh-release@v2
223262
with:
224-
files: ./dist/*
263+
files: |
264+
./dist/*
265+
./dist/checksums/*
225266
body_path: './release.md'
226267

227268
- name: Create Fdroid Source Dir
@@ -245,4 +286,3 @@ jobs:
245286
target-branch: main
246287
commit-message: Update from ${{ github.ref_name }}
247288
target-directory: /tmp/
248-

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ app.*.symbols
4141
# Obfuscation related
4242
app.*.map.json
4343

44-
#AI generated
45-
CLAUDE.md
46-
/.claude
44+
# Claude Code - ignore user-specific settings only
45+
.claude/settings.local.json
46+
47+
# Documentation (generated/planning artifacts)
48+
docs/
4749

4850

4951
# Android Studio will place build artifacts here
@@ -63,6 +65,11 @@ CLAUDE.md
6365
/android/app/src/main/jniLibs/
6466
/services/helper/target
6567
/macos/**/Package.resolved
68+
/macos/build/
69+
/env.json
70+
/core_sha256.json
71+
/core/*.exe
72+
/plugins/rust_api/.claude/
6673
devtools_options.yaml
6774

6875
# FVM Version Cache

0 commit comments

Comments
 (0)