Skip to content

Commit 01f97ff

Browse files
mihnitaromulocintra
authored andcommitted
Implemented feedback from the June 15th meeting
1 parent 96a745c commit 01f97ff

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

doc/why_mf_next.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,33 @@ Other efforts: [Fluent](https://projectfluent.org/),
2222

2323
## Core problems with the current `MessageFormat`
2424

25-
1. Does not have any “extension points”
26-
2. Can't remove anything, even if now we know better
25+
1. The design is not modular enough
26+
* Does not have any “extension points”
27+
* Can't deprecate anything, even if now we know better
28+
2. Some existing problems
2729
3. Hard to map to the existing localization core structures
2830
4. Designed to be API only, plain text, UI, “imperative style”
2931

30-
### 1. Does not have any “extension points”
32+
### 1. The design is not modular enough
33+
34+
The "data model" is hard-coded in the standard and in the syntax.
35+
This makes it very rigid.
36+
37+
#### 1.1 Does not have any “extension points”
3138

3239
No extension points means that it is hard to add new functionality unless you
3340
are doing it in ICU itself.
41+
3442
It also means most tools used to process these messages are built rigidly,
3543
and are unprepared to handle changes
36-
(think localization tools, liners, friendly UIs, etc.).
44+
(think localization tools, linters, friendly UIs, etc.).
3745

38-
### 2. Can't remove anything, even if now we know better
46+
The most basic functionality would be adding a new formatter. Meantime ICU
47+
added other formatters: time intervals, measurement, lists. But MessageFormat
48+
did not keep up. And adding support for any of these new formats risks to break
49+
existing tools.
50+
51+
### 1.2. Can't deprecate anything, even if now we know better
3952

4053
ICU is old, but also very popular (right now it is the core i18n library
4154
for all major operating systems, and many products).
@@ -51,6 +64,23 @@ date/time parameters were added).
5164

5265
But the stability requirements prevent any major cleanup.
5366

67+
### 2. Some existing problems
68+
* ICU added new formatters, but MessageFormat does not support them
69+
* Combined selectors (select + plural) results in unreadable and error
70+
prone nesting
71+
* Select and plurals inside the message are difficult to translate because of
72+
grammatical agreement requires words outside select / plural to change.
73+
See https://en.wikipedia.org/wiki/Agreement_(linguistics)
74+
* Patterns in the date / time / number placeholders are bad i18n, should use skeletons
75+
* No official support for gender. It can be done with `select`, but it
76+
is not the same thing (same as the difference between an `enum` and integer/strings). Developers can use masculine/feminine, masc/fem, male/female, etc.
77+
* Formatting for “parameters” known at compile time
78+
* Escaping with apostrophe is error prone. There is no reliable way to tell if
79+
it has to be doubled or not.
80+
* The # is used in plural format instead of {...}, but does not work for nesting unless the plural is the innermost selector. But named placeholders don't work
81+
properly for plurals with offset. So there are 2 ways to do the same thing that work in 98% of cases, but in special situations only one of the ways works.
82+
* Does not support inflections, and it would be hard to add without breaking existing tools.
83+
5484
### 3. Hard to map to the existing localization core structures
5585

5686
The format is not well supported by any major localization system. \

0 commit comments

Comments
 (0)