Skip to content

Add locale parameter support for blueprint translations - #2363

Merged
epeicher merged 1 commit into
trunkfrom
stu-1154-studio-blueprint-descriptions-are-not-translated
Jan 9, 2026
Merged

Add locale parameter support for blueprint translations#2363
epeicher merged 1 commit into
trunkfrom
stu-1154-studio-blueprint-descriptions-are-not-translated

Conversation

@epeicher

@epeicher epeicher commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

This PR adds locale parameter support to the blueprints endpoint to ensure blueprint descriptions are returned in the user's configured language.

  • Modified the getBlueprints API query to accept and pass an optional locale parameter to the WordPress.com endpoint
  • Updated blueprint components to retrieve the user's configured locale from the i18n store and pass it to the API

Testing Instructions

  1. Apply the following changes to your sandbox 199274-ghe-Automattic/wpcom
  2. Sandbox the public-api
  3. Start the app with npm start
  4. Change your system language or app locale to a non-English language (e.g., Spanish, French, German)
  5. Navigate to "Add New Site"
  6. Select "Create from a blueprint" option
  7. Verify that the blueprint descriptions appear in the selected language
  8. Test with multiple different locales to ensure the translation works correctly
  9. Verify that if locale is not set, the API still works with the default English descriptions

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
The server will return the translated blueprints
@epeicher
epeicher marked this pull request as ready for review January 8, 2026 10:36
@epeicher
epeicher requested a review from Copilot January 8, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds locale parameter support to the blueprints API endpoint to enable blueprint descriptions to be returned in the user's configured language. The implementation ensures that when users view available blueprints, they see descriptions translated to their selected language preference.

  • Modified the getBlueprints API query to accept an optional locale parameter
  • Updated blueprint-consuming components to retrieve and pass the user's locale from the i18n store

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/stores/wpcom-api.ts Updated getBlueprints endpoint to accept optional locale parameter and append it to the API request URL
src/modules/add-site/index.tsx Added useI18nLocale hook import and passed locale to useGetBlueprints
src/modules/add-site/components/blueprints.tsx Added useI18nLocale hook import and passed locale to useGetBlueprints for refetch functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@epeicher
epeicher requested a review from a team January 8, 2026 11:31
@epeicher epeicher self-assigned this Jan 8, 2026

@gcsecsey gcsecsey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on these changes @epeicher! 👍

This LGTM and works well when testing different locales.

English German Italian
Image Image Image
@epeicher
epeicher merged commit c86f8fe into trunk Jan 9, 2026
22 checks passed
@epeicher
epeicher deleted the stu-1154-studio-blueprint-descriptions-are-not-translated branch January 9, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants