novius/laravel-translatable
A Laravel package that makes Eloquent models translatable using just two fields: locale and locale_parent_id. The trait adds translation relations, a translate() helper, getTranslation() lookup, and a withLocale() query scope.
locale_parent_id. This is record-level content translation, not UI string localization.translate(), getTranslation(), withLocale() scope—so the team can focus on editorial UX and fallback behavior rather than plumbing.translatableConfig() (locale whitelist, column names) and translateAttributes() (derived/transformed fields) become explicit product/engineering agreements—e.g., whether a slug or SKU is copied, localized, or generated.For executives: “This package is a low-lift way to add multilingual content to our Laravel app without building a custom translation subsystem. It can shorten time-to-market for localized product pages, CMS content, or documentation by reusing Laravel’s ORM and schema tooling. The trade-offs are real: it is AGPL-3.0 licensed, has essentially no community adoption, and provides no editorial workflow, translation history, or fallback logic. I recommend treating it as a time-boxed pilot candidate, contingent on legal review and a production-like performance test—not a platform commitment. If the pilot succeeds, we get international expansion with less custom code and lower initial cost; if not, we avoid over-investing in a niche dependency.”
For engineering: “This is a lightweight Eloquent trait: a translatable() migration macro adds locale and locale_parent_id, and the trait adds translate(), getTranslation(), translations, translationsWithDeleted, and withLocale(). We can whitelist locales and rename columns via translatableConfig(), and transform attributes before saving via translateAttributes(). Key caveats: because all locales live in one table, an unscoped query returns duplicate content—we must enforce locale scoping in a base repository or global scope; fallback behavior, soft-delete lifecycle, and orphan cleanup are ours to build; and we must index locale and locale_parent_id. Given the low adoption and single-maintainer risk, start with one model, measure query performance, and get AGPL compliance signed off before shipping.”
How can I help you explore Laravel packages today?