Translate · Search params & storage
6 modules · 31 exports · 0 repositories · 2 e2e tests · 3 routes
The state Translate keeps in the URL and in the browser's storage. Every param has a default and never fails to decode, see Search params, and each definition should have an assertRoundTrips test. The definitions of the whole app are listed in the reference.
Search params
URL translateLanguageSearchParams
app/features/translate/translate-search-params.ts:6
| Param | Value | Default | Loader | Description |
|---|---|---|---|---|
page | page | 1 | true | |
namespace | v.nullable(v.pipe(v.string(), v.maxLength(100))) | null | true | Resets |
status | v.picklist(TRANSLATION_STATUSES) | "untranslated" | true | Resets |
search | v.pipe(v.string(), v.maxLength(100)) | "" | true | Resets |
Used in translate.$language.index.server.tstranslate.$language.index.tsxtranslate.$language.tsx
Web storage
localStorage draftsPersisted
app/features/translate/translate-persisted.ts:6
Drafts written on the /translate page, per language: namespace -> key -> draft
| Key prefix | translation-drafts__ |
|---|---|
| Value | v.record( v.string(), v.record(v.string(), v.object({ value: v.string(), source: v.string() })), ) |
| Default | {} |
Used in translate-drafts.ts
localStorage previewLanguagePersisted
app/features/translate/translate-persisted.ts:17
Language whose drafts are previewed on the site, null when not previewing
| Key | translation-preview |
|---|---|
| Value | v.nullable(v.picklist(TRANSLATABLE_LANGUAGES)) |
| Default | null |