Search by

Dynamic entity translations, multilingual dictionaries, locale resolution and RTL/LTR support

Package info

github.com/ugarit-artifacts/i18n

pkg:composer/ugarit-artifacts/i18n

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.00.04 2026-10-19 14:25 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

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.