Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build command does not set translations #6

Open
SevendaysCompany opened this issue Jun 7, 2023 · 0 comments
Open

Build command does not set translations #6

SevendaysCompany opened this issue Jun 7, 2023 · 0 comments

Comments

@SevendaysCompany
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant