81 lines
2.3 KiB
Markdown
81 lines
2.3 KiB
Markdown
|
|
# Terminology
|
||
|
|
|
||
|
|
This repo now has a central terminology registry for admin-facing labels and key product nouns.
|
||
|
|
|
||
|
|
## Source of truth
|
||
|
|
|
||
|
|
- Frontend terminology lives in `frontend/src/lib/terminology.js`
|
||
|
|
- The default locale is `en-NZ`
|
||
|
|
- Admin pages should import the shared registry instead of hardcoding repeated labels
|
||
|
|
|
||
|
|
## Current structure
|
||
|
|
|
||
|
|
`frontend/src/lib/terminology.js` exports:
|
||
|
|
|
||
|
|
- `DEFAULT_TERMINOLOGY_LOCALE`
|
||
|
|
- `TERMINOLOGY_LOCALES`
|
||
|
|
- `getTerminology(locale)`
|
||
|
|
- `terminology`
|
||
|
|
|
||
|
|
The registry is grouped into:
|
||
|
|
|
||
|
|
- `common`
|
||
|
|
- `entities`
|
||
|
|
- `admin`
|
||
|
|
|
||
|
|
Example:
|
||
|
|
|
||
|
|
```js
|
||
|
|
import { terminology as t } from '$lib/terminology';
|
||
|
|
|
||
|
|
const clientLabel = t.entities.client.singular;
|
||
|
|
const sectionLabel = t.admin.sections.clients;
|
||
|
|
const pageTitle = t.admin.clients.title;
|
||
|
|
```
|
||
|
|
|
||
|
|
## How to update wording
|
||
|
|
|
||
|
|
If you want to rename a repeated term like `Client`, `Clients`, `Leads`, `Home`, or `Reporting`, update the relevant key in:
|
||
|
|
|
||
|
|
- `frontend/src/lib/terminology.js`
|
||
|
|
|
||
|
|
Any page already wired to the shared registry will pick up the new label automatically.
|
||
|
|
|
||
|
|
## Adding a new locale later
|
||
|
|
|
||
|
|
1. Add another top-level locale entry to `TERMINOLOGY_LOCALES`
|
||
|
|
2. Mirror the same object shape as `en-NZ`
|
||
|
|
3. Switch the selected locale through `getTerminology(locale)`
|
||
|
|
4. Avoid hardcoding user-facing copy in components if it belongs in the registry
|
||
|
|
|
||
|
|
Example outline:
|
||
|
|
|
||
|
|
```js
|
||
|
|
export const TERMINOLOGY_LOCALES = {
|
||
|
|
'en-NZ': { ... },
|
||
|
|
'fr-FR': { ... },
|
||
|
|
};
|
||
|
|
```
|
||
|
|
|
||
|
|
## Guidance
|
||
|
|
|
||
|
|
- Put repeated UI labels and key nouns in the terminology registry
|
||
|
|
- Keep one-off implementation details out of the registry unless they are also user-facing copy
|
||
|
|
- Prefer full copy keys for phrases that may need different grammar in another language
|
||
|
|
- If a page repeats the same wording in multiple places, move it into the registry
|
||
|
|
|
||
|
|
## Current admin coverage
|
||
|
|
|
||
|
|
The shared terminology registry is already wired into:
|
||
|
|
|
||
|
|
- `frontend/src/routes/admin/+layout.svelte`
|
||
|
|
- `frontend/src/routes/admin/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/members/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/members/new/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/members/[id]/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/leads/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/messages/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/bookings/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/walks/+page.svelte`
|
||
|
|
- `frontend/src/routes/admin/audit/+page.svelte`
|