logoalt Hacker News

silvestrovtoday at 11:31 AM1 replyview on HN

English has just singular and plural: one car, two cars, three cars (and zero cars).

Some languages have more variations. E.g. Czech, Slovene and Russian has 1, 2-4 and 5 as different cases.

Personally I think the syntax is too brittle. It looks too much like TeX code and it has the lisp like deal with lines ending with too many } braces.

I would separate it into two cases: simple strings with just simple interpolation and then a more fuller markup language, more like a simplified xml.

There are more example code at https://github.com/unicode-org/message-format-wg/blob/main/d...


Replies

BoppreHtoday at 11:36 AM

Oh, the language aspect gets a lot worse than that. They explicitly have a non-goal of "all grammatical features of all languages", but the "common" cases are hard enough. From https://github.com/unicode-org/message-format-wg/blob/main/s... :

  .local $hasCase = {$userName :ns:hasCase}
  .match $hasCase
  vocative {{Hello, {$userName :ns:person case=vocative}!}}
  accusative {{Please welcome {$userName :ns:person case=accusative}!}}
  * {{Hello!}}
But if anyone can find a good compromise, it's the Unicode team.