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

Translations from JSON files are not working #29

Open
cedric-anne opened this issue Jul 7, 2021 · 0 comments
Open

Translations from JSON files are not working #29

cedric-anne opened this issue Jul 7, 2021 · 0 comments

Comments

@cedric-anne
Copy link

  1. Translation from JSON files are not exposed in window.translations.
    I was able to expose them using this following piece of code in I18nServiceProvider::translations().
        $translations = $translations->merge(
            collect(File::files(resource_path('lang')))->filter(function ($file) {
                return $file->getExtension() === 'json';
            })->mapWithKeys(function ($file) {
                return [
                    basename($file->getFilenameWithoutExtension()) => collect(json_decode($file->getContents(), true)),
                ];
            })
        );
  1. When exposing translations, thoose having a key containing a . are not working.
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