Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Make "VS Code" and "PHPStorm" translatable #48

Merged
merged 5 commits into from
Apr 29, 2024

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Apr 26, 2024

Proposed Changes

This PR makes the texts "VS Code" and "PHPstorm" translatable. Since these terms are proper nouns, the text may be the same in any language, but I think all text present in the app should be translatable.

Testing Instructions

If it is the default language, the Overview tab content should continue to display as before.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@sejas
Copy link
Member

sejas commented Apr 26, 2024

Thanks for the PR!
The code looks good, although I'm not sure if those app names should be translatable 🤔 .

I've seen that PhpStorm is called the same in other languages like Japanese.

https://www.jetbrains.com/ja-jp/phpstorm/

Screenshot 2024-04-26 at 20 55 19

@t-hamano
Copy link
Contributor Author

t-hamano commented Apr 27, 2024

Thanks for the review!

Indeed, in Japanese these terms remain the same. However, when looking at WordPress core, it seems that depending on the language, there may be no spaces before or after the term depending on the translation or context.

Below is an example of how "YouTube URL" is translated into different formats and terms.

Arabic

https://translate.wordpress.org/projects/wp/dev/ar/default/?filters%5Bterm%5D=YouTube+URL&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc

  • Please enter a valid YouTube URL. > من فضلك أدخل رابط يوتيوب صالح.
  • Or, enter a YouTube URL: > أو, أدخل رابط يوتيوب:

Dutch (Belgium)

https://translate.wordpress.org/projects/wp/dev/nl-be/default/?filters%5Bterm%5D=Please+enter+a+valid+YouTube+URL.&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc

  • Please enter a valid YouTube URL. > Voer een geldige YouTube-URL in.

@SiobhyB
Copy link

SiobhyB commented Apr 28, 2024

I found those examples really useful, thank you for sharing @t-hamano!

For further context, we explicitly prevented those strings from being translatable in b62b169 after it was noted that the button text was being incorrectly translated:

image

Screenshot by @fluiddot

As the buttons only display the app name, with no other text, maybe we don't need to make the button label translatable? Alternatively, perhaps a note for translators would prevent this issue?

The changes to the error message look good to me, to allow for the differences in grammar you noted.

t-hamano and others added 3 commits April 29, 2024 10:45
Co-authored-by: Siobhan Bamber <siobhan@automattic.com>
Co-authored-by: Siobhan Bamber <siobhan@automattic.com>
@t-hamano
Copy link
Contributor Author

I think it's a good idea 👍

@@ -152,7 +152,7 @@ function ShortcutsSection( { selectedSite }: Pick< ContentTabOverviewProps, 'sel
if ( installedApps.vscode ) {
// Use VS Code as a default even if none of the editors are installed
buttonsArray.push( {
label: 'VS Code',
label: __( 'VS Code' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

As outlined in #48 (comment), we explicitly changed this string and PhpStorm to be not translatable. Based on their webpages, seems the IDE's names are not translated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think all text needs to be translatable, whether it's a proper name or not.

For example, in the core, translation functions are applied to all service names like the ones below.

https://github.com/WordPress/wordpress-develop/blob/66b5d25be2b5e69833bacfe8f64de660ffc2bfa9/src/wp-includes/theme.php#L2394-L2433

Mistakes can always be made in localization, including this button text. Personally, I feel that hard-coding only some proper nouns is insufficient to prevent this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add a note for translators for VS Code and PhpStorm phrases?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I see. In that case, I wonder if we could add a comment for translators to omit the IDE's name. Similar to what we added here. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, updated by 400e186.

Copy link
Contributor

@wojtekn wojtekn left a comment

Choose a reason for hiding this comment

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

If there is any language that would benefit from translating those phrases, it makes sense to make them translatable.

Adding a translator's note sounds like a good precaution, and if we spot the name was unnecessary translated, we can fix it in GlotPress.

@@ -152,7 +152,7 @@ function ShortcutsSection( { selectedSite }: Pick< ContentTabOverviewProps, 'sel
if ( installedApps.vscode ) {
// Use VS Code as a default even if none of the editors are installed
buttonsArray.push( {
label: 'VS Code',
label: __( 'VS Code' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add a note for translators for VS Code and PhpStorm phrases?

Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

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

LGTM 🎊 ! Thanks @t-hamano for the update 🙇 !

@fluiddot
Copy link
Contributor

fluiddot commented Apr 29, 2024

Adding a translator's note sounds like a good precaution, and if we spot the name was unnecessary translated, we can fix it in GlotPress.

Good point @wojtekn, I shared something similar in #48 (comment). I'd like to note that this was addressed in 400e186.

@fluiddot fluiddot merged commit e8abc4d into Automattic:trunk Apr 29, 2024
3 checks passed
@t-hamano t-hamano deleted the i18n/translate-vscode-phpstorm branch April 30, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants