first commit
This commit is contained in:
37
docs/ui/react/react-auth/src/translations/cy-gb.md
Normal file
37
docs/ui/react/react-auth/src/translations/cy-gb.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# `cy-gb`
|
||||
|
||||
## Purpose
|
||||
|
||||
`cy-gb.ts` ships the Welsh (Cymraeg, `cy-GB`) translation pack for the auth surface. The file conforms structurally to `AuthTranslationPack` — every key present in `en-gb.ts` MUST be present here, otherwise `tsc` fails the typecheck gate. This guarantees Wave 2 form components can resolve any key in any locale without locale-specific guards. Pure data; no runtime code.
|
||||
|
||||
## Features
|
||||
|
||||
- Welsh copy across all 10 functional groups.
|
||||
- Compile-time conformance to `AuthTranslationPack`.
|
||||
- Default-exported for direct consumption (`import cyGb from "@suaveplan/react-auth/translations"`).
|
||||
|
||||
## Usage: Basic
|
||||
|
||||
```ts
|
||||
import { cyGb } from "@suaveplan/react-auth";
|
||||
console.log(cyGb.auth.login.title); // "Mewngofnodi"
|
||||
```
|
||||
|
||||
## Usage: Advanced
|
||||
|
||||
```ts
|
||||
import { authTranslations } from "@suaveplan/react-auth";
|
||||
|
||||
function detectLocaleAndResolve(prefersWelsh: boolean) {
|
||||
const locale = prefersWelsh ? "cy-gb" : "en-gb";
|
||||
return authTranslations[locale].auth.login.forgotPassword;
|
||||
}
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
- `default` — the Welsh translation pack of type `AuthTranslationPack`.
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
Translations are reviewed by a fluent Welsh speaker before each release; the strings here are the verbatim upstream copy. When a string would mention a date or a number, the Wave 2 form components will inject ICU-formatted values through `@suaveplan/i18n-icu-parser` — the strings stored here intentionally avoid pre-formatted numerics. Punctuation conventions (e.g. apostrophe usage, full-stop placement in error messages) follow standard editorial conventions for Welsh, matching the upstream pack.
|
||||
Reference in New Issue
Block a user