Skip to content

Build command does not set translations #6

@SevendaysCompany

Description

@SevendaysCompany

From loadNameTranslations() in Build.php

` foreach ($locales as $locale) {

        $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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions