ugarit-artifacts / i18n
Dynamic entity translations, multilingual dictionaries, locale resolution and RTL/LTR support
Requires
- php: ^8.3
- ugarit/framework: ^1.00.00
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-14 13:12:34 UTC
README
"Artifacts provide capabilities. Features define behavior."
The I18n Artifact is the locale registry of the Ugarit ecosystem. It stores languages and locales, resolves a locale code to a locale_id, and exposes that resolution as the translations capability other artifacts require.
It runs inside a host Ugarit application. It is not a standalone framework.
Documentation
- Overview
- Architecture
- Database schema
- Installation
- Roadmap
- Changelog
- Contributing
- Security
- Code of Conduct
- Contact
- License
Role in the ecosystem
| Layer | Package | Responsibility |
|---|---|---|
| Kernel | ugarit/framework |
Container, schema builder, capability and feature pipeline, translatable models |
| Artifact | ugarit-artifacts/i18n |
Languages, locales, and the database locale resolver |
| Artifact | ugarit-artifacts/geography |
Territorial hierarchy. locales.country_id points at countries |
art.php requires nothing. Geography requires the capability i18n.translations.
Capabilities
Declared in art.php:
| Slug | What the tables and the resolver store today |
|---|---|
languages |
ISO-sized language code, native name, LTR flag, translated name |
locales |
A language, optionally a country. The code is ar or ar-SA. One locale is the default |
translations |
DatabaseLocaleResolver: translation tables store locale_id, and only active locales are accepted for input |
The structural diagram, columns, keys, and delete rules are in SCHEMA.md.
Routes
Registered from routes/web.php with web and auth middleware.
| Kind | Path | Purpose |
|---|---|---|
| GET | /settings/locale |
Active locales for the preference form |
| POST | /settings/locale |
Store the chosen locale code in the session and a forever cookie |
| GET | /panel/artifact/i18n |
Artifact summary |
| RESOURCE | …/language, …/locale |
Capability CRUD |
| RESOURCE | …/language-feature, …/locale-feature (store, update) |
Save the record and its translations in one transaction |
| RESOURCE | …/{record}/{entity}-translation (store, update, destroy) |
One locale at a time |
Quick start
composer require "ugarit-artifacts/i18n:^2.00.00"
php scribe migrate
See Installation.
License
MIT. See LICENSE.md. Maintained by Muath R Abu Ouda.