4
4
5
5
# Summary
6
6
7
- Remove internationalization features from format!, and change the set of escapes
7
+ Remove localization features from format!, and change the set of escapes
8
8
accepted by format strings. The ` plural ` and ` select ` methods would be removed,
9
9
` # ` would no longer need to be escaped, and ` {{ ` /` }} ` would become escapes for
10
10
` { ` and ` } ` , respectively.
11
11
12
12
# Motivation
13
13
14
- Internationalization is difficult to implement correctly, and doing so will
14
+ Localization is difficult to implement correctly, and doing so will
15
15
likely not be done in the standard library, but rather in an external library.
16
- After talking with others much more familiar with internationalization , it has
17
- come to light that our ad-hoc "internationalization support" in our format
16
+ After talking with others much more familiar with localization , it has
17
+ come to light that our ad-hoc "localization support" in our format
18
18
strings are woefully inadequate for most real use cases of support for
19
- internationalization .
19
+ localization .
20
20
21
21
Instead of having a half-baked unused system adding complexity to the compiler
22
22
and libraries, the support for this functionality would be removed from format
23
23
strings.
24
24
25
25
# Detailed design
26
26
27
- The primary internationalization features that ` format! ` supports today are the
27
+ The primary localization features that ` format! ` supports today are the
28
28
` plural ` and ` select ` methods inside of format strings. These methods are
29
29
choices made at format-time based on the input arguments of how to format a
30
30
string. This functionality would be removed from the compiler entirely.
@@ -59,7 +59,7 @@ see the diff between the two
59
59
Upon landing, there was a significant amount of discussion about the escape
60
60
sequence that would be used in format strings. Some context can be found on some
61
61
[ old pull requests] [ 1 ] , and the current escape mechanism has been the source of
62
- [ much confusion] [ 2 ] . With the removal of internationalization methods, and
62
+ [ much confusion] [ 2 ] . With the removal of localization methods, and
63
63
namely nested format directives, it is possible to reconsider the choices of
64
64
escaping again.
65
65
@@ -77,8 +77,8 @@ the comments of an [old PR][1].
77
77
78
78
# Drawbacks
79
79
80
- The internationalization methods of select/plural are genuinely used for
81
- applications that do not involve internationalization . For example, the compiler
80
+ The localization methods of select/plural are genuinely used for
81
+ applications that do not involve localization . For example, the compiler
82
82
and rustdoc often use plural to easily create plural messages. Removing this
83
83
functionality from format strings would impose a burden of likely dynamically
84
84
allocating a string at runtime or defining two separate format strings.
@@ -90,20 +90,20 @@ with for today.
90
90
91
91
# Alternatives
92
92
93
- The major internationalization approach explored has been l20n, which has shown
93
+ The major localization approach explored has been l20n, which has shown
94
94
itself to be fairly incompatible with the way format strings work today.
95
- Different internationalization systems, however, have not been explored. Systems
95
+ Different localization systems, however, have not been explored. Systems
96
96
such as gettext would be able to leverage format strings quite well, but it
97
- was claimed that gettext for internationalization is inadequate for modern
97
+ was claimed that gettext for localization is inadequate for modern
98
98
use-cases.
99
99
100
100
It is also an unexplored possibility whether the current format string syntax
101
101
could be leveraged by l20n. It is unlikely that time will be allocated to polish
102
- off an internationalization library before 1.0, and it is currently seen as
102
+ off an localization library before 1.0, and it is currently seen as
103
103
undesirable to have a half-baked system in the libraries rather than a
104
104
first-class well designed system.
105
105
106
106
# Unresolved questions
107
107
108
- * Should internationalization support be left in ` std::fmt ` as a "poor man's"
108
+ * Should localization support be left in ` std::fmt ` as a "poor man's"
109
109
implementation for those to use as they see fit?
0 commit comments