How to stop conversion from cyrillic to latin in product URL segments?
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!
How to stop conversion from cyrillic to latin in product URL segments?
Laravel framework version: 9.38.0
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.12
Environment: Linux
Aimeos automatically translates cyrillic to latin when saving the product URL segment, how do I prevent this from happening?
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.12
Environment: Linux
Aimeos automatically translates cyrillic to latin when saving the product URL segment, how do I prevent this from happening?
Re: How to stop conversion from cyrillic to latin in product URL segments?
Because only latin characters are allowed in URLs, translation is always done automatically.
You can change that by adding a custom macro for the slug() method in the Aimeos string class:
https://github.com/aimeos/aimeos-base/b ... #L156-L165
Add that code toy our AppServiceProvider class.
You can change that by adding a custom macro for the slug() method in the Aimeos string class:
https://github.com/aimeos/aimeos-base/b ... #L156-L165
Code: Select all
\Aimeos\Base\Str::macro( 'slug', function( $str, string $lang = 'en', string $sep = '-' ) : string {
return $str;
} );
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: How to stop conversion from cyrillic to latin in product URL segments?
Thanks, that works.
I added the code inside public function boot()
This is needed because I need to keep the original cyrillic URLs of an existing shop.
I added the code inside public function boot()
This is needed because I need to keep the original cyrillic URLs of an existing shop.