Translation App Exceeds Google Word Limit for Commerce Placeholders
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 38
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 46
Description
The Commerce Storefront, built using DA.live, utilizes placeholder files containing strings for drop-in components. Localization and multistore support are handled via DA's Translation App, which relies on Google's translation service by default.
We are encountering an issue where some placeholder files exceed Google's word limit for translation, even after splitting them into smaller files. This is affecting the following files:
- https://main--aem-boilerplate-commerce--hlxsites.aem.live/placeholders/account.json
- https://main--aem-boilerplate-commerce--hlxsites.aem.live/placeholders/cart.json
- https://main--aem-boilerplate-commerce--hlxsites.aem.live/placeholders/order.json
Additionally, a CORS error is triggered when attempting to translate these files.
Upon investigation, the translation app appears to include extra content in the Google request, such as the first column (Key), which is not intended for translation. This unnecessary content contributes to the word count and pushes the request over the limit. Furthermore, content flagged as "do-not-translate" is not being excluded from the translation payload.
### Suggested Improvements
- Exclude the "Key" column and any content marked as "do-not-translate" from the translation request.
- Implement a more scalable solution by breaking long documents into smaller chunks before sending them to the translation service.
This issue currently blocks the Translation App for Commerce placeholders using the Google Translate Service.
Contributor guide
Research direction
Start by tracing the Translation App's Google translation request for account.json, cart.json, and order.json. Check how the Key column and do-not-translate content enter the payload, then determine how oversized documents and the reported CORS error are handled. Done means the three Commerce placeholder files can be translated without unnecessary content exceeding Google's limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100