show EUR instead €

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
DavideBrocca1
Posts: 2
Joined: 13 Sep 2023, 08:23

show EUR instead €

Post by DavideBrocca1 » 13 Sep 2023, 08:30

Hi, I have the site in Italian, and it shows me the writing EUR instead of the € symbol, creating some graphic errors. If instead I set the site in English the symbol appears correctly, but obviously I need the site in Italian. How can I solve it?

I'm using
php_version: "8.1"
aimeos/aimeos-laravel: "2023.04"
Laravelframework: "^10.10"

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

Re: show EUR instead €

Post by aimeos » 13 Sep 2023, 09:53

There's no translation file for currency symbols for Italian (like for EN and other languages):
https://github.com/aimeos/aimeos-core/b ... ency/en.po

You can add a translation in your ./config/shop.php instead:

Code: Select all

'i18n' => [
	'it' => [
		'currency' => [
			'EUR' => ['€']
		]
	]
]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
DavideBrocca1
Posts: 2
Joined: 13 Sep 2023, 08:23

Re: show EUR instead €

Post by DavideBrocca1 » 13 Sep 2023, 10:15

thank you so much ! it works.
Is there a way to make the symbol appear before the writing?
Attachments
Screenshot 2023-09-13 alle 12.14.05.png
Screenshot 2023-09-13 alle 12.14.05.png (16.49 KiB) Viewed 23475 times

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

Re: show EUR instead €

Post by aimeos » 13 Sep 2023, 10:21

You can change the order via translation too:

Code: Select all

'i18n' => [
	'it' => [
		'client' => [
			'%1$s %2$s' => ['%2$s %1$s']
		]
	]
]

See also: https://github.com/aimeos/ai-client-htm ... ce.php#L55

But that's only half of the truth. There are places in the JS code where the order of price value and currency symbol is determined by the browser and the locale and that is harder to change.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
DavideBrocca
Posts: 2
Joined: 30 Jun 2023, 08:23

Re: show EUR instead €

Post by DavideBrocca » 18 Sep 2023, 12:46

thanks for the answer but it doesn't work. this is my code, it's right?
Attachments
Screenshot 2023-09-18 alle 14.45.50.png
Screenshot 2023-09-18 alle 14.45.50.png (44.57 KiB) Viewed 22693 times

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

Re: show EUR instead €

Post by aimeos » 18 Sep 2023, 21:32

Sorry, in the code from the template the link points to prefers another translation first:

Code: Select all

'i18n' => [
	'it' => [
		'client/code' => [
			'price:default' => ['%2$s %1$s']
		]
	]
]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply