From 898b52edcb47bcb3e9d6106e74ca73e74ea01e70 Mon Sep 17 00:00:00 2001 From: sillylaird Date: Thu, 3 Sep 2026 00:33:59 +0000 Subject: import live www.sillylaird.ca webroot --- locales/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 locales/README.md (limited to 'locales/README.md') diff --git a/locales/README.md b/locales/README.md new file mode 100644 index 0000000..5a04920 --- /dev/null +++ b/locales/README.md @@ -0,0 +1,24 @@ +# Locales + +Flat key → string dicts, one file per language: `en.php`, `ja.php`, `zh.php`. +Loaded by `partials/i18n.php` via the `t($key)` helper. + +**EN is source of truth.** Missing keys in ja/zh fall back to English, then to +the key string itself. When you add UI strings, add the EN key first and mirror +it in ja/zh in the same change when possible. + +## Migration strategy + +The existing `foo.php` / `foo_jp.php` / `foo_zh.php` triples are kept as-is. +When you next edit a page triple, collapse it: + +1. `require_once __DIR__ . '/partials/i18n.php';` at the top of `foo.php`. +2. Replace the hardcoded English strings with ``. +3. Add matching keys to `locales/{en,ja,zh}.php`. +4. Replace `foo_jp.php` / `foo_zh.php` with a one-line redirect stub: + `