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..

Hi everyone, I have to create a new language FR for a shop but even if i have traduce the glossary.c

Options
U046CE1BNMU
U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet

Hi everyone,
I have to create a new language FR for a shop but even if i have traduce the glossary.csv and all the .csv files that need to be traduce i have this error :

Zed.CRITICAL: Spryker\Zed\DataImport\Business\Exception\DataSetBrokerTransactionFailedException - The key "title.fr_FR" was not found in data set. Available keys: "navigation_key, node_key, parent_node_key, node_type, title.en_US, url.en_US, css_class.en_US, title.de_DE, url.de_DE, css_class.de_DE, valid_from, valid_to, locales, idNavigation" in "/data/vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataSet/DataSetStepBrokerTransactionAware.php::59" {"exception":"[object] (Spryker\\Zed\\DataImport\\Business\\Exception\\DataSetBrokerTransactionFailedException(code: 0): The key \"title.fr_FR\" was not found in data set. Available keys: \"navigation_key, node_key, parent_node_key, node_type, title.en_US, url.en_US, css_class.en_US, title.de_DE, url.de_DE, css_class.de_DE, valid_from, valid_to, locales, idNavigation\" at /data/vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataSet/DataSetStepBrokerTransactionAware.php:59)
[stacktrace]

I can't touch this part of the code, does someone know how to change this ?

«1

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    Not 100% sure what is the problem but the exception seems to come from data from this file data/import/common/common/navigation_node.csv which gets executed here: src/Pyz/Zed/DataImport/Business/Model/NavigationNode/NavigationNodeWriterStep.php maybe this helps you to set the proper breakpoint and debug it

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    Thank you but i already know it, navigation_node.csv is the file that i traduce i need to passe the "title.de__DE" in "title.frFR" but when i do it i have this error and if i correctly understand the message, a "data set" exist and the title.fr__FR does'nt exist in it but i don't know where i can find this "data set"

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    src/Pyz/Zed/DataImport/Business/DataImportBusinessFactory.php the createNavigationNodeImporter() has “createLocalizedAttributesExtractorStep()” which seems to use locales defined from “createAddLocalesStep()”

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    edited November 2022
    Options

    and in src/Spryker/Zed/DataImport/Business/Model/DataImportStep/AddLocalesStep.php there is:

    protected function getLocales(): array
        {
            $locales = [];
    
            foreach ($this->storeFacade->getStoresAvailableForCurrentPersistence() as $storeTransfers) {
                $locales = array_merge($locales, $storeTransfers->getAvailableLocaleIsoCodes());
            }
    
            return $locales;
        }
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    and it seems there the fr_FR is not properly returned

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    I don't even have src/Spryker/...

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    How can i change it if i don't have access to this folder ?

  • UP8T3GKFH
    UP8T3GKFH Posts: 56 🧑🏻‍🚀 - Cadet
    Options

    Why so complicated? the importer doesn't find a entry with the added language key *.fr_FR in the navigation_node.csv file. So add two new columns with [title.fr](http://title.fr)_FR _and [url.fr](http://url.fr)_FR and fill the needed information (title in fr and the url in fr) that's it._

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    these two column already exist

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    there are already filled

  • UP8T3GKFH
    UP8T3GKFH Posts: 56 🧑🏻‍🚀 - Cadet
    Options

    But the error message says Available keys: "navigation_key, node_key, parent_node_key, node_type, title.en_US, url.en_US, css_class.en_US, [title.de](http://title.de)_DE, [url.de](http://url.de)_DE, [css_class.de](http://css_class.de)_DE, valid_from, valid_to, locales, idNavigation" and i do not see these two entries.

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    yes but they exist in the file, it's like you can't create an fr entry because something block it

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    I have a title.fr_FR entry in my csv file

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    “I don’t even have src/Spryker/...” - sry, i copied the wrong url. prefix that one with vendor/spryker/data-import/..

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    edited November 2022
    Options

    vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataImportStep/AddLocalesStep.php

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    It's a cloud configuration i don't have access to the vendor folder

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    You should be able to reproduce this locally, shouldnt you?

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    Yes but what the goal if i can't import it online after ?

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    So I agree that sometimes exceptions just happen with prod data or prod/staging environment and then you often need to look a bit more in these systems. but the first approach and way to go should be in my opinion to replicate the behavior locally so you can also test your fix properly. I am quite sure that if you touch navigation_node.csv and make it like the one in staging/prod that you likely will have similar behavior.

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    But i don't even understand what you want change in this file, i should find the de_DE and the en_US in this file if it return the locales values, no ?

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    And yes i have same behavior because fr_FR doesn't exist

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    it only exist in my csv file but your documentation don't explain how to create a language

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    no, i do not want to change anything in the file from vendor. But i personally would use it as starting point for debugging.

    Documentation is a bit thin, you are right. maybe https://docs.spryker.com/docs/scos/dev/tutorials-and-howtos/howtos/howto-set-up-stores-with-multiple-locales.html#configure-locales-for-store and https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/datapayload-conversion/multi-language-setup.html#configure[…]for-store give some hints.

    Did you change config/Shared/stores.php to have the fr_FR locale for your store there?

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    yes i do !

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    and i already read the two docs you just send

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    hmm.. then the only thing i see right now as next step to debug is to find what vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataImportStep/AddLocalesStep.php
    vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataImportStep/AddLocalesStep.php getLocales() returns

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    ok i start a locale server and i try it but i don't understand the point

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    How can i teste this function ?

  • U046CE1BNMU
    U046CE1BNMU Posts: 38 🧑🏻‍🚀 - Cadet
    Options

    test*

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 ⚖️ - Guardians (admin)
    Options

    with xdebug for example