@atzentis/auth-locales
v0.3.0
Published
Language packs for @atzentis/auth-react and @atzentis/auth-expo
Downloads
32
Maintainers
Readme
@atzentis/auth-locales
Language packs for @atzentis/auth-react and @atzentis/auth-expo.
Provides type-safe localized strings for all authentication, account, organization, and security flows across three languages: English, German, and Greek.
Installation
pnpm add @atzentis/auth-localesUsage
Import a locale pack
import en from "@atzentis/auth-locales/en";
import de from "@atzentis/auth-locales/de";
import el from "@atzentis/auth-locales/el";
// Use with AuthProvider
<AuthProvider localization={en}>
{children}
</AuthProvider>Import the aggregate type
import type { AuthLocalization } from "@atzentis/auth-locales";
const myLocale: AuthLocalization = {
SIGN_IN: "Sign in",
// ... all required keys
};Access locale keys
All locale objects are flat key-value maps. Keys are UPPER_SNAKE_CASE strings:
import en from "@atzentis/auth-locales/en";
console.log(en.SIGN_IN); // "Sign in"
console.log(en.INVALID_EMAIL); // "Invalid email address"
console.log(en.CHANGE_PASSWORD); // "Change Password"Supported Languages
| Code | Language | Native Name |
|------|----------|-------------|
| en | English | English |
| de | German | Deutsch |
| el | Greek | Ελληνικά |
Package Structure
The locale is organized into 10 domains, all merged into a single flat object per language:
| Domain | Keys | Description |
|---------------|------|---------------------------------------------------|
| account | ~62 | Profile, email, avatar, API keys, OAuth providers |
| auth | ~54 | Sign in, sign up, magic link, OTP, OAuth |
| common | ~19 | Buttons, labels, generic messages |
| errors | ~46 | Validation, auth, network, and state errors |
| organization| ~77 | Create, invite, members, roles, invitations |
| passkey | ~15 | WebAuthn passkey registration and management |
| password | ~33 | Change, reset, recovery flows |
| session | ~61 | Sessions, devices, login activity |
| twoFactor | ~30 | TOTP setup, backup codes, verification |
| verification| ~10 | Email and phone verification |
Type Safety
Import AuthLocalization for full TypeScript autocomplete and compile-time key validation:
import type { AuthLocalization } from "@atzentis/auth-locales";
// TypeScript will catch missing or misspelled keys
const customLocale: AuthLocalization = { ... };Domain-specific key types are also available:
import type {
AccountKeys,
AuthKeys,
CommonKeys,
ErrorKeys,
OrganizationKeys,
PasskeyKeys,
PasswordKeys,
SessionKeys,
TwoFactorKeys,
VerificationKeys,
} from "@atzentis/auth-locales";Features
- Type-safe with full TypeScript interfaces for all 10 domains
- Zero runtime dependencies
- ESM-only (tree-shakeable)
- UTF-8 with proper diacritics for all languages (ä, ö, ü, ά, ό, ώ)
- Consistent key naming across all three language packs
- Automated parity tests ensure structural alignment
Contributing a New Language
- Copy the
src/en/directory structure as a template - Create
src/{lang}/with translated versions of all 10 domain files - Create
src/{lang}/index.tsthat spreads all domains into a singleAuthLocalizationobject - Add the new locale to
src/index.tsas a named export - Update
tsup.config.tsto include the new locale entry point - Update
package.jsonexports to add"./{lang}"entry - Add tests verifying parity against the English reference locale
- All 10 domain files must be present with no missing keys
License
MIT
