@atzentis/storage-locales
v0.2.0
Published
Language packs for @atzentis/storage-react and @atzentis/storage-expo
Maintainers
Readme
@atzentis/storage-locales
Zero-dependency, tree-shakeable locale packs for @atzentis/storage-react and [@atzentis/storage-expo].
Three languages (EN, DE, EL) across 7 domains: common, errors, files, folders, search, annotations, uploads.
Installation
pnpm add @atzentis/storage-localesUsage
import { en, de, el, type StorageLocalization } from "@atzentis/storage-locales";
// Or import a single locale (tree-shake friendly):
import en from "@atzentis/storage-locales/en";
import de from "@atzentis/storage-locales/de";
import el from "@atzentis/storage-locales/el";Every pack implements the same StorageLocalization interface — a flat
intersection of every domain's *Keys interface. Keys are
SCREAMING_SNAKE_CASE and are domain-prefixed everywhere except common
(e.g. FILES_DELETE, FOLDERS_RENAME, SEARCH_PLACEHOLDER,
ERROR_NETWORK). Each locale composes its files via spread:
const en: StorageLocalization = {
...common,
...errors,
...files,
...folders,
...search,
...annotations,
...uploads,
};The flat shape mirrors @atzentis/auth-sdk/locales so consumers can
look up keys with a single t(key) lookup without traversing nested
groups.
Adding a new key
- Add the key to the matching
src/types/{domain}.types.tsinterface. - Run
tsc --noEmit— every locale will fail until it provides a value. - Add the translation to each
en/{domain}.ts,de/{domain}.ts,el/{domain}.ts. - Re-run completeness tests in
@atzentis/storage-react(tests/locales/completeness.test.ts).
Default locale
DEFAULT_STORAGE_LOCALIZATION re-exports the English pack and is the safe fallback when a consumer can't determine the user's preferred locale.
import { DEFAULT_STORAGE_LOCALIZATION } from "@atzentis/storage-locales";License
MIT — © Atzentis
