Skip to content

Commit 0472d53

Browse files
authored
feat(i18n): add complete English and Chinese localization
Completes T23 trilingual application/content localization with deterministic language persistence, localized notifications and accessibility copy, multilingual catalog search, and language-invariant domain ordering. Pull-request CI: https://github.com/DrEden33773/FreshLoop/actions/runs/30094147720
1 parent f1f2125 commit 0472d53

77 files changed

Lines changed: 3743 additions & 569 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.

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,93 @@ jobs:
6666

6767
- name: Test
6868
run: npm run test:ci
69+
70+
- name: Export Android bundle
71+
run: npm run export:android
72+
73+
- name: Export iOS bundle
74+
run: npm run export:ios
75+
76+
android-release:
77+
name: Android single-ABI release build
78+
if: github.event_name != 'pull_request'
79+
runs-on: ubuntu-latest
80+
timeout-minutes: 30
81+
82+
steps:
83+
- name: Check out repository
84+
uses: actions/checkout@v7
85+
86+
- name: Set up Node.js
87+
uses: actions/setup-node@v7
88+
with:
89+
node-version: 24.14.0
90+
cache: npm
91+
cache-dependency-path: mobile/package-lock.json
92+
93+
- name: Set up Java
94+
uses: actions/setup-java@v5
95+
with:
96+
distribution: temurin
97+
java-version: "21"
98+
99+
- name: Set up Gradle cache
100+
uses: gradle/actions/setup-gradle@v5
101+
102+
- name: Install dependencies and build release APK
103+
working-directory: mobile
104+
run: |
105+
npm ci
106+
npx expo prebuild --platform android --clean
107+
cd android
108+
./gradlew app:assembleRelease -PreactNativeArchitectures=x86_64
109+
110+
- name: Upload release APK
111+
uses: actions/upload-artifact@v6
112+
with:
113+
name: android-release-x86_64
114+
path: mobile/android/app/build/outputs/apk/release/app-release.apk
115+
if-no-files-found: error
116+
117+
android-i18n:
118+
name: Android trilingual critical journeys (manual)
119+
if: github.event_name == 'workflow_dispatch'
120+
needs: android-release
121+
runs-on: ubuntu-latest
122+
timeout-minutes: 20
123+
124+
steps:
125+
- name: Check out repository
126+
uses: actions/checkout@v7
127+
128+
- name: Download release APK
129+
uses: actions/download-artifact@v8
130+
with:
131+
name: android-release-x86_64
132+
path: mobile/android/app/build/outputs/apk/release
133+
134+
- name: Install Maestro
135+
run: curl -Ls https://get.maestro.mobile.dev | bash
136+
137+
- name: Run English and Chinese Android journeys
138+
uses: reactivecircus/android-emulator-runner@v2
139+
with:
140+
api-level: 36
141+
arch: x86_64
142+
profile: pixel_6
143+
disable-animations: true
144+
script: |
145+
adb install -r mobile/android/app/build/outputs/apk/release/app-release.apk
146+
"$HOME/.maestro/bin/maestro" test mobile/.maestro/i18n-en.yaml
147+
"$HOME/.maestro/bin/maestro" test mobile/.maestro/i18n-zh-CN.yaml
148+
adb shell wm size 320x720
149+
adb shell settings put system font_scale 2.0
150+
"$HOME/.maestro/bin/maestro" test mobile/.maestro/i18n-zh-TW.yaml
151+
152+
- name: Upload Android localization results
153+
if: always()
154+
uses: actions/upload-artifact@v6
155+
with:
156+
name: android-i18n-results
157+
path: mobile/dist/maestro-results
158+
if-no-files-found: warn

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
FreshLoop is a local-first Expo 57 / React Native pantry application for Android-first classroom demonstration. It keeps inventory in on-device SQLite, distinguishes `Use By` safety wording from `Best Before` quality wording, ranks items with an explanation, offers a small local Rescue recipe catalogue, and records only user-confirmed outcomes.
44

5+
The complete app and bundled ingredient/recipe content are available in English, Simplified Chinese, and Traditional Chinese. Change language in **Settings → Language**; the choice applies immediately, survives restart, and overrides the device language. User-entered names/notes and Open Food Facts product names remain exactly as supplied, while search matches all three bundled catalog languages.
6+
57
## Prerequisites
68

79
- Windows 10/11 with hardware virtualization enabled, or Ubuntu 24.04 under WSL 2 with a Windows Android emulator.
@@ -92,7 +94,7 @@ node --test tools/freshloop/__tests__/*.test.cjs
9294

9395
A clean-extraction acceptance is not complete until the native command has also auto-started an emulator, built and installed the APK, brought `com.comp7506d.freshloop/.MainActivity` to the foreground, and reached the Metro phase. JavaScript exports alone do not validate the README native path.
9496

95-
The Android critical journeys are in `mobile/.maestro/` and can be run against an installed APK with `maestro test .maestro`. The current release candidate passed 54 Jest suites / 132 tests, Android and iOS production exports, a Gradle release build, and API 36 navigation checks. iOS was export-tested only; no iOS device or simulator result is claimed.
97+
The Android critical journeys are in `mobile/.maestro/` and can be run against an installed APK with `maestro test .maestro`. The current integration branch passes 57 Jest suites / 156 tests; production exports, the Gradle release build, and the three-language Android journeys are revalidated in T23/F1-F4 before the release-candidate statement is refreshed. iOS remains export-only; no iOS device or simulator result is claimed.
9698

9799
## Classroom demo and reset
98100

@@ -132,6 +134,7 @@ Important source areas:
132134
- Manual entry, Today, Rescue, outcomes, and Insights work without network access after installation.
133135
- Barcode lookup is optional. When used online, the scanned barcode is sent to the public Open Food Facts API to suggest a product name. The user must confirm the physical package; FreshLoop never imports expiry dates or makes a safety decision from Open Food Facts.
134136
- Reminder settings use OS-local notifications and can be denied or disabled without blocking the pantry.
137+
- Reminder payloads record the selected locale. On startup or language change, managed reminders created in another language are replaced without changing the SQLite schema.
135138
- Open Food Facts data is crowdsourced and licensed under ODbL; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for dependency, font, asset, and data-source notices.
136139

137140
## Verified platform boundary
@@ -163,6 +166,7 @@ Important source areas:
163166
- Refreshed 60fps video/submission evidence: `qa/evidence/T22-video-refresh/`
164167
- Windows one-command toolchain evidence: `qa/evidence/T19-windows-toolchain/`
165168
- WSL/Windows emulator bridge evidence: `qa/evidence/T20-wsl-android/`
169+
- Three-language localization evidence: `qa/evidence/T23-i18n/`
166170

167171
Generated APKs, source archives, final rendered videos, and the supplied course brief are intentionally excluded from Git history. Build distributable copies with the documented release scripts and publish them through the approved course delivery channel or a suitable release store.
168172

docs/contributions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This ledger records only identities and work visible in repository evidence. It
77
| Member / repository identity | Actual task | Evidence | Verification |
88
|---|---|---|---|
99
| `DrEden33773` | Initialized the Expo project; authored governance/design; implemented date, lifecycle, recipe, SQLite, onboarding, Pantry, Today, Insights, Rescue, barcode, reminder, accessibility, and release-hardening slices through T16. | Git commits `3b6af8a` through `bedca05`; source under `mobile/`; task receipts under `qa/evidence/T01-toolchain/` through `qa/evidence/T16-android-qa/`. | Git history identifies the same author for the commits; automated gates and real Android emulator receipts are summarized in `qa/evidence/T16-android-qa/result.txt`. |
10+
| `mmy0302` | Introduced the initial English/Simplified Chinese/Traditional Chinese resources, language selector, and first translated feature surfaces that became the base of T23. | Branch commits `b404541`, `ec8b311`, and `13b1889`; initial implementation under `mobile/src/i18n/` and translated feature files. | T23 completion tests validate the retained implementation after persistence, content, notification, accessibility, and full-surface hardening. |
11+
| `DrEden33773` | Completed T23 integration hardening: deterministic language restoration, full surface/content localization, stable validation codes, locale-aware notification replacement, typed catalogs, three-language tests/Android CI, and documentation alignment. | T23 commit on `feat/i18n-v2-zh`; `mobile/src/i18n/`, localized feature/content/notification files, `.github/workflows/ci.yml`, and `qa/evidence/T23-i18n/`. | Local typecheck, lint, 57 Jest suites / 156 tests, and Android/iOS exports pass; the required three-language Android CI result remains a pre-merge gate. |
1012

1113
## External reconciliation still required
1214

docs/demo-script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232

3333
- Do not say that FreshLoop determines food safety, prevents food waste, or measures savings.
3434
- Do not describe Open Food Facts as complete or authoritative.
35-
- Do not claim full Traditional Chinese localisation or iOS device verification.
35+
- Do not claim that the three-language Android surface matrix has passed until T23 evidence is complete; never claim iOS device verification.
3636
- Do not show development-only notification diagnostics in a release demonstration.

docs/design-system.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FreshLoop mobile design system
22

3-
Status: frozen T03 implementation contract for the Android-first app and its introduction video. English is the primary UI language; Traditional Chinese aliases support recognition and future localization. There is no dark mode or tablet-specific visual branch in this release.
3+
Status: T03 visual contract plus the approved T23 localization extension for the Android-first app and its introduction video. English, Simplified Chinese, and Traditional Chinese are complete product languages. There is no dark mode or tablet-specific visual branch in this release.
44

55
## 0. Research log
66

@@ -178,4 +178,3 @@ Accepted design debt: none in T03. Real Android primitive/screen QA, keyboard/sc
178178
## 9. Handoff and change control
179179

180180
T08 must map every implementation color, type, spacing, radius, elevation, icon, and motion value to this document. A new semantic role is added here before code uses it. T22 keeps the film at exactly 90 seconds / 5400 frames at 60fps and every app visual remains a named real Android recording. Any new font, icon, music, voice, image, or footage enters `docs/asset-manifest.md` with owner, license, and provenance before use.
181-

docs/project/decision-record.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
| --- | --- | --- |
2525
| Repository shape | Separate mobile and video packages | Avoid Expo monorepo complexity |
2626
| Recipe content | Exactly 12 original recipes and at least 30 normalized ingredients | Sufficient demo variety within the deadline |
27-
| Language | English UI with Traditional Chinese ingredient aliases | Local relevance without full i18n scope |
27+
| Language | Complete English, Simplified Chinese and Traditional Chinese UI/content | Approved T23 scope expansion; saved choice overrides device locale |
2828
| Video | 90 seconds, 1920x1080, 60 fps | Inside the required one-to-two-minute range; smoother app footage |
2929
| Android top-level navigation | Five Expo Router Native Tabs | Native safe-area handling; Settings is discoverable from every tab |
3030
| Expiry card copy | `USE BY / THURSDAY` | `THU` meant Thursday, not a university; spelling it out removes ambiguity |
@@ -47,15 +47,15 @@
4747
- Food dates use the Asia/Hong_Kong local calendar. Past Use By items are excluded from Rescue; Best Before never becomes a safety verdict.
4848
- Domain rules, migrations and notification policy use TDD. UI behavior is covered by component tests and real Android QA.
4949
- Android is fully verified. iOS receives static/export coverage only and must not be called device-tested.
50-
- The visual direction is warm editorial pantry; English UI includes Chinese ingredient aliases without full bilingual i18n.
50+
- The visual direction is warm editorial pantry; T23 localizes the complete product and bundled content in English, Simplified Chinese and Traditional Chinese without translating user/OFF free text.
5151
- Report and video claims are source-backed, and video app visuals come only from the real Android build.
5252
- Android edge-to-edge navigation uses native tabs and explicitly validates gesture/three-button modes at 320dp and 200% text.
5353
- Video captions use 40px Manrope in one/two compact lower-left boxes; sequence timing is expressed in seconds and converted through the 60fps contract.
5454

5555
## Scope boundaries
5656

5757
- Included: seven core surfaces, lightweight onboarding and Settings/About, food CRUD, five date bases, local notifications, twelve recipes, outcomes, Insights, optional product lookup, deterministic demo data, Android APK/evidence, report, demo kit, video and clean submission package.
58-
- Excluded: authentication, cloud sync, sharing, social/chat/payment, shopping collaboration, AI, OCR, expiry prediction, medical or safety diagnosis, quantified environmental savings, partial quantities, item photos, dark mode, tablet specialization, full Chinese UI, app-store release and iOS device verification claims.
58+
- Excluded: authentication, cloud sync, sharing, social/chat/payment, shopping collaboration, AI, OCR, expiry prediction, medical or safety diagnosis, quantified environmental savings, partial quantities, item photos, dark mode, tablet specialization, network translation, app-store release and iOS device verification claims.
5959

6060
## Review and approval history
6161

@@ -64,6 +64,7 @@
6464
- 2026-07-15: the user approved the recommended defaults and authorized implementation.
6565
- 2026-07-16: T01-T15 are recorded complete in the work plan. T16 is the next permitted implementation stage.
6666
- 2026-07-21: T21/T22 adopt native five-tab navigation, `THURSDAY`, compact lower-left captions, shared cross-platform recording actions, and a 60fps/5400-frame final render while preserving T18 as historical evidence.
67+
- 2026-07-24: the user explicitly approved T23 complete trilingual localization and T24 contract-tested macOS Android tooling as the only post-freeze scope expansions. Android remains the only fully device-verified platform; hosted Mac CI is not device/emulator proof.
6768
- 2026-07-21: after reviewing publication risk, the user required the original course brief and MP4 delivery assets to remain Git-ignored. The course brief is listed in `.worktreeinclude` so Codex-managed worktrees can use the local file without publishing it.
6869

6970
## Open questions

0 commit comments

Comments
 (0)