-
Notifications
You must be signed in to change notification settings - Fork 2k
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: Remove redundant hasTranslation
checks (across the codebase)
#98096
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~336 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~2412 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~451 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful work. Thank you!!
I checked every file one by one and all look good. Found two tiny issues. I would add String Freeze label to see if the i18n bot detects any new strings (bad sign).
translate( | ||
'When enabled, only posts published under the categories selected below will be emailed to your subscribers.' | ||
) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but weird concat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed weird. Maybe they wanted to add to existing translation without modifying it 🤔
return i18n.getLocaleSlug() === 'en' || | ||
i18n.hasTranslation( 'Choose how to use your domains' ) | ||
? i18n.translate( 'Choose how to use your domain', 'Choose how to use your domains', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah. conditional plural or something. Amazing how much we leave lingering this way
|
||
return __( 'Contact WordPress.com Support (English)', __i18n_text_domain__ ); | ||
}, [ __, isEnglishLocale ] ); | ||
return __( 'Contact WordPress.com Support', __i18n_text_domain__ ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop the memo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eye! Done
|
||
return __( 'Quick response:', __i18n_text_domain__ ); | ||
}, [ __, isEnglishLocale ] ); | ||
return __( 'AI Generated Response:', __i18n_text_domain__ ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Ohh thank you @alshakero ! You saved me from the hassle to split the PR in chunks to attract reviews. Much appreciate it ❤️ I'll address all the comments of course. |
a94fdbd
to
a1a6112
Compare
Smart! Thank you. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
alright - everything checks out. no new strings, no failing tests, all green, bunch of manual checking. If anything pops up, we can address. Thank you @alshakero 🙇 |
Related to https://github.com/Automattic/i18n-issues/issues/654
Proposed Changes
fixMe
method toi18n-calypso
#97690hasTranslation
+locale
checks with the newfixMe
method, but all of the current cases are effectively redundant checks (meaning, translations have been completed), so instead created a wholistic PR to remove the checks and fallback strings all across the codebase.hasTranslation
+locale
check was done to choose between an original and new translation. Some other cases exist (I think 2-3) where a component will not render at all if a translation is not present. I left those as-is for now - might do in a follow-up.This is a risky PR as it touches many files.
Why are these changes being made?
fixme
method i.e. removes any precedent ofhasTranslation
+locale
check.Testing Instructions
Pre-merge Checklist