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

Make instructions.json format localizable #19

Closed
1ec5 opened this issue Sep 12, 2016 · 2 comments
Closed

Make instructions.json format localizable #19

1ec5 opened this issue Sep 12, 2016 · 2 comments

Comments

@1ec5
Copy link
Member

1ec5 commented Sep 12, 2016

For the instructions strings file, we should use a format that standard localization tools can work with. What we have now is more or less the JSON key-value format supported by Transifex, but with an informal mini-language around placeholders and optional clauses. This format has some downsides for localization:

  1. No way to provide comments to localizers
    • Switching to Chrome JSON format would address this issue.
  2. No way to vary capitalization or word order when a clause is omitted
    • We should get rid of all [optional] clauses and enumerate all the possibilities. String concatenation always works against localizability.
  3. No way to vary surrounding words based on a placeholder’s number or grammatical gender
    • We could build this ourselves by allowing any string to be replaced by an object mapping number patterns (ONE, TWO, MANY) to message variants, but localizers would be unable to add their own variants using a tool like Transifex.

Primarily for (3) and so that other clients don’t have to build their own custom parsers, we should consider switching to one of the other Transifex formats that happens to support these features. As an iOS developer, I’m most familiar with .strings and .stringsdict, but gettext and XLIFF are solid formats that support all the features we need for localization while being compatible with Node, Android, and iOS development.

Depends on #6 and #5.

/cc @bsudekum @MoKob @freenerd @zugaldia

@freenerd
Copy link
Member

freenerd commented Oct 19, 2016

After #27 this is were we are at:

  1. No way to provide comments to localizers

This is not there yet, using chrome json as suggested feels like a good idea. Need to do a sample implementation of that.

  1. No way to vary capitalization or word order when a clause is omitted
    We should get rid of all [optional] clauses and enumerate all the possibilities. String concatenation always works against localizability.

We have no optional clauses anymore, everything is spelled out completely in whole strings. We still have string interpolation via {token}.

  1. No way to vary surrounding words based on a placeholder’s number

I don't think we actually have a counting problem in instructions right now. We have ordinalization, which is included.

  1. No way to vary surrounding words based on [..] grammatical gender

We do not have grammatical gender support. Translating to german (which is gender-aware) might be a good test

Next:

@freenerd
Copy link
Member

We have a couple of languages in now and that seemed fine. Closing until we run into problems again (comments, counting, gender)

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