Overwriting Translations not working in PHPStorm

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!
daveamweb
Posts: 2
Joined: 03 Aug 2021, 14:11

Overwriting Translations not working in PHPStorm

Post by daveamweb » 03 Aug 2021, 14:28

Hi everyone,

First I am new to Laravel and PHPstorm so I might be missing something obvious to everyone, but I am not seeing it.

I have Aimeos demo running and wanted to change the translation for Basket to Shopping cart as outlined here: https://aimeos.org/docs/latest/laravel/ ... anslations

In PHPStorm I am editing the shop.php file located in under project -> config -> Shop.php

The code I am using is copied from the documentation and is shown below.

Code: Select all

'i18n' => [
        'en_US' => [
            'client' => [
                'basket' => ['Shopping cart'],
            ],
        ],
	],
I am working on a Mac M1 (chip if it matters) with a Laravel environment built from Valet. I am running PHP 7.4, MySQL 8 and everything else is the latest.

Is there some cache that needs to be flushed or something? I have restarted NGINX and the valet framework to no success.

Thanks for helping.

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

Re: Overwriting Translations not working in PHPStorm

Post by aimeos » 03 Aug 2021, 15:53

Most likely, you don't have "en_US" in the Locale > Locale list of the admin backend and if yes it's not the one that's used by default. After installing Aimeos, "en" language is default and to change the translation for that language use:

Code: Select all

'i18n' => [
        'en' => [
            'client' => [
                'basket' => ['Shopping cart'],
            ],
        ],
],
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

daveamweb
Posts: 2
Joined: 03 Aug 2021, 14:11

Re: Overwriting Translations not working in PHPStorm

Post by daveamweb » 03 Aug 2021, 19:23

Thank you!

I did as you suggested, but unfortunately I am still seeing no change the the basket text.

After making the change do I need to flush any caches? I even restarted dnsmasq, NGINX and PHP just in case.

The whole demo site is showing in English, so I am thinking the language must be set to English too. I can login to the demo and the demo site runs just fine. Not sure what else I can add here that would be insightful.

Thank you

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

Re: Overwriting Translations not working in PHPStorm

Post by aimeos » 04 Aug 2021, 05:58

You need to clear the content cache using:

Code: Select all

php artisan aimeos:clear
Furthermore, change something in the basket so it's refreshed.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

greg1099etc
Posts: 3
Joined: 04 Aug 2021, 21:00

Re: Overwriting Translations not working in PHPStorm

Post by greg1099etc » 04 Aug 2021, 21:19

Laravel v8.52.0 (PHP v7.4.22); Aimeos 2021.07.04; Mac OSX 11.4

I am having the same issue (because we're working on the same project.

I have tried:

Code: Select all

php artisan aimeos:clear

Code: Select all

php artisan cache:clear

Code: Select all

brew services restart redis
... added a product to the 'basket', removed the product, and still getting the same results.

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

Re: Overwriting Translations not working in PHPStorm

Post by aimeos » 05 Aug 2021, 05:47

The strings are case sensitive. Can you try instead:

Code: Select all

'i18n' => [
        'en' => [
            'client' => [
                'Basket' => ['Shopping cart'],
            ],
        ],
],
This will change the name of the header in the offscreen basket if you click on the basket item.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

greg1099etc
Posts: 3
Joined: 04 Aug 2021, 21:00

Re: Overwriting Translations not working in PHPStorm

Post by greg1099etc » 05 Aug 2021, 12:45

That worked!

And so you're aware, the https://aimeos.org/docs/2021.x/laravel/ ... anslations does not reference case-sensitivty.

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

Re: Overwriting Translations not working in PHPStorm

Post by aimeos » 05 Aug 2021, 14:48

We've added a hint about case sensitivity now
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply