Skip to content

Translate what's new links - #1368

Merged
sejas merged 4 commits into
trunkfrom
add/STU-470-translate-links
May 12, 2025
Merged

Translate what's new links#1368
sejas merged 4 commits into
trunkfrom
add/STU-470-translate-links

Conversation

@sejas

@sejas sejas commented May 9, 2025

Copy link
Copy Markdown
Member

Related issues

Proposed Changes

  • Create a new function to translate links to blog posts

Testing Instructions

  • Run npm start
  • Click on your profile name at the top right corner
  • Change the language to Spanish or Japanese
  • Click on Help on the system menu
  • Click on "What's new" to open the modal
  • Navigate to the last card about Preview Sites.
  • Click on the link.
  • Observe the browser opens on the right blog post
whats-new-support-multiple-languages.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@sejas sejas changed the title Add/stu 470 translate links May 9, 2025
@sejas sejas self-assigned this May 9, 2025
@sejas
sejas requested a review from a team May 9, 2025 18:37

@gavande1 gavande1 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.

It opens the correct URL. LGTM 👍

@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.

Changes LGTM and it works well for me too! I managed to open the Spanish blog post by following the testing steps. 👍

@wojtekn wojtekn 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.

Works as expected.

'Easily identify your local Studio sites with custom domain names. Personalize and organize your workflow!'
),
learnMoreUrl: 'https://wordpress.com/blog/2025/03/31/studio-custom-domains-https/',
learnMoreUrl: translateLink(

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.

What if we followed the same approach as we took for docs, so we would have getBlogLink that checks if there is an internationalized URL and returns it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I thought about that. I'll create a second PR for that.

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.

Wouldn't it be mainly about renaming src/lib/translate-link.ts and its methods?

@sejas sejas May 12, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I miss-read your first comment. I thought you were suggesting to unify both functions, because I was thinking on that from the moment I created this PR. I also like having all the links indexed.

Check out this PR, and let me know what you think. It has the best from both worlds: #1375

@sejas
sejas merged commit 172e48f into trunk May 12, 2025
@sejas
sejas deleted the add/STU-470-translate-links branch May 12, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants