Comments (13)
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 _
as context...I guess you're not using i18next as that format looks different -> so setting your project to other format should at least solve that issue.
from locize-cli.
I change project setting now it looks
But result not changed.
In locize:
"tied with %{count} other %{test_one} test": "à égalité avec %{count} other %{test_one} test",
"tied with %{count} other %{test_one} test_plural": "à égalité avec %{count} others %{test_one} test"
After download or sync:
msgctxt "one} test"
msgid "tied with% {count} other% {test"
msgid_plural "tied with% {count} other% {test"
msgstr [0] "à égalité avec% {count} other% {test_one} test"
msgstr [1] "à égalité avec% {count} others% {test_one} test"
from locize-cli.
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.
from locize-cli.
can you please try with [email protected]
from locize-cli.
I checked the new version of locize-cli. The problem with "msgctxt" is fixed.
But there was a problem with plural forms.
Initially we have:
msgid "tied with %{count} other %{test_one} test"
msgid_plural "tied with %{count} others %{test_one} test"
msgstr [0] "à égalité avec %{count} other %{test_one} test"
msgstr [1] "à égalité avec %{count} others %{test_one} test"
The values in "msgid" and "msgid_plural" are different.
After downloading or synchronization, the plural keys are as follows:
msgid "tied with %{count} other %{test_one} test"
msgid_plural "tied with %{count} other %{test_one} test"
msgstr [0] "à égalité avec %{count} other %{test_one} test"
msgstr [1] "à égalité avec %{count} others %{test_one} test"
And when we try to get the plural translation by the key "tied with %{count} others %{test_one} test" we do not find it.
from locize-cli.
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"
from locize-cli.
We use https://github.com/grosser/gettext_i18n_rails
Yea this is pluralforms in gettext.
msgid and msgid_plural values are different. gettext stores two key values plural and singular "%d Comment" and "%d Comments".
from locize-cli.
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...?
from locize-cli.
I can’t say exactly how pluralforms in gettext work. But at the moment I can’t get the pluralform translation in this case:
ns _ ('tied with %{count} other', 'tied with %{count} others', advocate_count) % {count: advocate_count}
After finding translated strings with gettext_i18n_rails, we see different keys in msgid and msgid_plural. And after downloading from locize, the keys become the same. I would like them to stay different.
from locize-cli.
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: ns _ ('tied with %{count} other', 'tied with %{count} other', advocate_count) % {count: advocate_count}
in that case?
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.
from locize-cli.
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...
from locize-cli.
Thank you!
I'll wait.
from locize-cli.
Could you please retry with: [email protected]
msgid "tied with% {count} other% {test_one} test"
msgid_plural "tied with% {count} others% {test_one} test"
msgstr [0] "à égalité avec% {count} other% {test_one} test"
msgstr [1] "à égalité avec% {count} others% {test_one} test"
results now in JSON
"tied with% {count} other% {test_one} test|#|tied with% {count} others% {test_one} test": "à égalité avec% {count} other% {test_one} test",
"tied with% {count} other% {test_one} test|#|tied with% {count} others% {test_one} test_plural": "à égalité avec% {count} others% {test_one} test"
So we can convert po -> JSON (locize UI) -> po
keeping the msgid_plural by merging that into the JSON key.
from locize-cli.
Related Issues (20)
- build cli for alpine HOT 7
- Sync returns a different result for "auto-publish" mode and without it HOT 8
- Locize cli doesn't read `.env` file HOT 2
- Locize sync alters my `.json` files HOT 2
- Ambiguous --compare-modification-time flag behavior HOT 7
- version contains strange undeletable namespaces HOT 1
- Mapping between CLI params and config options HOT 1
- Locize sync results in FetchError HOT 5
- TypeError: Cannot read properties of null (reading 'value') HOT 1
- install.ps1 automatic figuring out of download url version has broken HOT 2
- bug(install): binary install not working HOT 15
- Not downloading all translations HOT 2
- The sync command crashes with Error: Callback was already called HOT 1
- The download command fails with an error when using the android format HOT 4
- vulnerabilities on npm install HOT 2
- `locize format` removes comments from `fluent files` HOT 1
- Fluent's `Message References` is not being saved in Locize. HOT 1
- High severity vulnerabilities on npm install HOT 1
- Locize-cli timeouts on sync HOT 4
- Support overwriting HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from locize-cli.