How to translate pages /register and /login

Help for integrating the Laravel package
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!
IevIef
Posts: 17
Joined: 05 May 2018, 18:58

How to translate pages /register and /login

Post by IevIef » 19 Jul 2018, 16:01

How to translate words on pages /register and /login?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to translate pages /register and /login

Post by aimeos » 21 Jul 2018, 08:11

You can use the standard Laravel translation facility within the Blade templates. Please consult the Laravel documentation for details.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

IevIef
Posts: 17
Joined: 05 May 2018, 18:58

Re: How to translate pages /register and /login

Post by IevIef » 21 Jul 2018, 17:17

I made this how it need to be from Laravel side but how I can connect {locale} from Aimeos and {locale} from Laravel for situations when someone need to register or login with another than english language, the language which was chosen on laravel site for example de

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to translate pages /register and /login

Post by aimeos » 23 Jul 2018, 22:04

The {locale} URL placeholder is used for both, Laravel and Aimeos. You have to enable this for Aimeos URLs like described in the article about adding the language/currency selector:
https://aimeos.org/docs/Laravel/Add_loc ... tor#Routes
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

IevIef
Posts: 17
Joined: 05 May 2018, 18:58

Re: How to translate pages /register and /login

Post by IevIef » 25 Jul 2018, 17:44

All made by instruction and when I write in config/shop.php and enter index page (/list):

Code: Select all

'account' => ['prefix' => '{locale}', 'middleware' => ['web', 'auth']],
		'default' => ['prefix' => '{locale}', 'middleware' => ['web']],
		'confirm' => ['prefix' => '{locale}'],
		'update' => ['prefix' => '{locale}'],
it returned to me:
Sorry, the page you are looking for could not be found.

And if without 'prefix' keys it pass but no relevant local redirections too:

Code: Select all

'account' => ['{locale}', 'middleware' => ['web', 'auth']],
		'default' => ['{locale}', 'middleware' => ['web']],
		'confirm' => ['{locale}'],
		'update' => ['{locale}'],
What I made wrong?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to translate pages /register and /login

Post by aimeos » 26 Jul 2018, 21:22

When you add the "{locale}" prefix, the new URL is e.g. "/en/list" and not "/list"
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

IevIef
Posts: 17
Joined: 05 May 2018, 18:58

Re: How to translate pages /register and /login

Post by IevIef » 29 Jul 2018, 06:17

Got it, thank you :) Can I make {locale} depend on browser language if browser language of user is one of purposed on the site?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to translate pages /register and /login

Post by aimeos » 29 Jul 2018, 13:45

You can create a route for "/" that extracts the prefered locale from the $_SERVER super global and redirect then to /en/list or /de/list for example.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply