What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

hello. is there any way to add en_GB locale? Do I need to setup new store for this? Or maybe can I c

U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

hello. is there any way to add en_GB locale? Do I need to setup new store for this? Or maybe can I change somehow default en_US to en_GB? Do I need to reinstall everything for this? as I understand en_US and en_GB can't live together because in spy_url database table field url is unique. And if we are going to add (using default csv import for example) some new categories with new urls for en_GB it will have the same url key? With en . It is confusing.

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    I have added new en_GB locale in stores.php like this

    'locales' => [
        // first entry is default
        'uk' => 'en_GB',
        'de' => 'de_DE',
        'en' => 'en_US',
    ],
    

    Also added new store

    $stores['GB'] = [
            'queuePools' => [
                'synchronizationPool' => [
                    'GB-connection',
                ],
            ],
            'storesWithSharedPersistence' => [],
        ] + $stores['DE'];
    

    Than I need to add some new categories for example.
    I added them in CSV just for testing and setup localizable attribute values for en_GB but import fails because of unique field. It takes the first part of locale (en in our case) here \Spryker\Zed\CategoryDataImport\Business\Model\CategoryWriterStep::findOrCreateNode L:148. And it is the same as for en_US . My assumption is that the url key for locale it should take from locales array in stores.php? What if i would like to add de_AT locale? It will fail as well because de already exists in spy_url table...

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yes, it is a limitation that we are planning to remove in the future. The workaround for now is to create an imaginary locale in your case gb_GB so that the logic will not fail.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    but in this case it is impossible to create at least admin user with this locale because this locale doen't exist in spy_locale table

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    and it can't create locale transfer object

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    and also if i want to import smth from akeneo for example - it will not work because from akeneo i will receive en_GB. this is not a solution

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    the only way to resolve it for now as I see - is to remove en_US store

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    I'm not a developer, but maybe you could override vendor/spryker/locale/src/Spryker/Zed/Locale/Business/Internal/Install/locales.txt on the project level and make some mapping between en_GB from Akeneo and gb_GB in Spryker.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes it is also a possible solution. but in this case i need to add this mapping everywhere. at least in all Akeneo import processes. as for me this is "ΠΊΠΎΡΡ‚Ρ‹Π»ΡŒ" if you know what i mean :)

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Yep, agree.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    the only way to resolve it for now as I see - is to remove en_US store

    if you don’t need en_US store - then that’s the cleanest approach, thought you need it

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    but it also can be an effort, depending how much you rely on demo data, configuration, and so on + data migration, potentially

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    as i understand i need to change locales everywhere in CSV files. at least in thoose what I need.
    What i need to do in configuration? just remove US store and change en_US to en_GB everywhere?

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    just do not forget the importers that are coming as core modules. You need to override them on project level to be able to change the file location.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    yeah. already found that some of them are not in data/import but in vendor... thanks