Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Zend\I18n\Translator\TextDomain storage - whitespace in key #53

Closed
ma-si opened this issue Jul 21, 2016 · 1 comment
Closed

Zend\I18n\Translator\TextDomain storage - whitespace in key #53

ma-si opened this issue Jul 21, 2016 · 1 comment

Comments

@ma-si
Copy link
Contributor

ma-si commented Jul 21, 2016

Translation with text_domain not working for gettext.

In second example key is ui�name with whitespace.

Case working:

PoEdit Source keywords:
translate:1
translatePlural:1,2

$this->translatePlural('name', 'names', 1, 'ui')
TextDomain storage gives:
["storage":"ArrayObject":private]=> array(2) { ["name"]=> array(3) { [0]=> string(5) "imiÄ™" [1]=> string(6) "imiona" [2]=> string(5) "imion" } ["names"]=> string(0) "" }

Case not working:

PoEdit Source keywords:
translate:1**,2c**
translatePlural:1,2**,4c**

This is configuration to update only defined text_domain from source code.
PoEdit works well

$this->translatePlural('name', 'names', 1, 'ui')
TextDomain storage gives:
["storage":"ArrayObject":private]=> array(2) { ["ui�name"]=> array(3) { [0]=> string(5) "imiÄ™" [1]=> string(6) "imiona" [2]=> string(5) "imion" } ["names"]=> string(0) "" }

In .po file there is one difference:
msgctxt "ui"
msgid "name"
msgid_plural "names"
msgstr[0] "imię"
msgstr[1] "imiona"
msgstr[2] "imion"

@ma-si
Copy link
Contributor Author

ma-si commented Dec 29, 2016

\x04 EOT in storage array key

["storage":"ArrayObject":private]=> array(2) { ["ui\x04name"]=> array(3) { [0]=> string(5) "imię" [1]=> string(6) "imiona" [2]=> string(5) "imion" } ["names"]=> string(0) "" }

ma-si added a commit to ma-si/zend-i18n that referenced this issue Jan 10, 2017
Ex. 1 - Missing translations with defined text_domain in PoEdit Source keywords:
`translate:1,2c`
`translatePlural:1,2,4c`

Ex. 2 - Working PoEdit Source keywords (but without text_domain):
`translate:1`
`translatePlural:1,2`

Cause:
Gettext with defined text_domain gives `\x04' EOT in storage array key
Ex. 1 `ui\x04name`
Ex. 2`name`

Resolves zendframework#53
weierophinney added a commit that referenced this issue May 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant