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

Translator comments are sometimes missed out #9464

Closed
notnownikki opened this issue Aug 30, 2018 · 4 comments
Closed

Translator comments are sometimes missed out #9464

notnownikki opened this issue Aug 30, 2018 · 4 comments
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling

Comments

@notnownikki
Copy link
Member

Describe the bug

When generating languages/gutenberg.pot, sometimes the built files are used instead of the original source files and translator comments get missed.

In packages/editor/src/components/block-list/block.js we have this on lines 382-384:

		const blockType = getBlockType( blockName );
		// translators: %s: Type of block (i.e. Text, Image etc)
		const blockLabel = sprintf( __( 'Block: %s' ), blockType.title );

This gets built to this in packages/editor/build-module/components/block-list/block.js:

      var blockType = getBlockType(blockName); // translators: %s: Type of block (i.e. Text, Image etc)

      var blockLabel = sprintf(__('Block: %s'), blockType.title); // The block as rendered in the editor is composed of general block UI

and when translations are generated, the build-module version's translation entry is used and the translator comment is not included.

To Reproduce

Run npm run build and see that build-module versions of files are referenced in languages/gutenberg.pot

Expected behavior

Only the original src versions should be referenced, and all translator comments should be included.

@designsimply designsimply added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts Needs Technical Feedback Needs testing from a developer perspective. [Type] Build Tooling Issues or PRs related to build tooling labels Aug 31, 2018
@mayukojpn
Copy link
Contributor

I also found 3 translator comments in packages/keycodes/src/index.js:L124 are not imported to GlotPress. I don't know why :(

@00travelgirl00
Copy link

I translate strings to german right now and also found some missing translator comments:

  • Archives (can be singular or plural in englisch. in german those are different words.)

and the most strings which are still open:

https://translate.wordpress.org/projects/wp-themes/twentynineteen/de/default?filters%5Bstatus%5D=untranslated&sort%5Bby%5D=priority&sort%5Bhow%5D=desc

@swissspidy
Copy link
Member

This should be mostly solved now that Gutenberg has merged into WordPress core and WP-CLI is used to extract the strings and comments. There are only a few exceptions: wp-cli/i18n-command#106

See #9440.

@youknowriad
Copy link
Contributor

Should we close this @swissspidy?

@youknowriad youknowriad removed the Needs Technical Feedback Needs testing from a developer perspective. label Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

No branches or pull requests

6 participants