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: Make texts easier to translate with fewer components #3364

Merged
merged 1 commit into from
Apr 27, 2016

Conversation

akirk
Copy link
Member

@akirk akirk commented Feb 17, 2016

In these texts we have quite a few components of the form: {{tag}}%(variable){{/tag}

To a translator this is potentially very confusing text. Therefore, if a tag includes only a variable, we can make the whole thing a component: {{variable/}} and use { components: { variable: <tag>{ variable }</tag> } }

@drewblaisdell this affects your strings at "Remove Purchase" but I have a hard time testing the strings if my approach really works. Could you please try? Thanks!

@akirk akirk added i18n [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 17, 2016
@@ -90,7 +88,7 @@ const RemovePurchase = React.createClass( {
<CompactCard className="remove-purchase__card" onClick={ this.openDialog }>
<a href="#">
<Gridicon icon="trash" />
{ this.translate( 'Remove %(productName)s', { args: { productName } } ) }
{ this.translate( 'Remove %(productName)s', { args: { productName: productName } } ) }
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if your version already represents this through ES6 or similar.

@akirk akirk force-pushed the improve/remove-purchase-texts branch from 5083e04 to 8571bce Compare February 17, 2016 14:14
} )
}
{ ' ' }
{ this.translate( 'You will not be able to reuse it again without purchasing a new subscription.', {
context: "Removal confirmation on Manage Purchase page",
Copy link
Member

Choose a reason for hiding this comment

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

Was the removal of this context intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's not very useful information for a translator. A context is meant to create the ability to translate two strings differently depending on the location of the original text. This text will not appear anywhere else, so any additional information to a translator is suited well in a comment (which already exists).

@akirk akirk force-pushed the improve/remove-purchase-texts branch 2 times, most recently from ce46b5a to 8cec93b Compare March 3, 2016 13:03
@akirk akirk force-pushed the improve/remove-purchase-texts branch from 8cec93b to 3a3662d Compare April 1, 2016 14:51
@gwwar
Copy link
Contributor

gwwar commented Apr 26, 2016

👍 Tested. 🚢

@gwwar gwwar added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 26, 2016
@akirk
Copy link
Member Author

akirk commented Apr 27, 2016

Thanks @gwwar!

@akirk akirk merged commit 10893b5 into master Apr 27, 2016
@akirk akirk deleted the improve/remove-purchase-texts branch April 27, 2016 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. i18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants