Deafault shop, default snippets in different localisation than DE or EN

I have a multishop enviroment with sub-shops. The main shop is in hungarian language, the sub shops are in czech, slovak, croatian etc.

If i go to Configuratuion->Snippets i see only the default de_DE and en_GB tabs and the additional tabs cs_CZ, sk_SK, hr_HR but i can’t see the maon shop locale hu_HU!

Why? How can I add the hungarian language to edit the snippets? At the main shop’s settings there is the hungarian locale was choosen. (as the others have choosen their locales)

The tab for the hungarian language should be available as soon as one of your shops hast this locale.

If it is missing, you need to create a snippet in the database with the combination of the language and the shopID 1. Somethink like this:

INSERT INTO `s_core_snippets` (`id`, `namespace`, `shopID`, `localeID`, `name`, `value`, `created`, `updated`, `dirty`) VALUES ('0', 'backend/activate/skeleton', '1', (SELECT id FROM `s_core_locales` WHERE `locale` LIKE 'hu_HU'), 'WindowTitle', 'Cache leeren', '2019-06-06 08:59:44', '2019-06-06 08:59:44', '0');

As soon as there is one snippet with the combination locale + shopID1 the tab will be shown.

1 Like

Okay, thanks. I’ve had only the main shop configured as hungarian language, the sub shops has only other languages.

I think it is a bug when the main shop’s locale doesn’t appear on the snippets translation except you have the same locale in one of the sub shops.

Anyway your solution is greatly working, thanks!

How can I refresh my translation from the crowdin repositroy? If I can, I’ll translate there and import it to my project. If I can’t I’ll translate it on my project and somehow I’ll send you to the crowdin to import it later.

The Crowdin Import/Export is a bit complex. There are only two solutions:

  • Add your translation directly to crowdin and wait for us to release it as a plugin

  • Translate the Snippets directly in your shop and Export the s_core_snippets (perhaps only hungarian language) later on and send it to us.

Okay, I may choose the second version. If I have translated strings, I’ll let you know how can you access to import.

Anyway i found a bug in snippet export Shopware_Controllers_Backend_Snippet in encodeLine() function. I tried to export the snippets into csv and it adds an apostrophe before all fields value as it is written in line 905.

I’ve created a Pull Request some time ago for this issue: Change escaping for snippets on csv export by mnaczenski · Pull Request #2139 · shopware/shopware · GitHub