Skip to content

Commit a7cff06

Browse files
committed
docs(i18n): document the Lingui authoring & translator workflow
README + CONTRIBUTING explain the 'author English macros, don't translate' contributor flow and the translator (Tolgee/OTA) flow; new .rules/i18n.md rule; fixed the stale src/i18n/locales reference; rules index lists frontend.md + i18n.md.
1 parent 0f087b5 commit a7cff06

5 files changed

Lines changed: 40 additions & 1 deletion

File tree

.rules/general.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# General Rules
2-
1. **Language:** Use **English** for all code comments, documentation, and commit messages. Translate other languages in @src/i18n/locales .
2+
1. **Language:** Use **English** for all code comments, documentation, and commit messages. User-facing UI strings are authored in English via Lingui macros — see [i18n Rules](./i18n.md); you do not write translations by hand.
33
2. **Package Manager:** Always use **pnpm** instead of npm or yarn.

.rules/i18n.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# i18n Rules
2+
3+
1. **Author in English only.** Wrap every user-facing string in a Lingui macro — `` t`...` `` / `t({ message })` from `@lingui/core/macro`, or `<Trans>` / `useLingui().t` from `@lingui/react/macro`. Never ship a bare UI string literal.
4+
2. **Do not write translations by hand.** Contributors are **not** required to translate. `pnpm tauri dev` (and `pnpm i18n:extract`) regenerates the catalogs from your source strings; missing translations fall back to English and are filled later via Tolgee + over-the-air delivery. After extracting you _may_ fill other locales' `.po` files, but it is optional.
5+
3. **Catalogs are generated artifacts.** `src/locales/<lng>/messages.po` (source) and `messages.ts` (compiled) are produced by `lingui extract` / `lingui compile`. The dev server regenerates them on save — never edit them by hand. Commit the regenerated catalogs alongside the code that introduced the strings.
6+
4. **Plugin UI strings are separate.** A plugin's strings live in its own `locales/<lang>.json` (ICU `{var}` placeholders), read via `usePluginTranslation(pluginId)` — they are not part of the app catalogs.

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Adhere to the rules defined in the [rules directory](./.rules/):
66
- [Rust Rules](./.rules/rust.md) (Backend module structure and Rust testing)
77
- [TypeScript Rules](./.rules/typescript.md)
88
- [React Rules](./.rules/react.md)
9+
- [Frontend Rules](./.rules/frontend.md) (Driver-agnostic frontend)
10+
- [i18n Rules](./.rules/i18n.md) (Lingui authoring & translation workflow)
911
- [Modal Styling Rules](./.rules/modals.md) (Modal component structure and styling)
1012
- [Testing Conventions](./.rules/testing.md) (Test file organization and structure)
1113

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents
2424
- [Suggesting Enhancements](#suggesting-enhancements)
2525
- [Your First Code Contribution](#your-first-code-contribution)
2626
- [Improving The Documentation](#improving-the-documentation)
27+
- [Translations](#translations)
2728
- [Styleguides](#styleguides)
2829
- [Commit Messages](#commit-messages)
2930
- [Join The Project Team](#join-the-project-team)
@@ -154,6 +155,23 @@ Updating, improving and correcting the documentation
154155
155156
-->
156157

158+
### Translations
159+
160+
Tabularis is localized with [Lingui](https://lingui.dev), and the source language is English.
161+
162+
**For code contributors — you don't have to translate anything.** Just wrap every user-facing string in a Lingui macro and write it in English:
163+
164+
```tsx
165+
import { useLingui } from "@lingui/react/macro";
166+
167+
const { t } = useLingui();
168+
return <button>{t`Add Connection`}</button>;
169+
```
170+
171+
`pnpm tauri dev` regenerates the catalogs (`src/locales/<lng>/messages.po` and the compiled `messages.ts`) automatically on save, so you never edit them by hand — commit the regenerated catalogs alongside your change. If you forget, CI regenerates and commits them on your PR. Strings without a translation fall back to English. After extracting you _may_ fill in other locales' `.po` files, but it is entirely optional; leave them and a translator (or the maintainers) will.
172+
173+
**For translators.** Translations live in [Tolgee](https://tolgee.io), not in the repository: source strings are pushed there, translated, reviewed, and delivered to the app over the air — so a corrected translation reaches users without waiting for a release. You never need to touch `.po` files or open a PR to translate. If you'd like to help translate Tabularis, or want a new language added, open an [issue](https://github.com/TabularisDB/tabularis/issues) or ping us on [Discord](https://discord.com/invite/K2hmhfHRSt) and we'll get you set up.
174+
157175
## Styleguides
158176

159177
### Commit Messages

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,19 @@ pnpm tauri dev
346346
pnpm tauri build
347347
```
348348

349+
### Translations
350+
351+
The UI is localized with [Lingui](https://lingui.dev), and **you don't need to translate anything to contribute** — just wrap user-facing strings in a Lingui macro and write them in English:
352+
353+
```tsx
354+
import { useLingui } from "@lingui/react/macro";
355+
356+
const { t } = useLingui();
357+
<button>{t`Add Connection`}</button>;
358+
```
359+
360+
`pnpm tauri dev` regenerates the message catalogs (`src/locales/<lng>/messages.po`) on save, so new strings appear immediately via HMR. Untranslated strings fall back to English; the actual translations are managed in [Tolgee](https://tolgee.io) and delivered over the air, so they reach users without an app release. See [CONTRIBUTING.md](./CONTRIBUTING.md#translations) for the translator workflow.
361+
349362
## Roadmap
350363

351364
- [x] [[Feat]: Allow loading of multiple Databases per connection](https://github.com/TabularisDB/tabularis/issues/47)

0 commit comments

Comments
 (0)