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

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 ?

Welcome!

It looks like you're new here. Sign in or register to get started.
Β«1

Comments

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

    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

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

    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"

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

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

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)
    edited November 2022

    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;
        }
    
  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

    and it seems there the fr_FR is not properly returned

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

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

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

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

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

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

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

    these two column already exist

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

    there are already filled

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

    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.

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

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

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

    I have a title.fr_FR entry in my csv file

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

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

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)
    edited November 2022

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

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

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

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

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

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

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

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

    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.

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

    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 ?

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

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

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

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

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

    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?

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

    yes i do !

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

    and i already read the two docs you just send

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

    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

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

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

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

    How can i teste this function ?

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

    test*

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 βš–οΈ - Guardians (admin)

    with xdebug for example

Welcome!

It looks like you're new here. Sign in or register to get started.