-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Plural forms for downloaded and uploading PO-files. #30
Comments
Can you try again but with setting i18n format to "other" in your locize project settings? If using default format (i18next) it will handle part after |
Just had to confirm...detection of plural will automatically assume i18next format We will need to see what we can do to avoid that handling...will ping you asap. |
can you please try with locize-cli@4.8.3 |
I checked the new version of locize-cli. The problem with "msgctxt" is fixed.
The values in "msgid" and "msgid_plural" are different.
And when we try to get the plural translation by the key "tied with %{count} others %{test_one} test" we do not find it. |
May I ask what framework you're using for i18n? As I understand pluralforms in gettext (PHP) it's like the accepted reply here: https://stackoverflow.com/questions/12121515/multiple-plural-forms-in-gettext msgid "%d Comment"
msgid_plural "%d Comments"
msgstr[0] "%d Komentarz"
msgstr[1] "%d Komentarze"
msgstr[2] "%d Komentarzy" |
We use https://github.com/grosser/gettext_i18n_rails |
while I understand it stores two keys (for translators) in the po file - I'm not sure that the plural key / msgid_plural is needed for the lookup for translations? Is that really the case...I was in the believe it uses the msgid to find a key and takes the right form based on the index in msgstr...? |
I can’t say exactly how pluralforms in gettext work. But at the moment I can’t get the pluralform translation in this case: |
The current big problem is that for non singular/plural language we store the pluralforms in JSON format with suffixed key_0, key_1, ... reflecting the index used in gettext msgstr - so in those cases we do only have the msgid (=key) in singular. And there is no way to get that msgid_plural. Can't you just call: We will have to think of a solution for this one...but currently, I have no idea how to solve this - as we do not have the plural key/msgid_plural. |
The only way I currently see is adding an option to combine msgid and msgid_plural into one json key instead of using msgid only...will need to create a PR in an upstream module...might take a few days to get that through... |
Thank you! |
Could you please retry with: locize-cli@5.0.0
results now in JSON
So we can convert |
Hello!
I use locize-cli to synchronize localization files with locize.
In the project we use the PO file format.
Here is an example of a valid key.
After locize sync --api-key api_key --project-id project_id --format po
we see the following fields in locize:
When you need to synchronize translation files or download them using locize download, we get the following:
From this result questions follow.
In msgid and msgid_plural identical keys are stored. When requesting the key
tied with% {count} others% {test_one}
test we will not receive a translation.And the second question.
Why is everything going after "_" placed in msgctxt?
As far as I know, msgctxt is used for Disambiguating Contexts.
The text was updated successfully, but these errors were encountered: