Skip to content

Localization does not work in some places #2515

Closed
@steveooo1

Description

@steveooo1
  • Laravel Version: 7
  • Nova Version: 3.3.2
  • PHP Version: 7.4.4

Description:

When trying to localize things like the Resource label()or singularLabel(), by using return __('Users'), it won't translate. Also in the sidebar: "Resources" and "Dashboard" does not translate... I have a correct de.json in resources/lang/vendor/nova/de.json and I load it via this:

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();

        Nova::serving(function (ServingNova $event) {
            Nova::translations(
                resource_path('lang/vendor/nova/'.app()->getLocale().'.json')
            );
        });
    }

app()->getLocale() return de (correct!).

The translations for the primary blue buttons like "Create :resource" does work fine!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions