@fusion.dev/helix-docs 0.104.1 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/accessibility.mdx +92 -71
- package/content/angular.mdx +26 -24
- package/content/browser-support.mdx +61 -58
- package/content/building-on-the-headless-tier.mdx +100 -74
- package/content/charting.mdx +98 -79
- package/content/coding-agents.mdx +87 -69
- package/content/color-modes.mdx +40 -37
- package/content/color.mdx +67 -54
- package/content/composition.mdx +85 -83
- package/content/elevation-and-material.mdx +32 -29
- package/content/events.mdx +77 -65
- package/content/forms.mdx +69 -58
- package/content/iconography.mdx +75 -71
- package/content/installation.mdx +77 -68
- package/content/intent-reference.mdx +59 -54
- package/content/introduction.mdx +25 -23
- package/content/localization.mdx +122 -82
- package/content/maps.mdx +431 -0
- package/content/metrics.mdx +296 -299
- package/content/motion.mdx +44 -36
- package/content/other-frameworks.mdx +33 -31
- package/content/overlays.mdx +72 -54
- package/content/overriding-a-component.mdx +85 -74
- package/content/react.mdx +72 -64
- package/content/recipes.mdx +64 -47
- package/content/routing.mdx +100 -93
- package/content/sandbox.mdx +39 -39
- package/content/server-rendering.mdx +95 -84
- package/content/shape-and-borders.mdx +44 -37
- package/content/size-and-density.mdx +51 -46
- package/content/space-and-size.mdx +41 -34
- package/content/state-and-control.mdx +63 -51
- package/content/surfaces-and-separation.mdx +55 -53
- package/content/svelte.mdx +20 -19
- package/content/theme-builder.mdx +42 -31
- package/content/theming.mdx +58 -51
- package/content/tiers.mdx +69 -61
- package/content/tokens.mdx +72 -53
- package/content/typography.mdx +47 -47
- package/content/using-helix-with-an-agent.mdx +147 -115
- package/content/using-the-elements.mdx +55 -50
- package/content/versioning.mdx +42 -35
- package/content/visual-axes.mdx +168 -146
- package/content/vue.mdx +24 -24
- package/content/without-a-bundler.mdx +40 -23
- package/dist/pages.generated.js +49 -43
- package/dist/sources.generated.js +3548 -2682
- package/package.json +3 -3
package/content/localization.mdx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Set the locale of date, time, and number controls, translate component strings, and lay out pages right to left.
|
|
3
3
|
section: Essentials
|
|
4
4
|
title: Localization and RTL
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Localization and RTL
|
|
8
8
|
|
|
9
|
-
## Right-to-left
|
|
9
|
+
## Right-to-left layout
|
|
10
10
|
|
|
11
|
-
Set `dir
|
|
11
|
+
Set `dir`, and the layout flips:
|
|
12
12
|
|
|
13
13
|
```html
|
|
14
14
|
<html
|
|
@@ -17,46 +17,74 @@ Set `dir` and the layout flips:
|
|
|
17
17
|
>
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
`left
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
and
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
Components are written with logical properties, such as `inline-start` for
|
|
21
|
+
`left` and `margin-block` for `margin-top`. Helix does not detect the direction.
|
|
22
|
+
The components follow the `dir` that your document sets.
|
|
23
|
+
|
|
24
|
+
**Physical properties appear only where the position is physical.** A floating
|
|
25
|
+
panel is placed by coordinates measured from the viewport's left edge, so the
|
|
26
|
+
panel and its arrow use `left` and `top`. Everything you would expect to mirror
|
|
27
|
+
still mirrors.
|
|
28
|
+
|
|
29
|
+
### Charts
|
|
30
|
+
|
|
31
|
+
A category or time axis starts on the same side as the text. On a right-to-left
|
|
32
|
+
page, the first value is on the right. The drawing, its labels, its hover
|
|
33
|
+
targets, and its tooltips all mirror together. The vertical axis does not
|
|
34
|
+
change, and numerals are not reversed. Two charts keep their direction:
|
|
35
|
+
|
|
36
|
+
- A whole donut runs clockwise from twelve o'clock, following the convention of
|
|
37
|
+
a clock.
|
|
38
|
+
- A scatter chart keeps its left-to-right plane, because both of its axes are
|
|
39
|
+
measures.
|
|
40
|
+
|
|
41
|
+
See [Charting](./charting) for the rest.
|
|
42
|
+
|
|
43
|
+
### Carets and arrow keys
|
|
44
|
+
|
|
45
|
+
These carets point along the line of text:
|
|
46
|
+
|
|
47
|
+
- a caret that means next or previous
|
|
48
|
+
- the caret between two breadcrumbs
|
|
49
|
+
- the caret on a closed disclosure
|
|
50
|
+
|
|
51
|
+
On a right-to-left page, they point the other way. Every arrow key moves in the
|
|
52
|
+
direction it points on screen. On a right-to-left page, the Left Arrow key:
|
|
53
|
+
|
|
54
|
+
- moves to the next tab
|
|
55
|
+
- moves to the next day
|
|
56
|
+
- moves to the next control in a toolbar
|
|
57
|
+
- opens a tree's branch or a menu's submenu, whose caret points left
|
|
58
|
+
|
|
59
|
+
A slider and a splitter's divider move in the direction of the key.
|
|
60
|
+
|
|
61
|
+
### Media players and pin inputs
|
|
62
|
+
|
|
63
|
+
These two components run left to right on every page.
|
|
64
|
+
|
|
65
|
+
A media player's timeline and skip buttons run left to right in every script,
|
|
66
|
+
like a tape, so the Left Arrow key rewinds.
|
|
67
|
+
|
|
68
|
+
A pin input's boxes run left to right, because a code is read like a phone
|
|
69
|
+
number. The first character you type goes in the leftmost box, a pasted code
|
|
70
|
+
fills to the right, and the Right Arrow key moves to the next box. The pin
|
|
71
|
+
input's label, hint, and error follow the direction of the page.
|
|
72
|
+
|
|
73
|
+
### Floating panel placement
|
|
74
|
+
|
|
75
|
+
In `placement`, the side is physical and the alignment is logical:
|
|
76
|
+
|
|
77
|
+
- `right` is the right side of the anchor in both directions.
|
|
78
|
+
- `bottom-start` aligns a panel with the anchor's start edge, which is its right
|
|
79
|
+
edge on a right-to-left page.
|
|
80
|
+
|
|
81
|
+
A panel with no room on its side flips to the other side. A `right-start` panel
|
|
82
|
+
beside a rail at the start of a right-to-left page opens to its left.
|
|
83
|
+
|
|
84
|
+
### Your own styles
|
|
85
|
+
|
|
86
|
+
Use logical properties in your own styles, so your layout flips with the
|
|
87
|
+
components. Styles written with `left` and `right` do not flip.
|
|
60
88
|
|
|
61
89
|
## Locale-aware controls
|
|
62
90
|
|
|
@@ -76,18 +104,18 @@ Six families format numbers or dates and take a `locale`:
|
|
|
76
104
|
></helix-pagination>
|
|
77
105
|
```
|
|
78
106
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
their operating system
|
|
107
|
+
If you do not set `locale`, these controls use the browser's locale, which is
|
|
108
|
+
usually correct. Set `locale` when your users choose your application's
|
|
109
|
+
language separately from the language of their operating system.
|
|
82
110
|
|
|
83
|
-
Formatting
|
|
84
|
-
|
|
111
|
+
Formatting uses `Intl`, so Helix bundles no locale data, and you have nothing to
|
|
112
|
+
keep up to date.
|
|
85
113
|
|
|
86
|
-
##
|
|
114
|
+
## Translate component strings
|
|
87
115
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
116
|
+
More than a hundred properties in the headless tier set text that your users
|
|
117
|
+
see. Examples include `pan-up-label` on a map and `remove-label` on a combobox's
|
|
118
|
+
selected tags. Properties that combine values are format templates:
|
|
91
119
|
|
|
92
120
|
```html
|
|
93
121
|
<helix-pagination-summary
|
|
@@ -99,16 +127,22 @@ ones that combine values are format templates:
|
|
|
99
127
|
></helix-pagination-summary>
|
|
100
128
|
```
|
|
101
129
|
|
|
102
|
-
|
|
103
|
-
|
|
130
|
+
Placeholders have names, so a translation can put them in any order. Some
|
|
131
|
+
languages need a different order, and a positional format cannot express it.
|
|
104
132
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
`
|
|
110
|
-
message
|
|
111
|
-
|
|
133
|
+
Validation messages are properties too. Each one is named for the validity flag
|
|
134
|
+
it reports:
|
|
135
|
+
|
|
136
|
+
- `value-missing-message`
|
|
137
|
+
- `bad-input-message`
|
|
138
|
+
- `range-underflow-message`
|
|
139
|
+
- `range-overflow-message`
|
|
140
|
+
- `too-short-message`
|
|
141
|
+
|
|
142
|
+
A message appears in the browser's own validation bubble and on the line under
|
|
143
|
+
the field. `feedback` does not reach the bubble. If you do not set a message, a
|
|
144
|
+
text field shows the browser's own message, which is already in your user's
|
|
145
|
+
language. Every other control shows its English sentence.
|
|
112
146
|
|
|
113
147
|
```html
|
|
114
148
|
<helix-number-input
|
|
@@ -118,22 +152,24 @@ keeps its English sentence.
|
|
|
118
152
|
></helix-number-input>
|
|
119
153
|
```
|
|
120
154
|
|
|
121
|
-
**Pass these from your own translation system.** Helix ships English
|
|
122
|
-
and no translation
|
|
123
|
-
would
|
|
124
|
-
|
|
125
|
-
## What to check when
|
|
126
|
-
|
|
127
|
-
- **Long strings.** German and Finnish
|
|
128
|
-
short label. Controls take their width from the
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
155
|
+
**Pass these strings from your own translation system.** Helix ships English
|
|
156
|
+
defaults and no translation tools. If Helix had its own string catalog, you
|
|
157
|
+
would have to keep two catalogs in step.
|
|
158
|
+
|
|
159
|
+
## What to check when you add a language
|
|
160
|
+
|
|
161
|
+
- **Long strings.** Labels in German and Finnish are often long. A control sized
|
|
162
|
+
for a short label may not fit them. Controls take their width from the
|
|
163
|
+
layout and set no width of their own, which helps. A toolbar that fit six
|
|
164
|
+
buttons may now fit four.
|
|
165
|
+
- **The `lang` attribute.** Set it as well as translating the strings.
|
|
166
|
+
Hyphenation, quotation marks, and font fallback all depend on it.
|
|
167
|
+
- **Numerals.** `Intl` formats the digits. A `%` or a currency symbol hardcoded
|
|
168
|
+
in your own markup does not move to the correct side.
|
|
169
|
+
- **Icons that point.** A caret that a component draws turns by itself. An icon
|
|
170
|
+
you place turns only when you add `mirror`, because icon names are physical.
|
|
171
|
+
Use `mirror` on an arrow that means forward or back, and it turns on a
|
|
172
|
+
right-to-left page.
|
|
137
173
|
|
|
138
174
|
```html
|
|
139
175
|
<helix-button>
|
|
@@ -146,9 +182,13 @@ would be a second one to keep in step with yours.
|
|
|
146
182
|
</helix-button>
|
|
147
183
|
```
|
|
148
184
|
|
|
149
|
-
## What
|
|
185
|
+
## What Helix does not provide
|
|
186
|
+
|
|
187
|
+
Helix does not include:
|
|
188
|
+
|
|
189
|
+
- a message catalog
|
|
190
|
+
- a pluralization helper
|
|
191
|
+
- a date-range formatter, beyond what the controls format themselves
|
|
150
192
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
application's i18n layer, and every one of these properties is designed to be
|
|
154
|
-
fed from it.
|
|
193
|
+
These belong to your application's i18n layer. You can set every translatable
|
|
194
|
+
property from that layer.
|