Clean up editor i18n translations and add CI validation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 43/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, json, typescript
Direzione di ricerca
Start with the translation modules under packages/editor/src/i18n/, then inspect GptDialog.tsx, useGpt.tsx, and the hints/math-hint consumers before changing keys. Read packages/editor/scripts/lint-i18n.js, scripts/lint-i18n.js, and packages/editor/src/i18n/__tests__/lint.test.ts to understand the lint and test structure; update the contribution guidelines for the naming convention. Done means EN/RU keys align, deprecated imports remain compatible, renamed keys have no dangling consumers, lint fixtures cover every rule, and pnpm lint:i18n, pnpm lint, and pnpm test pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
-
The editor's translation files (
packages/editor/src/i18n/) have accumulated a number of inconsistencies over time. The same UI labels are translated differently across modules, some EN/RU pairs carry different meanings, there are English copy mistakes, two keysets are exact duplicates, and there is no enforced key naming convention. -
Also nothing prevents new issues from being introduced. We want to do a focused cleanup pass and add a lightweight lint step to CI so the baseline stays clean going forward.
Scope:
- Fix translation inconsistencies where the same concept has different translations in different modules (e.g. Cancel, Preview, Try again)
- Fix semantic mismatches where EN and RU do not mean the same thing (e.g.
yfm-notewarning label,formsimage name field) - Fix English copy issues: typo in
forms, plural inmenubar, awkward phrasing ingpt/errors, locale-specific punctuation inbundle - Consolidate two identical keysets (
hints/andmath-hint/) - Fix one concrete naming inconsistency in
menubar(single vs double underscore separator); document the convention in a comment or CONTRIBUTING note (repo-wide rename is out of scope) - Add
scripts/lint-i18n.mjswired into the existing lint pipeline; checks: key parity between en/ru per module, no empty values, no obviously untranslated strings
Implementation Steps
Step 1 — Fix translation inconsistencies (same concept, different translation)
| Location | Key | Problem | Fix |
|---|---|---|---|
forms/ru.json, gpt/extension/ru.json |
common_action_cancel, confirm-cancel |
"Отменить" (verb) — should match common which uses "Отмена" (noun) |
Change to "Отмена" |
yfm-layout/ru.json |
cell.preview |
"Превью" — everywhere else Preview → "Предпросмотр" | Change to "Предпросмотр" |
gpt/dialog/en.json |
refetch and try-again |
Both have value "Try again" in EN, but different RU translations ("Попробовать ещё" vs "Иначе"). Before fixing: read GptDialog.tsx and useGpt.tsx to understand what each button actually does. If refetch is dead code, remove the key. If buttons have different behavior, fix the RU to match EN semantics; do not change try-again EN value based solely on the differing RU translation. |
Investigate first, then either remove dead key or align RU |
Step 2 — Fix semantic mismatches (EN and RU mean different things)
| Location | Key | EN | RU | Fix |
|---|---|---|---|---|
yfm-note/ |
warning |
"Warning" | "Важно" (Important) | ⚠️ Needs product decision — "Warning" and "Important" carry different meaning; do not change without alignment |
forms/ |
image_name |
"Title" | "Подпись к рисунку" (Caption) | ⚠️ Needs product decision — "Title" and "Caption" are different concepts; do not change without alignment |
yfm-layout/ |
action.align.left/center/right/stretch |
"Left alignment" (brief) vs "Вся секция по левому краю" (descriptive); "Stretch to the full width" vs "Растягивать секцию на всю ширину" | Expand EN: "Align entire section to the left / center / right / full width" | |
placeholder/ |
table_cell |
"Cell content" | "Текст" | Align both — "Text" / "Текст" to match layout_cell |
Step 3 — Fix English copy issues
| Location | Key | Problem | Fix |
|---|---|---|---|
forms/en.json |
image_link_href_help |
Typo: "Adress" | → "Address" |
menubar/en.json |
more_action |
"More action" (singular) | → "More actions" |
gpt/errors/en.json |
start-again-button |
"To the beginning" (word-for-word from RU) | → "Start over" |
bundle/en.json |
settings_hint |
Russian guillemets «+» in an English string | → "+" button |
Step 4 — Consolidate duplicate keysets
hints/ and math-hint/ have identical en.json and ru.json.
packages/editor/package.json has a ./_/* wildcard export mapping to build/esm/* and build/cjs/*, which means both paths (_/i18n/hints and _/i18n/math-hint) are technically externally reachable. To avoid a breaking change:
- Use
hints/as the canonical keyset — it has more internal consumers (items.tsx,wysiwyg.ts) vsmath-hint/which is used only inhint.tsx, so this minimises churn - Migrate all internal consumers to the canonical keyset
- Migrate
hint.tsx(sole consumer ofmath-hint) to import fromhints/instead; changemath-hint/index.tsto a thin re-export — this preserves_/i18n/math-hintmodule import compatibility - Add a
@deprecatedJSDoc comment on the re-export file
The en.json and ru.json files in the deprecated module are not deleted — only index.ts is changed to a re-export. Raw JSON subpath imports (_/i18n/hints/en.json) are therefore preserved physically as a side-effect.
Step 5 — Fix key naming inconsistency inside menubar + document convention
list_action_disabled uses a single underscore while neighboring keys use double underscore as a namespace separator (list__action_lift, list__action_sink). Rename to list__action_disabled and update all consumers.
Document the chosen convention (snake_case with __ as namespace separator) in docs/guidelines-contributions.md under a new "i18n keys" section. Repo-wide rename of other modules is out of scope for this issue.
Step 6 — Write and wire scripts/lint-i18n.mjs
Checks (exit non-zero on failure):
- For every module, all keys in
en.jsonexist inru.jsonand vice versa - No empty or whitespace-only values
- No value in
ru.jsonidentical to itsen.jsoncounterpart, except an allowlist of legitimate shared terms (product names, markup language names, etc.)
Advisory-only (print warnings, do not fail):
4. Duplicate values within the same locale file
Structure — two files, one purpose:
packages/editor/scripts/lint-i18n.js— linter logic as a CommonJS.jsmodule (returns structured errors); lives inscripts/alongsidecheck-circular-deps.js, outside runtime source tree and./_/*wildcard;.jsextension is importable by Jest without addingmjstomoduleFileExtensionsscripts/lint-i18n.js— thin root-level CommonJS runner (require()+process.exit(1));.jsnot.mjssorequire()is available natively withoutcreateRequire
Unit tests (packages/editor/src/i18n/__tests__/lint.test.ts): import the .js module, pass in-memory fixture objects — covers all lint rules as pure functions.
Integration smoke test (same file or separate lint.integration.test.ts): create a small temporary fixture directory on disk with 2–3 modules (one valid, one with a missing key, one with an empty value), run the full file-walk logic against it, assert exit behaviour — catches bugs in file discovery and module traversal that unit tests miss.
Add to root package.json scripts group (root lint already runs all lint:* via run-p, so no separate CI step needed):
"lint:i18n": "node scripts/lint-i18n.mjs"
Verification
Steps 1–3 (copy fixes):
pnpm lint:i18nexits 0pnpm testpasses
Step 1 (GPT try-again/refetch investigation):
- Confirm the target button's behavior by reading
GptDialog.tsxanduseGpt.tsx; add an assertion or snapshot covering the GPT dialog copy if none exists
Steps 4–5 (keyset consolidation + key rename):
pnpm lint:i18nexits 0- Grep for all consumers of the removed/renamed keys before and after to confirm no dangling references
- Add targeted unit tests for
MathHintconsumer andlist__action_disabledusage; key renames can break runtime without failing broad suite
Step 6 (lint script):
- Jest tests in
packages/editor/src/i18n/__tests__/lint.test.tspass - Introduce a deliberate key mismatch in a fixture object — test must fail
- Confirm
pnpm lint(root) picks uplint:i18nviarun-p
- Lingua principale
- TypeScript
- Stelle
- 428
- Fork
- 48
- Merge medio
- 5g 15h
- PR unite (30g)
- 47
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gravity-ui/markdown-editor
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
gravity-ui/markdown-editor#1452 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gravity-ui/markdown-editor#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
Markup mode: `colorify` does not detect existing `{color}(...)` wrapper when switching colorsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
gravity-ui/markdown-editor#1129 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
gravity-ui/markdown-editor#1450 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
gravity-ui/markdown-editor#1331 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di gravity-ui/markdown-editor
Issue simili
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
openclaw/openclaw#199885 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
feature needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
sequant-io/sequant#1689 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100