This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Issue in gettext file load, when plural part from one phrase exists as singular part in another #6762
Comments
Could you add the .po file contents to illustrate the problem a bit more? |
of course, here is sample .po file
|
I see. Would you mind writing up a (failing) unit test for that? |
I prepare test and proposed hotfix on my fork of zf2. https://github.com/deny/zf2/commit/9e2c8a399db888c628c6a2d55fec48e079020162 Should i send pull request? |
Yes please :) |
Ocramius
added a commit
that referenced
this issue
Dec 30, 2014
Ocramius
added a commit
that referenced
this issue
Dec 30, 2014
Handled in #6765 |
gianarb
pushed a commit
to zendframework/zend-i18n
that referenced
this issue
May 15, 2015
…inor CS fix (spaces around parentheses)
gianarb
pushed a commit
to zendframework/zend-i18n
that referenced
this issue
May 15, 2015
…dding `@group` annotations for newly introduced tests
gianarb
pushed a commit
to zendframework/zend-i18n
that referenced
this issue
May 15, 2015
…inor cs fixes (one argument per line in multiline function calls, spacing)
gianarb
pushed a commit
to zendframework/zend-i18n
that referenced
this issue
May 15, 2015
…endframework#6765-fix-wrong-gettext-plural-translation' Close zendframework/zendframework#6762 Close zendframework/zendframework#6765
gianarb
pushed a commit
to zendframework/zend-i18n
that referenced
this issue
May 15, 2015
…endframework#6765-fix-wrong-gettext-plural-translation' into develop Close zendframework/zendframework#6762 Close zendframework/zendframework#6765 Forward port zendframework/zendframework#6762 Forward port zendframework/zendframework#6765
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When i use translations with gettext .mo files, and use translatePlural as below:
the second line return untranslated string. Textdomain created by I18n\Translator\Loader\Gettext should contains:
Loader process entries in alphabetical order, and fist read translate for ('a', 'c'), then for ('b', 'a'). When it add plural form it clears all original strings (https://github.com/zendframework/zf2/blob/master/library/Zend/I18n/Translator/Loader/Gettext.php#L131). In this case it's clear translation for ('a', 'c'), and text domain looks like
Replace problematic line
to
should fix this problem.
Sorry for my English :)
The text was updated successfully, but these errors were encountered: