bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [bug #53071] JSON as alternative to (G)MO


From: Bruno Haible
Subject: [bug-gettext] [bug #53071] JSON as alternative to (G)MO
Date: Mon, 5 Feb 2018 16:51:32 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0

Follow-up Comment #1, bug #53071 (project gettext):

This is a very good proposal. Yes, I agree that JSON is the de-facto standard
for server->client communication of data to JavaScript programs running in a
browser.

> var parts = key.split("\004", 2);

Yes, contexts would be easy to adapt.

> {"Hello, world!":["Bonjour le monde!"]}

Plural handling may need a bit more thought: where does the plural formula
come from? How about:
  {"disk":{plural:["Platte","Platten"], formula:"n==1?0:1"}}

> An new msgfmt option '--json'

Yes, and the same option also for msgunfmt.

> Parsing and validating JSON as input for msgunfmt is, of course, harder

Parsing and validating a JSON of a specific schema can be done without an
extra JSON library (see x-rst.c); it's only the parsing of generic JSON that
would require a JSON library. That's what I inferred after looking at a couple
of JSON libraries for C.

> we only deal with strings that are trivial to encode

Still, we should deal with LINE SEPARATOR and PARAGRAPH SEPARATOR in such a
way that the resulting JSON can be embedded in JavaScript (so that the client
can use eval to parse it).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53071>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]