mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-14 19:27:01 -04:00
LRC-LIB-SMARTCOLL: document message contexts for translators
localization.md explains "<context>|<English>" catalog keys and the one context today (smart album value); localization-ja.md notes あり / なし. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c42fc7ac24
commit
451e3cd28c
2 files changed
+12
No files matched your search
@@ -24,5 +24,9 @@ LightCraft は日本語・簡体字中国語・英語(English)の表示に
|
||||
英語の単複数語尾を日本語で省略する場合、対応する文字列引数は `{:.0}` で空にします。
|
||||
`LIGHTCRAFT_LANGUAGE=ja lightcraft-cli snapshot ...` で日本語の画面を描画できます。
|
||||
|
||||
スマートアルバムの「はい/いいえ」で答える条件(編集あり、切り抜き済みなど)の値は、文脈付きキー
|
||||
`"smart album value|Yes"`・`"smart album value|No"` で「あり/なし」と表示します。共有の
|
||||
`"Yes"`・`"No"`(はい/いいえ)は他の画面でそのまま使います([`localization.md`](localization.md) の文脈の説明を参照)。
|
||||
|
||||
表示・フォント・言語の切り替え・設定の保存・コマンドIDの保持は
|
||||
`cargo test -p lightcraft-ui-egui i18n::tests` で検証します(グリフの検査は `CRAFT_FONTS_DIR` 指定時のみ実行)。
|
||||
@@ -49,6 +49,14 @@ are in [`localization-zh-hans.md`](localization-zh-hans.md), [`localization-zh-h
|
||||
text unchanged when there is no entry; `tr_format!` handles text with runtime values. Both are
|
||||
presentation-only: command ids, file names and user-entered metadata are never translated.
|
||||
|
||||
A few messages take a **context**, for a word whose shared translation reads wrongly in one place.
|
||||
The catalog may then carry `"<context>|<English>"`, which wins there; without it the plain message
|
||||
is used, so only the languages that need it add one. Today the one context is `smart album value`:
|
||||
the Yes / No of a yes/no rule (Has Edits, Cropped…). Japanese uses it because はい / いいえ answer a
|
||||
question rather than describe a photo (`"smart album value|Yes": "あり"`, `"smart album value|No":
|
||||
"なし"`); every other language uses its plain Yes / No. A contextual key that names no real value
|
||||
fails the i18n tests.
|
||||
|
||||
`tr_format!` is generated by `crates/ui-egui/build.rs`: one arm per English message, which formats
|
||||
the active language's translation with `format!` (English is the fallback arm). Every catalog's
|
||||
format string is therefore checked by Rust against the call site's own arguments:
|
||||
|
||||
Reference in new issue
Block a user