Translation status
For admin completeness UIs, query status for one field or across every translatable attribute in one call. Everything is measured against the supported locales:
// Stored: name = {"en": …, "sk": …}, description = {"en": …}
$topic->missingLocales('description'); // ['sk'] — one field
$topic->missingTranslations(); // ['name' => [], 'description' => ['sk']] field => missing locales
$topic->isFullyTranslated(); // false — every field needs every supported locale
$topic->isFullyTranslated('name'); // true — one attribute only
$topic->translationCompleteness(); // 0.75 — filled / (fields × locales), for a progress bartranslationCompleteness() is filled / (fields × locales) — ready for a “70% translated” progress bar. A model with no status attributes counts as fully translated (1.0).
Excluding attributes
Exclude a column — typically the slug — from whole-model status by overriding a protected method. missingTranslations(), isFullyTranslated() without an argument, translationCompleteness() and the Blade badge all respect it:
/** @return list<string> */
protected function translationStatusExcludes(): array
{
return ['slug'];
}Blade status badge
Drop the “which locales are still missing” badge into any Blade view:
<x-translatable-status :model="$topic" />It renders each field’s missing locales for a partially translated model, or a complete badge when the model is fully translated. The markup is inline — there’s no view to publish — so style the translatable-status classes or wrap it in your own component:
<!-- Partially translated -->
<span class="translatable-status translatable-status--incomplete">
<span class="translatable-status__field" data-field="description">description: sk</span>
</span>
<!-- Fully translated -->
<span class="translatable-status translatable-status--complete">All locales translated.</span>The complete label is the translatable::status.complete language line (“All locales translated.”).
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.