Getting the current language in Aimeos
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Getting the current language in Aimeos
I want to check the current language to switch the HTML rendering from Left To Right to Right To Left. I've checked it using
but it always displays ltr. How to achieve that?
Code: Select all
dir="{{ Lang::locale() === "en" ? "ltr" : "rtl" }}"
Re: Getting the current language in Aimeos
You can use
Code: Select all
App::isLocale('en')
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Getting the current language in Aimeos
the code
returns 1 which will always display one direction only, I'm using the select/locale switcher from aimeos.
And I tried setting the locale in the service provider to get it to work and it does, but the product language are independent from the global locale I've set.
Code: Select all
App::isLocale('en')
And I tried setting the locale in the service provider to get it to work and it does, but the product language are independent from the global locale I've set.
Re: Getting the current language in Aimeos
Aimeos is using the "locale" parameter and you can set it in a custom middleware to that value so it's available in the App facade:
https://dev.to/fadilxcoder/adding-multi ... ravel-4ech
https://dev.to/fadilxcoder/adding-multi ... ravel-4ech
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star