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: Use argument swapping instead of named arguments for string placeholders #8771

Merged
merged 2 commits into from
Aug 13, 2018

Conversation

dimadin
Copy link
Contributor

@dimadin dimadin commented Aug 9, 2018

Description

In WordPress, argument swapping is used in strings with placeholders. This PR switches from named arguments introduced in 73edbd4, and also adds translators comments to affected strings.

See #984 (review)

@dimadin dimadin changed the title Use argument swapping instead of named arguments for string placeholders i18n: Use argument swapping instead of named arguments for string placeholders Aug 9, 2018
@aduth aduth self-requested a review August 10, 2018 12:56
@aduth aduth added the Internationalization (i18n) Issues or PRs related to internationalization efforts label Aug 10, 2018
@dimadin
Copy link
Contributor Author

dimadin commented Aug 10, 2018

I realized that translator comment for the last two strings is wrong, and that those strings can actually use _n() function.

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Verified languages/gutenberg.pot output. Looks good, thanks! 👍

position,
}
// translators: 1: Number of selected blocks, 2: Position of selected blocks
_n(
Copy link
Member

Choose a reason for hiding this comment

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

If I had to guess, this was previously using __ because we'd never be showing these controls except if there were more than one block selected. I get the sense that even still we'd want to use _n (e.g. non-English pluralization?) as you've proposed here.

@aduth aduth merged commit eeb298e into WordPress:master Aug 13, 2018
@mtias mtias added this to the 3.6 milestone Aug 16, 2018
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants