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: Add ‘translators’ note to Code block example #18993

Merged
merged 2 commits into from Dec 9, 2019
Merged

i18n: Add ‘translators’ note to Code block example #18993

merged 2 commits into from Dec 9, 2019

Conversation

@mcsf
Copy link
Contributor

mcsf commented Dec 7, 2019

Follows #18964.

@aduth

This comment has been minimized.

Copy link
Member

aduth commented Dec 7, 2019

I don't see how this translator message could possibly be extracted, if it's not associated with any localization function.

See also: #18964 (comment)

@Soean

This comment has been minimized.

Copy link
Member

Soean commented Dec 8, 2019

A general question: In the WordPress plugin repository is only the minified code, without the translator comments, so can't use them at the moment, right?

@mcsf

This comment has been minimized.

Copy link
Contributor Author

mcsf commented Dec 8, 2019

I don't see how this translator message could possibly be extracted, if it's not associated with any localization function.

See also: #18964 (comment)

Ouch. For context, I opened this very PR from my phone as a follow-up to that one, but somehow I missed the disappearance of __. I'll wait for the fix (#19001) and rebase.

A general question: In the WordPress plugin repository is only the minified code, without the translator comments, so can't use them at the moment, right?

This is a great question that I hadn't considered. Looking up a string in GlotPress seems to confirm that there's nothing in place to preserve translator notes.

@aduth

This comment has been minimized.

Copy link
Member

aduth commented Dec 8, 2019

@Soean It's likely, yes. I remember some initial discussion of this when the tooling around string extraction was changed toward relying on the plugin repository (I believe it's the same as in WP-CLI's i18n command).

In any case, I don't know that it's been explored yet, the most direct solution here would seem to be some configuration of Uglify/Terser to allow these comments to remain. This configuration exists already, typically used for copyright/license headers. I think it can be reused for this purpose.

I've created #19006 to track this.

@mcsf mcsf merged commit 16a7cc9 into master Dec 9, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@mcsf mcsf deleted the mcsf-patch-1 branch Dec 9, 2019
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.