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

load global extra translations into NovaServiceProvider? #15

Open
scramatte opened this issue Dec 2, 2022 · 0 comments
Open

load global extra translations into NovaServiceProvider? #15

scramatte opened this issue Dec 2, 2022 · 0 comments

Comments

@scramatte
Copy link

scramatte commented Dec 2, 2022

Hi,

I would like to use this package to add specific global application translation files.
I want to achieve this to avoid to overwrite nova official translation.

I've created the following file

resources/lang/vendor/myapp/es.json
And I load it into NovaServiceProvider

$this->loadTranslations(__DIR__ . '/../resources/lang/vendor', 'myapp', true);

Language file is loaded but labels are not translated on my resource page
For example, I've got "Country" resource with the following method and strangely when I access to the resource only HTML title is translated. If I append a translation string into the main nova translation file, it works as expected.

   /**
    * Get the displayable label of the resource.
    *
    * @return string
    */ 
    public static function label()
    {
        return __('Countries');
    }

image

What I've missed?

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