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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 FIX: Exclude i18n functions from Uglify for translations. #182

Merged
merged 1 commit into from Jun 3, 2019

Conversation

Projects
None yet
3 participants
@ronalfy
Copy link
Contributor

commented Jun 1, 2019

I added the i18n functions as exclusions for when running npm run build. This allows the JavaScript functions to be translated with WP CLI makepot.

For example:

After running npm run build, you can run WP CLI and it will read the JavaScript translation strings.

Huereca:wp-plugin-info-card jasonandrews$ wp i18n make-pot . langs/wp-plugin-info-card.pot

And here's some sample POT output:

#: src/wp-plugin-info-card-ui.php:32
#: dist/blocks.build.js:1
msgid "Large"
msgstr ""

#: src/wp-plugin-info-card-ui.php:33
#: dist/blocks.build.js:1
msgid "WordPress"
msgstr ""
@ahmadawais

This comment has been minimized.

Copy link
Owner

commented Jun 1, 2019

Thank you for this, @ronalfy 鈥 care to create an issue in the repo explaining how a dev would be able translate through this. I will test that an merge the PR. Would also be a resource to point users towards.

Peace! 鉁岋笍

@ronalfy

This comment has been minimized.

Copy link
Contributor Author

commented Jun 1, 2019

@ahmadawais thanks. I created the issue here: #183

@ahmadawais ahmadawais merged commit a166a7f into ahmadawais:master Jun 3, 2019

@ahmadawais

This comment has been minimized.

Copy link
Owner

commented Jun 4, 2019

Successfully published:

  • babel-preset-cgb@1.7.0
  • cgb-dev-utils@1.6.0
  • cgb-scripts@1.18.0
  • create-guten-block@1.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.