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

Internationalization: remove all custom language handling and let language packs do the work #16518

Merged
merged 6 commits into from
Jul 21, 2020

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Jul 17, 2020

Changes proposed in this Pull Request:

  • Remove locale info from the Initial_State JSON that's loaded with the React app, now that it will be loaded by WordPress.
  • Remove function used to build the above.
  • Remove Gulp tasks used to 1) extract strings from the React codebase into a _inc/jetpack-strings.php file (languages:extract), and then 2) create .json files from the .po files we get from translate.wordpress.org (languages:build)
  • Move to language packs for all translation handling in Jetpack.
  • Remove all language files

Primary issue: #16481
Internal reference: p9dueE-1D0-p2

Jetpack product discussion

  • N/A

Does this pull request change what data or activity we track or use?

  • N/A

Testing instructions:

  • Go to Settings > General and change your site language to French.
  • Go to Dashboard > Updates and update translations.
  • The React dashboard will remain in English (for now), but should load properly.
  • Other Jetpack features (such as options on wp-admin pages, widgets, ...) should be translated properly.

Proposed changelog entry for your changes:

  • N/A

@jeherve jeherve added General [Status] In Progress [Focus] i18n Internationalization / i18n, adaptation to different languages Admin Page React-powered dashboard under the Jetpack menu [Pri] Normal labels Jul 17, 2020
@jeherve jeherve added this to the 8.8 milestone Jul 17, 2020
@jeherve jeherve self-assigned this Jul 17, 2020
We'll rely on language packs from now on
We now rely on language packs, we don't need this anymore.
We now rely on wp_set_script_translations to do this for us.
@jetpackbot
Copy link

jetpackbot commented Jul 20, 2020

Warnings
⚠️

pre-commit hook was skipped for one or more commits

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16518

Generated by 🚫 dangerJS against 2eedd78

@jeherve jeherve added [Status] Needs Review To request a review from Crew. Label will be renamed soon. [Status] In Progress and removed [Status] In Progress [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Jul 20, 2020
@jeherve jeherve added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] In Progress labels Jul 20, 2020
Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

Let's do this. I'm concerned about moment within i18n-calypso being right (and when we switch to moment directly), but we can add what we need for that back in specifically.

@kraftbj kraftbj added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Jul 20, 2020
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello jeherve! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D46650-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@jeherve jeherve merged commit e21e43b into master Jul 21, 2020
@jeherve jeherve deleted the rm/i18n-tooling branch July 21, 2020 09:05
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Jul 21, 2020
@jeherve
Copy link
Member Author

jeherve commented Jul 21, 2020

r210739-wpcom

anomiex added a commit that referenced this pull request May 10, 2022
Did a pass over _inc/client/components looking for things that weren't
used anywhere, and found a bunch:

* components/data/query-connect-url - Last use removed in #8014
* components/data/query-connection-status - Last use removed in 62e9ab0
* components/data/query-modules - Last use removed in bfc40ad
* components/data/query-plugin-updates - Last use removed in #17003
* components/data/query-site-products - Last use removed in #21594
* components/form/* - Didn't check for last use, too many bits. But it
  looks like the `formsy-react` package many of these depended on wasn't
  even installed since #8208.
* components/inline-expand - Last use removed in #6550
* components/jetpack-dialogue - Last use removed in #16518
* components/jetpack-logo - Last use removed in #20148
* components/jetpack-termination-dialog - Last use removed in #21048
* components/module-settings/index.jsx - Last use removed in #10644
* components/module-settings/inline-module-toggle.jsx - Last use removed
  in #12118
* components/screen-reader-text - Last use removed in #18843
* components/settings - Last use removed in 26315e1, I think
* components/tags-input - Last use removed in #11772

Then there were a few more that were only used from some of the above:

* components/data/query-connected-plugins
* components/module-settings/form-components.jsx
* components/multiple-choice-question
* components/setting-toggle
anomiex added a commit that referenced this pull request May 10, 2022
Did a pass over _inc/client/components looking for things that weren't
used anywhere, and found a bunch:

* components/data/query-connect-url - Last use removed in #8014
* components/data/query-connection-status - Last use removed in 62e9ab0
* components/data/query-modules - Last use removed in bfc40ad
* components/data/query-plugin-updates - Last use removed in #17003
* components/data/query-site-products - Last use removed in #21594
* components/form/* - Didn't check for last use, too many bits. But it
  looks like the `formsy-react` package many of these depended on wasn't
  even installed since #8208.
* components/inline-expand - Last use removed in #6550
* components/jetpack-dialogue - Last use removed in #16518
* components/jetpack-logo - Last use removed in #20148
* components/jetpack-termination-dialog - Last use removed in #21048
* components/module-settings/index.jsx - Last use removed in #10644
* components/module-settings/inline-module-toggle.jsx - Last use removed
  in #12118
* components/screen-reader-text - Last use removed in #18843
* components/settings - Last use removed in 26315e1, I think
* components/tags-input - Last use removed in #11772

Then there were a few more that were only used from some of the above:

* components/data/query-connected-plugins
* components/module-settings/form-components.jsx
* components/multiple-choice-question
* components/setting-toggle

Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Focus] i18n Internationalization / i18n, adaptation to different languages General [Pri] Normal Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants