Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Update i18n to make use of updated WP-CLI command #1329
In these cases, WordPress downloads translations from translate.wordpress.org to
Looking at the readme (https://github.com/Automattic/amp-wp/blob/d2ad9d61fc0607334b6f282e7c14844330c8e1b2/readme.txt#L4) and the translation platform (https://translate.wordpress.org/projects/wp-plugins/amp), the criteria is met and the call to
Unfortunately, it's a bit more complicated than that. At least at the moment, as the necessary work in WordPress core and WordPress.org hasn't began yet.
Here's a quick rundown of what's needed for plugins:
Plugin hosted solely on GitHub or other platform
Plugin hosted on WordPress.org
That's quite a difference in steps needed. The reason is this:
As mentioned above, necessary work in WordPress core and WordPress.org to change this hasn't began yet.
In the future,
tl;dr: I'll try to find some time on Sunday/Monday to make the necessary changes to this PR, unless someone beats me to it :-)
@swissspidy thank you. So it looks like most of what I did in 74f5f77 should be reverted. Also when calling
Two non-blocking things I noticed:
I just noticed that the plugin uses core's
While I get the intent to re-use existing translations in WordPress core, especially for things like AMP-enabled widgets, it's generally considered a bad practice. Plugins should not rely on the default WordPress text domain as it's not guaranteed that these strings will exist in core all the time. Also, it makes it harder for users to fully translate the plugin as they don't have control over these strings.
Thank you. That is good to keep in mind. So if we keep the
Your changes here look great. You can approve the PR (since I opened it originally) and then I'll merge it.
That sounds like way more work than just using the correct text domain in the first place.
Given that only around a dozen or so strings are affected, this is not worth it IMO. The AMP plugin has around 120 strings and is only fully translated in a handful of languages. Assuming that the strings are unlikely to change soon, one could always export the translations from the WordPress core project and import them for the AMP plugin so that there's no additional burden for the translators.