Repository navigation
Admin Page: Move to Core translation functions -- PART 1 - #13527
Conversation
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Thank you for the great PR description! When this PR is ready for review, please apply the E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-13527 Scheduled Jetpack release: August 4, 2020. |
I think minified JS is fine; If I've understood correct, .org's process also uses |
Nice, I just verified that my translatable strings appear with a JS source in the POT file after running The reason I assumed we'd need to ship the true source was because I searched for other usages of This string is not translatable: https://translate.wordpress.org/projects/wp-plugins/jetpack/dev/de/default/?filters%5Bterm%5D=You+are+searching+for&filters%5Buser_login%5D=&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filter=Filter&sort%5Bby%5D=priority&sort%5Bhow%5D=desc The reason for why this was not picked up is the missing It's picked up properly. So we need to keep this in mind when converting. |
|
I think it'd be interesting to write a code mod for this? |
|
Noting that WordPress/gutenberg#16374 uses |
|
This PR has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this PR has clear testing instructions, is it up to date with master, and it is still valid. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation. |
|
Let's look at this for the next milestone. |
|
This could now be updated to use |
Worth to mention that source maps are also supported. This was recently tested with BuddyPress. |
…onents This is part 2, follow-up of #13527 Updating i18n in all components
… & Settings This is part 3, follow-up of #13527 Updating i18n in all components
…ings This is part 4, follow-up of #13527 Focussing on the Security tab, the Privacy tab, and the search functionality
…p wizard This is part 5, follow-up of #13527 Updating all the Setup wizard elements
…ings, state This is part 5, follow-up of #13527 This updates everything that's left: - Sharing settings - Traffic settings - Writing settings - State
This is part 2, follow-up of #13527 Updating i18n in all components
This is part 3, follow-up of #13527 Updating i18n in all components
This is part 5, follow-up of #13527 Updating all the Setup wizard elements
This is part 5, follow-up of #13527 This updates everything that's left: - Sharing settings - Traffic settings - Writing settings - State
Changes proposed in this Pull Request:
This will need to happen in steps so reviews are easier. This is step 1.
We're aiming to move away from the
i18n-calypsotooling to handle translations. Instead we'll rely on 2 things:@wordpress/i18nfor most translation work:__,_n,_x, andsprintf.@wordpress/elementand itscreateInterpolateElementto handle React elements in strings.i18n-calypsowill remain in use for a few exceptions for now:momentnumberFormatThis first PR introduces those changes for the At A Glance dashboard.
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Nothing should change at first sight:
react-plugin-js-translations. There are no translations here for now, as no language pack is generated yet for this JS bundle. We'll need to push an Alpha first.Proposed changelog entry for your changes:
Original PR description below (before the discussion in the comments below happened)
This is a demo PR that shows how we'll be able to remove all of our uses of
translate()(from i18n-calypso) within the Jetpack Dashboard so that we can move over to using language pack JSONs for this.This could be merged as is and would have the Akismet "At a glance" use translations loaded the standard WordPress/Gutenberg way (i.e. using
wp_set_script_translations()). The downside of this is that this duplicates the translations JSON in the HTML source.To bring this over the finish line we'll also need to change our build process so that the translatable strings are picked up from the JavaScript source. We currently only ship the uglified
_inc/build/admin.jsand not the JavaScript clean source. If we committed the unmodified source to SVN, the strings would be extracted for translation and provided inside language packs.To avoid duplication, the convention in building the language packs is to have the source be placed under a
src/path, so that they won't be included in the language pack.