|
| 1 | +# Mwongozo wa Tafsiri / Translation Style Guide (Swahili · `sw`) |
| 2 | + |
| 3 | +This guide keeps the Swahili translation of react.dev **consistent** across pages and |
| 4 | +contributors. Read it before translating, and follow the glossary so every page uses the |
| 5 | +same word for the same React concept. Consistency is what makes the docs great to learn from. |
| 6 | + |
| 7 | +Before starting a page, **claim it** on the progress issue |
| 8 | +([#1](https://github.com/reactjs/sw.react.dev/issues/1)) so we don't duplicate work. One page |
| 9 | +per pull request keeps reviews small. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Golden rules |
| 14 | + |
| 15 | +1. **Translate prose, not code.** Translate the explanatory text. In code blocks, translate |
| 16 | + only `// comments` and clearly user-facing display strings (e.g. button labels, headings |
| 17 | + shown on screen). **Never** rename variables, functions, `props`, imports, or object keys — |
| 18 | + that would break the examples. |
| 19 | +2. **Keep heading anchors in English.** A heading like `## Your first component {/*your-first-component*/}` |
| 20 | + becomes `## Component yako ya kwanza {/*your-first-component*/}`. Translate the visible title; |
| 21 | + **leave the `{/*...*/}` slug exactly as-is** — it is the URL anchor and cross-page links depend on it. |
| 22 | +3. **Keep MDX components and their props untouched:** `<Sandpack>`, `<Note>`, `<Pitfall>`, |
| 23 | + `<DeepDive>`, `<LearnMore>`, `<YouWillLearn>`, `<Recap>`, `<Challenges>`, `<Diagram>`, `<Intro>`, etc. |
| 24 | + Translate the text *inside* them; never translate the tag names or attributes like `path=` / `name=`. |
| 25 | +4. **Keep core API terms in English**, with a short Swahili gloss in parentheses on first use per |
| 26 | + page — e.g. *component (kipengele)*, *state (hali)*. Developers need to recognize the real API |
| 27 | + names. After the first mention on a page, the English term alone is fine. |
| 28 | +5. **Don't translate:** JSX/HTML tags and attributes, file paths, URLs, package names, keywords |
| 29 | + (`import`, `export`, `return`, `const`), `console.log` output that code depends on, and proper |
| 30 | + nouns (React, JavaScript, DOM, JSON). |
| 31 | +6. **Tone:** clear, friendly, and direct — the same encouraging teaching voice as the English docs. |
| 32 | + Address the reader as *wewe* ("you"). Prefer plain, widely-understood Swahili over rare coinages. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Glossary (Kamusi) |
| 37 | + |
| 38 | +| English | Swahili convention | Notes | |
| 39 | +|--------------------|-------------------------------------------|-------| |
| 40 | +| component | **component** *(kipengele)* on first use | Keep English; homepage/Quick Start use *kipengele* for the gloss. | |
| 41 | +| props | **props** | Keep as-is. | |
| 42 | +| state | **state** *(hali)* on first use | Keep English; existing pages use *hali*. | |
| 43 | +| Hook | **Hook** | Keep, capitalized. | |
| 44 | +| render (verb) | **ku-render** / kuonyesha | Keep "render" as the technical verb; *kuonyesha* (to display) in plain prose. | |
| 45 | +| markup | **markup** | Keep as-is. | |
| 46 | +| JSX / HTML / CSS / DOM / UI | keep as-is | Acronyms stay in English. | |
| 47 | +| function | function *(kitendaji)* | Keep English; gloss once if helpful. | |
| 48 | +| variable | kigezo | | |
| 49 | +| value | thamani | | |
| 50 | +| array | array *(safu)* | | |
| 51 | +| object | object | Keep as-is. | |
| 52 | +| attribute / property | sifa | | |
| 53 | +| nested / to nest | kupachika / kuweka ndani | | |
| 54 | +| reusable | inayoweza kutumika tena | | |
| 55 | +| parent / child (component) | mzazi / mtoto | | |
| 56 | +| tree | mti *(tree)* | | |
| 57 | +| root | mzizi *(root)* | | |
| 58 | +| bug | hitilafu *(bug)* | | |
| 59 | +| pure function | pure function *(function safi)* | | |
| 60 | +| import / export | keep as JS keywords in code; in prose *kuingiza / kutoa* | | |
| 61 | +| browser | kivinjari | | |
| 62 | +| library | maktaba | | |
| 63 | +| user interface | kiolesura cha mtumiaji (UI) | | |
| 64 | +| to build (an app) | kuunda / kujenga | | |
| 65 | +| to declare | kutangaza | | |
| 66 | +| expression | usemi | | |
| 67 | +| operator | opereta | Prefer *opereta* (not *operesheni*). | |
| 68 | +| statement | kauli | e.g. *kauli ya `if`*. | |
| 69 | +| converter | kigeuzi | | |
| 70 | +| module | module | Keep as-is. | |
| 71 | +| node | nodi | Tree/graph node. | |
| 72 | +| bundle / bundler | bundle / bundler | Keep as-is. | |
| 73 | +| render tree | render tree | Keep English; gloss *(mti wa ku-render)* if needed. | |
| 74 | +| module dependency tree | module dependency tree | Keep English. | |
| 75 | +| snapshot | picha ya mnepo *(snapshot)* | | |
| 76 | +| side effect | side effect *(athari za pembeni)* | Keep English term. | |
| 77 | +| mutation / to mutate | mutation *(mabadiliko ya ndani)* / kubadili | Keep English noun. | |
| 78 | +| purity / pure | pure *(safi)* | Keep English. | |
| 79 | +| to configure | kusanidi | | |
| 80 | +| to encapsulate | kufungasha | | |
| 81 | +| to refactor | kuboresha muundo | | |
| 82 | +| separator | kitenganishi | | |
| 83 | +| suffix / prefix | kiambishi tamati / kiambishi awali | | |
| 84 | +| expression / templating | usemi / lugha ya templeti | | |
| 85 | + |
| 86 | +When you introduce a term not in this table, add it here in the same PR so the next contributor |
| 87 | +stays consistent. |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## Frontmatter |
| 92 | + |
| 93 | +Translate the `title:` value. Leave any other frontmatter keys (e.g. `canary`) untouched. |
| 94 | + |
| 95 | +```md |
| 96 | +--- |
| 97 | +title: Component yako ya kwanza |
| 98 | +--- |
| 99 | +``` |
0 commit comments