$file = match ($model) {
Country::class => __DIR__ . "/../../data/translations/countries/$locale/country.php",
Language::class => __DIR__ . "/../../data/translations/languages/$locale/language.php",
Currency::class => __DIR__ . "/../../data/translations/currencies/$locale/currency.php",
};
if ( ! file_exists($file)) {
continue;
}
$translations = require $file;
foreach ($translations as $id => $name) {
$item = $model::find($id)?->setTranslation('name', $locale, $name)->saveQuietly();
}
The files you look for in the match are non-existent and the translations are never set. This results in only english in the JSON object for a translatable field in the DB. Could you please have a look at this?