i18n: an effect refusal inside another message is translated with its reason

A message part that starts with `[` was translated only through an exact
catalog row, so an effect refusal such as ``[0] `fx`: nothing selected``
inside `plug-in output: objects[0].effects: …` or an importer's
`can't open …` did not use the refusal's template. Inside
`plug-in output: …` its reason stayed in English in Catalan, Greek,
Spanish, Finnish, Russian, Vietnamese, Georgian and Danish.

- A part that starts with `[` now also matches a template that starts
  with `[` and an index of ASCII digits (``[{j}] `{_1}`: {why}``), and
  its values are translated in turn. A JSON array such as
  ``["] `x`: b"]`` fits the template's text but not its index, and stays
  as it is. A part that starts with `{` is still translated only through
  an exact row.
- Georgian and Danish get the refusal's row, which they lacked.

Docs: docs/development.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-15 00:38:32 -08:00
parent df984b2a02
commit c592890527
7 changed files with 81 additions and 6 deletions
+4 -1
View File
@@ -294,7 +294,10 @@ other `sv-*` locale resolve to it), Georgian (`ka`, complete; `ka-GE` and `ka_GE
control channel, MCP and tests read them) and are translated only where the status bar draws them
(`i18n::msg`). `@msg` catalog rows hold a whole message or a template such as
`Couldn't open {name}: {e}`; `{_1}`, `{_2}` … stand for the format string's `{}`, and the values in the
placeholders are translated in turn (the reason after `: {e}` is often a message too). A literal brace in a
placeholders are translated in turn (the reason after `: {e}` is often a message too). A value that starts with
`{` is translated only when it has an exact row, so a JSON object stays as it is; a value that starts with `[` is
also matched against a template that starts with `[` and an index of digits, such as an effect's refusal
``[{j}] `{_1}`: {why}``, so its reason is translated while a JSON array stays as it is. A literal brace in a
row is written `{{` or `}}`, in the English and in the translation: a message made with `format!` keeps the
doubled braces of its format string, and a plain string literal has each of its braces doubled, so the row for
`"expected {\"objects\": [...]}"` is `expected {{"objects": [...]}}`. Czech, German, Greek, Spanish, French, Georgian, Hindi, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Russian, Simplified Chinese, Traditional Chinese, Swedish, Ukrainian, Vietnamese, Finnish, Turkish, Catalan, Dutch and Danish