Comments (8)
I don't know exactly what you want to achieve...
Are you using the i18next format?
If so, can you try how it looks like when you use locize download --format po_i18next
? Is there any difference?
To assist you further, it would be nice to know your projectId. (you can also send an email to [email protected])
from locize-cli.
I don't know exactly what you want to achieve...
Maybe something like in the last example... msgid "Wat|Got %{count} bonus|#|Wat|Got %{count} bonuses"
doesn't looks like a correct ID for a string. I'll check with po_i18next
format.
from locize-cli.
If so, can you try how it looks like when you use
locize download --format po_i18next
? Is there any difference?
--format po_i18next
gives the same result.
Also, Locize UI show 2 rows (singular and plural forms) for all languages except JA, KO, ZH.
P.S. If possible, I'll share projectid later.
from locize-cli.
hmm...
May I ask which i18n lib you are using?
If you like we can continue also via mail, because this seems not to be directly related to the cli.
from locize-cli.
This is kinda follow-up for this issue #30
We are using https://github.com/grosser/fast_gettext to work with PO files.
They are downloaded from Locize via
locize download --project-id $LOCIZE_PROJECT_ID --ver latest --language ko --format po
Other languages like FR/IT/etc looks fine.
But those, with "Plural-Forms: nplurals=1; plural=0\n"
are not working with plurals.
from locize-cli.
ok, can you try to save or rename the keys (in your reference language) in locize ui like this:
i.e. in your reference language:
{
"Wat|Got %{count} bonus|#|Wat|Got %{count} bonuses_plural": "Wat|Got %{count} bonuses",
"Wat|Got %{count} bonus|#|Wat|Got %{count} bonuses": "Wat|Got %{count} bonus"
}
i.e. in zh
{
"Wat|Got %{count} bonus|#|Wat|Got %{count} bonuses_plural": "Wat | Got%{count}奖金",
"Wat|Got %{count} bonus|#|Wat|Got %{count} bonuses": "Wat | Got%{count}奖金"
}
You need to have both keys.
after locize download --format po
the po files should look like this:
msgid ""
msgstr ""
"Project-Id-Version: locize\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2020-03-02T12:55:52.000Z\n"
"PO-Revision-Date: 2020-03-02T12:55:52.000Z\n"
"Language: en\n"
msgid "Wat|Got %{count} bonus"
msgid_plural "Wat|Got %{count} bonuses"
msgstr[0] "Wat|Got %{count} bonus"
msgstr[1] "Wat|Got %{count} bonuses"
and this in zh:
msgid ""
msgstr ""
"Project-Id-Version: locize\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"POT-Creation-Date: 2020-03-02T12:56:13.000Z\n"
"PO-Revision-Date: 2020-03-02T12:56:13.000Z\n"
"Language: zh-cn\n"
msgid "Wat|Got %{count} bonus"
msgid_plural "Wat|Got %{count} bonuses"
msgstr[0] "Wat | Got%{count}奖金"
msgstr[1] "Wat | Got%{count}奖金"
from locize-cli.
So... "Add plural(s)" option from Locize is not working as expected? (8MB gif below, sorry)
@adrai your idea means to not use plurals but something special, correct? Also, this may (or will?) affect the way we sync data between Locize and local development. When plural keys collected locally, they synced exactly as shown on the attached gif.
from locize-cli.
If you use locize sync with po format the keys should be "generated" in locize automatically and your po files should look correct.
About the "Add plurals" button, this depends on your choosen i18n format. Seems you have selected "i18next", but you should choose "other".
The "Add plurals" button is an additional feature for the i18next format, so this is why it will produce "wrong" keys for you.
To summarize: I would suggest to:
- change your i18n format to "other"
- use locize sync to syncronize your po files
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.