Skip to content
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

Plurals and rule files. #5

Open
aries1980 opened this issue Feb 9, 2015 · 1 comment
Open

Plurals and rule files. #5

aries1980 opened this issue Feb 9, 2015 · 1 comment

Comments

@aries1980
Copy link

Hi,
I'm experimenting with your nice module. I would have three questions:

  1. How do you specify multiple plural versions (e.g. for Russian translation) in the language files?
  2. In the rule files you don't use UTF8 therefore it is hard to read. Is there a technical reason why you used textual representation?
  3. Is there a reason why you picked a different file format than Portable Object (PO)? For PO there are already number of translation tools such as POEdit or KBabel and online services such as Transifex.
@verkestk
Copy link
Collaborator

verkestk commented Feb 9, 2015

Hi Janos,

Let me see if I can answer your questions.

  1. How do you specify multiple plural versions (e.g. for Russian translation) in the language files?

There's an example for french in https://github.com/vube/i18n/blob/master/data/messages/fr.yaml

Here's UNIT_DAY in Russian:
{n} день|{n} дня|{n} дней|{n} дня

That is each form (one|few|many|other) separated by pipes.

  1. In the rule files you don't use UTF8 therefore it is hard to read. Is there a technical reason why you used textual representation?

I agree! As your third question addresses, we use yaml for our translations data (I'll get to that in a bit). We source our data from the CLDR (http://cldr.unicode.org/). Our internal tool for getting this data out of CLDR xml into our yaml is written in go (of course!) and uses the goyaml (https://github.com/go-yaml/yaml) package. I don't know if this is still an issue with goyaml, but at the time that we did this goyaml marshalled unicode characters into what you see. While readable characters would be preferable, this representation still worked. Related on stackoverflow: http://stackoverflow.com/questions/21696845/output-unquoted-unicode-in-go

If goyaml gets a fix for this (or maybe it already has?), I'd love to get these files updated.

  1. Is there a reason why you picked a different file format than Portable Object (PO)? For PO there are already number of translation tools such as POEdit or KBabel and online services such as Transifex.

There is a reason. I evaluated many formats, including PO. We had been using JSON, which was working pretty well for us. However, we wanted the ability to put comments in. So, JSON was out. Some tooling we were evaluating at the time had support for YAML. What it came down to was personal preference - that's it. Support for PO would be a nice feature for this package - Either direct support for loading these file types or a tool for translating them into the yaml required by the package.

I'm not contributing to this package anymore, but there are still vube team members who are monitoring and approving pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants