Menu
Feedback
Known issues
Specification Values not being translated in Intelligent Search side
Intelligent Search
ID: 784129
Backlog
Published on9/23/2024
Last updated on9/26/2024
2 min read

Summary

Translating fields from one language to another using vtex.catalog-graphql app and making them available to be searched inside the Intelligent Search is not working properly.

The indexing process and the vtex.catalog-graphql_ _app differ when handling Specification Values. The difference is that when calling vtex.messages, the indexing process uses the Specification Value's FieldValueId, and when registering translations, the vtex.catalog-graphql uses the Specification's FieldId. This subtle difference results in translations of Specification Values created using the vtex.catalog-graphql app not being picked up during the indexing process.

Simulation

Follow the guide about translation specification values: https://developers.vtex.com/docs/guides/catalog-internationalization

Check that the translation won't reflect on facets on the IS side.

Workaround

  • Get all Specification Values that you need to translate and their FieldValueIds.

  • Use the translated query to grab the current translation from the messages app using the FieldId as context (in the example below, Red is the Specification Value, and 1 is the _FieldId _for a Color specification).

    query GetTranslation($args: TranslateArgs!) {translate(args: $args)}{"args": { "indexedByFrom": [   {      "from": "en-US",      "messages": [        {          "content": "Red",          "context": "1"        }     ]    } ], "to": "pt-BR"}}

  • Create a new translation using the FieldValueId as context and the translate mutation (in the example below, 11 is the FieldValueId for the Specification Value Red).

    mutation Save($saveArgs: SaveArgsV2!) {saveV2(args: $saveArgs)}{"saveArgs": { "to": "pt-BR", "messages": [   {      "srcLang": "en-US",      "srcMessage": "Red",      "context": "11",      "targetMessage": "Vermelho"    }]}}

In summary, instead of saving the "context" property based only on fieldValueId, you will also need to save it in the messages' context using the fieldId.

Note that both translations are required since different parts of the store will use different ways to query it; the "FieldValueId" is used by the Catalog/Search information, and the "FieldId" may be used directly by the Store Framework.

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback