Repository navigation
Locale
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Models\Locale is the ActiveRecord model for locales (language + country), translation files, and app default locale behavior.
getDefault(): ?Locale-
getByRepresentation(string $representation): ?Locale(e.g.en-GB) getDefaultByLanguage(string $languageCode): ?Locale
getRepresentation(string $separator = '-'): stringisDefault(): boolisOfficialLanguage(): boolisDefaultCountry(): bool
getFilePath(string $module): stringreadTranslation(?Module $module): arraywriteTranslation(array $strings, ?Module $module): boolisFileWritable(string $moduleName): bool
$locale = \Pair\Models\Locale::getByRepresentation('en-GB');
$code = $locale?->getRepresentation();Read common translations:
$strings = $locale->readTranslation(null);Write module translations:
$locale->writeTranslation([
'WELCOME' => 'Welcome',
'SAVE' => 'Save'
], $module);See also: Translator, User, Configuration-file.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4