Giter VIP home page Giter VIP logo

Comments (8)

adrai avatar adrai commented on June 3, 2024

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.

nilcolor avatar nilcolor commented on June 3, 2024

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.

nilcolor avatar nilcolor commented on June 3, 2024

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.

adrai avatar adrai commented on June 3, 2024

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.

nilcolor avatar nilcolor commented on June 3, 2024

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.

adrai avatar adrai commented on June 3, 2024

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"
}

image

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}奖金"
}

image

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.

nilcolor avatar nilcolor commented on June 3, 2024

So... "Add plural(s)" option from Locize is not working as expected? (8MB gif below, sorry)

plurals_640

@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.

adrai avatar adrai commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.