-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate only SW6 entity content with value in main language #51
base: main
Are you sure you want to change the base?
Translate only SW6 entity content with value in main language #51
Conversation
… the main language
Hi there thanks again for this Warning: Undefined array key "product_id" in /src/Bundles/Storage/Shopware6/Service/TranslationLoader.php on line 141 but nevertheless, i think i like the feature
|
…no column filter is used instead of the whole array
Hi,
I'm not really happy with the naming myself, but I haven't come up with anything better yet
Unfortunately I was unable to reproduce this, but I think i found the bug anyway it should now be fixed.
Exactly. Perhaps an addition: It does not specifically limit the fields, but ensures only consider fields that are existing and filled in the Shopware default language PER PRODUCT. For example in a Shopware Shop with the default language german Product A has a name, description, and a meta-title filled in german. For Product A the fields "name", "description" and "meta-title" are considered/translated for all other languages. This is important for us as we get the german texts from an external leading system, and it's okay for us if a product has no description. Without this customization, however, this would be reported on every execution/validation. The only important thing for us is that the existing german (default language) texts for entities are translated into all other languages.
The key difference is that the filters apply to the whole set, while my solution works dynamically per product/entity. For example if I exclude (filter) "description" it will be excluded for every product. But I want to exclude it only for products where it has no value in the shop default language. For this reason it can not be static. However, the filter logic is of course still useful to exclude something like I hope that was somewhat understandable |
Hi there i like the feature, although not everyones case, but a valid case ill give it another shot and then well figure out a good naming :) |
Hi so the main branch now has an option to provide base=true for a locale so what is left now, at least with the naming is to create a config to use that dynamic approach |
Hi, sorry for the late reply, I've been quite busy.
The attribute property
As far as I understand it, the first point should now be represented by the That's fine with me However, my solution had previously assumed that If, on the other hand, we assume that we always want to use the source language that is also defined as the main language in the SW instance, we could also use the fixed UUID directly (https://github.com/shopware/shopware/blob/ddb5890daa96a0370db878bf3ec29da647018e49/src/Core/Defaults.php#L17). However, this of course makes it less flexible and would decouple it from the configuration. |
As noted in #47, it is currently not possible to only consider content for entities that have a value in the standard language.
For example, if an article does not have a meta description in the main language, this should neither be considered as missing during validation nor during translation.
This PR contains a first rough approach on how to solve this in the context of Shopware6-Storage without adapting the basic logic of the framework.
Is there any interest in extending the existing storage accordingly, or would it be better to create a separate storage service for this purpose?