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

Fix _n_noop() and _nx_noop() #554

Merged
merged 3 commits into from
Apr 20, 2016
Merged

Fix _n_noop() and _nx_noop() #554

merged 3 commits into from
Apr 20, 2016

Conversation

westonruter
Copy link
Member

These don't take a $number arg.

See #50 and #136.

@westonruter
Copy link
Member Author

@GaryJones any concerns with this?

@GaryJones
Copy link
Member

@westonruter Assuming the tests pass, then it would be fine, but I do have two suggestions.

Take a test string like:

_n_noop( 'I have a cat.', 'I have cats.', "illegal $string" );

I'd like to see test string variants for each relevant i18n function that include:

  • a %s placeholder in both the single and plural strings - it shouldn't make any difference to the logic, but strings with placeholders for the number (i.e. 'I have %s cat.', 'I have %s cats.') is more like real-world usage. %d may be a better choice, but I've got a feeling I read something about there being a drawback to trying to force an int compared to allowing any string.

  • a variable (or at least a dollar sign) in a single string text domain:

    _n_noop( 'I have a cat.', 'I have cats.', 'illegal-$string' ); // OK
    

    I don't know what the rules are regarding dollar signs in text domains, and that's probably a set of separate checks, but if so, it shouldn't trigger the same error as a straight variable or a variable inside double-quotes.

@westonruter westonruter merged commit 5e03d51 into develop Apr 20, 2016
@westonruter westonruter deleted the bugfix/_n-noop branch April 20, 2016 19:03
@jrfnl jrfnl added this to the 0.10.0 milestone Aug 27, 2016
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.

3 participants