Conversation
|
@greptileai review |
Greptile SummaryUpdates translation flows to resolve their locale through the configured content-language resolver instead of assuming the content scope has a
Confidence Score: 5/5The PR appears safe to merge, with the prior regression-coverage concern resolved and no outstanding correctness or repository-rule violations. The new tests cover locale-sensitive page slug generation and both Azure translation paths for scopes without a language dimension. The cross-module import concern was correctly disputed and subsequently conceded because this package does not provide the suggested alias and consistently uses parent-relative imports. Important Files Changed
Reviews (4): Last reviewed commit: "cms-admin: Resolve the translation langu..." | Re-trigger Greptile |
6115e00 to
3549d56
Compare
The Azure translator provider and the page tree translate action both read the language from scope.language, which only exists in projects whose content scope contains a language dimension. Resolve it through the contentLanguage config instead, consistent with createEditPageNode. Cover both flows with tests that use a scope without a language dimension, so the mistake cannot come back unnoticed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WMDmoPW9RMKuoikmbr7MaP
3549d56 to
adccc10
Compare
|
@greptileai review |
AzureAiTranslatorProvideranduseTranslatePagesActionread the content language straight off the content scope —targetLanguage: scope.languagefor the Azure queries,transformToSlug(translatedName, scope.language)for the translated page name. That only works in projects whose content scope happens to have alanguagedimension. Everywhere else the translator is asked to translate intoundefined, and translated page names are slugified without a locale, so a German name becomesuber-unsinstead ofueber-uns.ContentScopeis declared with an index signature, so reading a dimension that doesn't exist type-checks and nothing ever failed.Both now resolve the language through
useContentLanguage, which goes through thecontentLanguageconfig projects already pass toDextinityConfigProvider:createEditPageNodealready slugified this way, so the two slug paths agree again.Both flows get a regression test using a scope without a
languagedimension:AzureAiTranslatorProvider.test.tsxasserts thetargetLanguagesent for the single and the batch query, anduseTranslatePagesAction.test.tsxasserts that the translated name is slugified with the resolved locale (Über uns→ueber-uns, where slugify without a locale givesuber-uns). Reverting either fix makes the corresponding tests fail.Session: https://claude.ai/code/session_01WMDmoPW9RMKuoikmbr7MaP