GithubHelp home page GithubHelp logo

Comments (5)

andrey-helldar avatar andrey-helldar commented on June 15, 2024

Did you only install the laravel-lang/lang package or something else?

Laravel now does not contain translation files by default and if they are not explicitly published using the php artisan lang:publish built-in command or using our installer, then I can assume that the mcamara/laravel-localization package cannot detect it.

In addition, I will say that the Laravel Lang project does not provide routing capabilities. We only translate messages. The programmatic solution for changing the URL is mcamara/laravel-localization, which we have nothing to do with.

from lang.

greggh avatar greggh commented on June 15, 2024

Thanks or the quick response!

No, I followed the instructions here: https://laravel-lang.com/installation/

So I have these installed:
laravel-lang/common
mcamara/laravel-localization

In my Kernel.php I have the LocaleSessionRedirect:
'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class,

And when I use my code in a web browser, everything is working great.

But now it seems like I should be talking to mcamara/laravel-localization!

from lang.

andrey-helldar avatar andrey-helldar commented on June 15, 2024

If the Mcamara package really does not find localization files (if it does exactly that, which I cannot say), then try publishing them first by calling the console command php artisan lang:update

from lang.

greggh avatar greggh commented on June 15, 2024

I call the lang:update in the update script section in composer.json. So that is happening. I think it's something about how that package handles routing when in tests, like everything doesnt get called. I am going to go look at it from that side now.

from lang.

andrey-helldar avatar andrey-helldar commented on June 15, 2024

So, everything turned out to be even simpler: the mcamara/laravel-localization package determines the list of available localizations from its own configuration file.

The "Laravel Lang: Publisher" project has a list of available localizations, but it does not meet the requirements of mcamara/laravel-localization. We have an enum class, and they have an associative array.

Thus, you need to manually activate the desired localizations through the settings file.

Thank you for your message!

If you have any questions do not hesitate to contact us.

from lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.