# Language Files

This folder lets users edit the app translation without changing Python code.

How it works:
- The app keeps a built-in fallback text set.
- On startup, it also reads `language\en.json`, `language\vi.json`, `language\ko.json`, and `language\zh.json`.
- If a key exists in a JSON file, that value overrides the built-in text.
- If a key is missing, the app falls back automatically.

When new UI keys are added later:
- Run `scripts\sync_language_files.bat`
- The script will add any missing keys into each language file
- Existing translations are preserved
- New untranslated keys in non-English files are added with a `[TODO] ` prefix

Recommended workflow:
1. Run the app once after this update.
2. The app will auto-create any missing JSON language files.
3. Open the file for the language you want to adjust.
4. Edit only the text values on the right side.
5. Save as UTF-8.
6. Restart the app.

Which folder to edit:
- When running from source, edit `D:\Hermes\Sunny_ERP_App\language\*.json`.
- When running a packaged `.exe`, edit the `language\*.json` folder next to that `.exe`.
- Editing the source `language` folder does not change an already packaged app until the app is rebuilt/published with those files.
- The app reads language files only during startup. After editing a JSON file, close and reopen the app.

Sync helper:
- After editing source language files, run `scripts\sync_language_files.bat`.
- The script keeps existing translations, adds missing keys, and copies the source `language` files into `dist\SunnyERPApp\language` when that packaged app folder exists.
- Recommended order for release work: edit `language\*.json`, run `scripts\sync_language_files.bat`, then build/publish the app.

Notes:
- Do not rename keys.
- You can translate only the keys you care about; the rest will keep using fallback text.
- `ko.json` and `zh.json` start from a stable English base so your team can replace labels with the exact Korean/Chinese wording you prefer.
