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

transchoice typos #4994

Closed
duncancumming opened this issue Feb 13, 2015 · 1 comment
Closed

transchoice typos #4994

duncancumming opened this issue Feb 13, 2015 · 1 comment

Comments

@duncancumming
Copy link

You have the following:

{% transchoice count %}
    {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples
{% endtranschoice %}

and:

{% transchoice count with {'%name%': 'Fabien'} from "app" %}
    {0} %name%, there are no apples|{1} %name%, there is one apple|]1,Inf] %name%, there are %count% apples
{% endtranschoice %}

and:

<?php echo $view['translator']->transChoice(
    '{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
    10,
    array('%count%' => 10)
) ?>

I assume each one has a syntax error for the >1 range, and they should all be
[1,Inf]

@wouterj
Copy link
Member

wouterj commented Feb 13, 2015

Your explanation is correct, as it equals the syntax used in the examples. The syntax you propose ([1,Inf]) is not correct. But don't worry, we get lots of questions about this.

[1,Inf] means >=1
]1,Inf] means >1

There is however an inconsistency between the first 2 and the last example. I would prefer if we changed everything to the syntax of the last example (]1,Inf[), as that's the only valid set (Inf is not a number and cannot be part of a set, strictly spoken). It might also avoid confusion about non-existing typos.

@wouterj wouterj closed this as completed May 8, 2015
wouterj added a commit that referenced this issue May 23, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

fix infinity upper bound

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | #4994

Commits
-------

3d19643 fix infinity upper bound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants