Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
docs(skills): record the noun-or-verb rule for menu labels
Elian Doran6b7706d3b54d
diff --git a/.claude/skills/building-client-ui/SKILL.md b/.claude/skills/building-client-ui/SKILL.mdindex ded1ec7a6f..d3e1d97190 100644--- a/.claude/skills/building-client-ui/SKILL.md+++ b/.claude/skills/building-client-ui/SKILL.md@@ -138,6 +138,12 @@ Rules for both:- a confirm (Delete note..., Reset..., Convert to attachment...)An item that acts at once, toggles, navigates, opens a note or tab, opens a submenu, or opens a dialog that only displays information (Recent changes, Note Info, About) has no "...". Write three periods, which most catalogue keys use. The "..." belongs in the English string, before any `<kbd>` in it (`"Delete... <kbd data-command=\"deleteNotes\"></kbd>"`). When the dialog's title or a heading shows the same words, give that use its own key without the "..." (`board_view.properties` / `board_view.properties-title`).+- **Name a menu item by what it gives the user: a verb only for an action.** This follows the Windows and macOS menu convention.+ - An item that opens a place (a dialog, a note, a subtree, a log) is a noun, without "Show" or "Open": _Deleted notes_, _Backend log_, _SQL console_, _Help_, _Keyboard shortcuts_. The dialog's own title is usually the right noun.+ - A toggle is a noun for the mode, never "Toggle X": _Fullscreen_, _Zen mode_, _Always on top_. Its row shows the state (`checkable`/`checked`, or `active`).+ - A submenu is a noun: _Theme_, _Advanced_.+ - An item that does something once, or acts on the selection, keeps an imperative verb: _Cut_, _Delete note..._, _Reload frontend_, _Switch to desktop version_, _Log out_ (the verb, not the noun "Logout"). Keep the verb as well where the noun alone would read as a toggle: _Configure launch bar..._, not _Launch bar_.+ - "New window" is the platform phrase for opening another window. Don't write "Open new window".- **Style a popup by its own classes.** It lives in `<body>`, inside a `.tn-dropdown-portal` wrapper that carries the dropdown's `className`, so a rule scoped under the toggle's ancestors (`.status-bar .dropdown-menu`) never matches it. Use `dropdownContainerClassName` with top-level rules. Its z-index (1200, over dialogs) is set in `Popup.css`; `--bs-dropdown-zindex` doesn't reach it.Other floating surfaces:diff --git a/.claude/skills/working-with-translations/SKILL.md b/.claude/skills/working-with-translations/SKILL.mdindex b3e8c9c85f..8fd65dc50e 100644--- a/.claude/skills/working-with-translations/SKILL.md+++ b/.claude/skills/working-with-translations/SKILL.md@@ -86,6 +86,10 @@ node $S add client dialog.my_thing "Save changes"A menu label ends in "..." when its item opens a dialog, prompt, chooser or confirm (see "Dropdowns: menus and panels" in the `building-client-ui` skill). For that reason, don't reuse a menu label's key as the title of the dialog it opens. Add a second key without the "..." instead, for example `board_view.properties` and `board_view.properties-title`.+A menu label is a noun when its item opens a place or toggles a mode (_Backend log_, _Fullscreen_), and a verb only when it acts (_Reload frontend_, _Log out_). The full rule is in the same section of `building-client-ui`.++**To reword an existing string, change its English value and keep its key**, even when the key names the old text (`global_menu.show_backend_log` → "Backend log"). Renaming the key drops the string from every locale's catalogue, so each one falls back to English until Weblate catches up. Keeping the key leaves the old translations showing until translators update them. Then update the User Guide pages that quote the old text (`docs.mjs impact --diff`, or grep `docs/User Guide` for the old phrase, since a common noun gives `impact` many false hits).+Then use it: `t("dialog.my_thing")`. Only `en/` changes — Weblate carries the string to the other locales, and you should **not** hand-edit the other ~38 locale files.### Write US English, and mirror the difference into `en-GB`diff --git a/CLAUDE.md b/CLAUDE.mdindex 92d7654c3f..ff1f18dc36 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -172,6 +172,7 @@ SQLite (`better-sqlite3` on Node, `@sqlite.org/sqlite-wasm` on OPFS in standalon- Client: `import { t } from "../services/i18n"`; everywhere else: `import { t } from "i18next"`. Never hardcode user-facing text, including in Electron dialogs/tray/IPC.- **The `en` catalogues are US English** — `color`, `center`, `meter`, `recognize`, `labeled`, `canceled`. `en-GB` is a locale of its own and carries only the strings whose British spelling differs, so when a new or edited string contains one of those words, add the British form there too (`node .claude/skills/translating-locales/locale.mjs merge en-GB <catalog> <file>`). Leave `en-GB` alone when the spelling is the same in both.- Interpolate with `{{var}}`. The client turns i18next's HTML-escaping off in `initLocale()` — translated strings are rendered as text, where escaping reached the reader as `/` — so a string headed for a sink that takes HTML escapes its own values: `Menu` titles and `highlightedNotePathTitle` take HTML, so their callers wrap interpolated values in `escapeHtml()` (`t("table_view.hide-column", { title: escapeHtml(title) })`), and the confirm/info dialogs sanitize a string message with DOMPurify (`SanitizedHtml`). The server catalogue still escapes, hence `{{- var}}` on its quote-carrying values. Interpolated **components** whose order can vary by language (links, note references) use `<Trans>` from `react-i18next`, not `t()`.+- **Menu labels**: a noun for an item that opens a place or toggles a mode (_Backend log_, _Fullscreen_, never "Show …"/"Toggle …"), an imperative verb only for one that acts (_Reload frontend_, _Log out_), and a trailing "..." when it needs more input. Rules: `building-client-ui` skill, "Dropdowns: menus and panels". To reword a string, change the English value and keep the key.- **Multi-paragraph text is one message with `\n\n` between paragraphs**, never a key per paragraph, so the translation decides where paragraphs fall. Render it with `.pre-wrap-text` or split it on blank lines into `<p>` — see the `working-with-translations` skill.- Third-party components (mind-map context menu, …) still go through `t()` with their strings under a dedicated namespace (e.g. `"mind-map"`).- **Text editor (`packages/ckeditor5`)**: plugins call `editor.t("English text")` — the English text *is* the message id, the entry lives under `text-editor.ck` keyed by its slug, and `apps/client/src/services/i18n.spec.ts` fails on a missing or stale one. Rules (name it `t`, literal argument, don't shadow upstream strings, `MESSAGE_OVERRIDES`, `renderShortcut`): **`ckeditor5-plugin-development` skill**.