CMM-2132: Send the app language slug when fetching blogging prompts#23057
Draft
nbradbury wants to merge 1 commit into
Draft
CMM-2132: Send the app language slug when fetching blogging prompts#23057nbradbury wants to merge 1 commit into
nbradbury wants to merge 1 commit into
Conversation
The blogging prompts fetch relied on the framework's default _locale, which is region-qualified (e.g. tr_TR). WP.com content endpoints resolve translations by the clean language slug (tr), so pass PerAppLocaleManager's language code explicitly and disable the framework locale for this request, matching how Reader and Stats already localize content. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #23057 +/- ##
=======================================
Coverage 37.44% 37.44%
=======================================
Files 2326 2326
Lines 125606 125619 +13
Branches 17249 17249
=======================================
+ Hits 47035 47043 +8
- Misses 74748 74753 +5
Partials 3823 3823 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
A Turkish customer reported that daily blogging prompts were appearing in English even though the app language was set to Turkish (CMM-2132).
After looking into this it appeared the problem was that we were requesting prompts using the language code
tr_TRinstead of the correct code (tr). This PR resolves this, but it doesn't fix the problem - which suggests a problem with the backend.This change is still a legitimate correctness fix (sends the properly-formatted slug, consistent with Reader/Stats) and is a prerequisite for prompt localization to ever work, but the ticket also needs a backend follow-up to confirm/add prompt translations.
Testing instructions
Prerequisites: a WordPress.com or Jetpack site with the Blogging Prompts card enabled.
Verify the request format:
adb shell setprop log.tag.Volley VERBOSE), confirm the request is.../wpcom/v3/sites/{id}/blogging-prompts/?...&_locale=<slug>with a clean slug (e.g.tr), and that there is no duplicate_localeparameter.Regression check:
BloggingPromptsRestClientTest/BloggingPromptsStoreTest, WordPressFetchBloggingPromptsListUseCaseTest/BloggingPromptCardViewModelSliceTest).