henninghorn's avatar

Lumen 5.2 localization/translation/translator

Hi.

I've noticed that localization seems to be broken in Lumen 5.2. The method trans() is gone. But you can run it through $app['translator']->trans() instead.

But the translator seems to be loading the translations from the wrong place! If I dd($app['translator']) then I get a Translator object/class which contains a incorrect path for translations.

Translator {#38
  #loader: FileLoader {#31
    #files: Filesystem {#47}
    #path: "/home/vagrant/Code/project/api/vendor/laravel/lumen-framework/src/../resources/lang"
    #hints: []
  }
  #locale: "da"
  #fallback: "da"
  #loaded: []
  #selector: null
  #parsed: []
}

How do I fix this?

0 likes
1 reply
henninghorn's avatar

Normally the path would be:

/home/vagrant/Code/project/api/resources/lang

Please or to participate in this conversation.