Skip to content

Commit 87d0463

Browse files
authored
[DESIGN] Bidi usability
Addresses #746. DO NOT REVIEW YET
1 parent f6fb396 commit 87d0463

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

exploration/bidi-usability.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Bidi Usability
2+
3+
Status: **Proposed**
4+
5+
<details>
6+
<summary>Metadata</summary>
7+
<dl>
8+
<dt>Contributors</dt>
9+
<dd>@aphillips</dd>
10+
<dt>First proposed</dt>
11+
<dd>2024-03-27</dd>
12+
<dt>Pull Requests</dt>
13+
<dd>#000</dd>
14+
</dl>
15+
</details>
16+
17+
## Objective
18+
19+
_What is this proposal trying to achieve?_
20+
21+
The MessageFormat v2 syntax uses whitespace as a required delimiter
22+
as well as permitting the use of whitespace to make _messages_ easier to read.
23+
In addition, a _message_ can include bidirectional text in identifiers and literal values.
24+
25+
MessageFormat's syntax also uses a variety of "sigils" and markers to form the structure of a _message_.
26+
These sigils are ASCII punctuation characters that have neutral directionality.
27+
This means that the inclusion of right-to-left ("RTL") identifiers or literals in a _message_
28+
can result in the syntax looking "scrambled" or, in extreme cases, appearing to have a different meaning
29+
due to [spillover](https://www.w3.org/TR/i18n-glossary/#dfn-spillover-effects).
30+
31+
To prevent spillover effects and to allow users (particularly RTL language users)
32+
to author _messages_ in a straightforward way, we want to allow the syntax to include appropriate
33+
bidirectional support and to recommend to tool and translation technology implementers
34+
mechanisms to make _messages_ that include RTL characters easy to work with
35+
without introducing spoofing or "Trojan Source" attack vectors.
36+
37+
## Background
38+
39+
_What context is helpful to understand this proposal?_
40+
41+
If you are unfamiliar with bidirectional or right-to-left text, there is a basic introduction
42+
[here](https://www.w3.org/International/articles/inline-bidi-markup/uba-basics).
43+
44+
## Use-Cases
45+
46+
_What use-cases do we see? Ideally, quote concrete examples._
47+
48+
## Requirements
49+
50+
_What properties does the solution have to manifest to enable the use-cases above?_
51+
52+
To prevent RTL _literals_ from having spillover effects with surrounding syntax,
53+
it should be possible to bidi isolate a _quoted_ or _unquoted_ _literal_.
54+
55+
To prevent _patterns_ from having spillover effects with other parts of a _message_,
56+
particularly with _keys_ in a _variant_,
57+
it should be possible to bidi isolate a _quoted-pattern_.
58+
59+
To prevent _placeholders_ or _expressions_ from having spillover effects with other parts of a _message_
60+
it should be possible to bidi isolate the contents of an _expression_.
61+
62+
To prevent RTL identifiers from having spillover effects with other parts of an _expression_,
63+
it should be possible to include "local effect" bidi controls following an _identifier_,
64+
_name_,
65+
_option value_,
66+
or _literal_.
67+
These controls must not be included into the _identifier_, _name_, _option value_, or _literal_,
68+
that is, it must be possible to distinguish these characters from the value in question.
69+
70+
## Constraints
71+
72+
_What prior decisions and existing conditions limit the possible design?_
73+
74+
Users cannot be expected to create or manage bidirectional controls or
75+
marks in _messages_, since the characters are invisible and can be difficult
76+
to manage.
77+
Tools (such as resource editors or translation editors)
78+
and other implementations of MessageFormat 2 serialization are strongly
79+
encouraged to provide paired isolates around any right-to-left
80+
syntax as described in this design so that _messages_ display appropriately as plain text.
81+
82+
## Proposed Design
83+
84+
_Describe the proposed solution. Consider syntax, formatting, errors, registry, tooling, interchange._
85+
86+
## Alternatives Considered
87+
88+
_What other solutions are available?_
89+
_How do they compare against the requirements?_
90+
_What other properties they have?_

0 commit comments

Comments
 (0)