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

Automate gutenberg translations followup #1589

Merged
merged 6 commits into from
Nov 20, 2019
Merged

Conversation

Tug
Copy link
Contributor

@Tug Tug commented Nov 18, 2019

This PR aims to improve our i18n flow. There are 3 main improvements we need to take care of:

  • Fix plurals on android. GlotPress supports <string-array> tags for plurals instead of <plurals>
  • Find a way to keep the same ref/name for each string so not all strings are updated when we refresh the translation files.
  • Exclude strings from tests files in gutenberg

Testing Instructions

  • Make sure the gutenberg submodule is updated
  • Run yarn genstrings
  • Make sure there are no changes to string files in bundles (git diff)

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@Tug Tug self-assigned this Nov 18, 2019
@Tug Tug marked this pull request as ready for review November 18, 2019 12:38
@Tug Tug changed the base branch from develop to master November 18, 2019 15:28
@Tug Tug force-pushed the fix/i18n-plurals-android branch from 15a5d0b to dc5344f Compare November 18, 2019 15:30
@Tug Tug force-pushed the fix/i18n-plurals-android branch from f799392 to afbf2a9 Compare November 18, 2019 17:57

const indent = ' ';

/**
* Encode a raw string into an Android-compatible value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also encode quotes and double-quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, JSON.stringify is going to take care of that

Copy link
Contributor Author

@Tug Tug Nov 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes don't need to be encoded though as they'll be contained in a double quote string. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/1589/files#diff-8a38584e71e09430592cd316ae4d6851R82

Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Tug Tug merged commit 7e1dbd8 into master Nov 20, 2019
@Tug Tug deleted the fix/i18n-plurals-android branch November 20, 2019 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants