@shoelace-style/localize 2.2.0 → 2.2.1
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/CHANGELOG.md +4 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -3
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ let documentLanguage = document.documentElement.lang || navigator.language;
|
|
|
6
6
|
let fallback;
|
|
7
7
|
documentElementObserver.observe(document.documentElement, {
|
|
8
8
|
attributes: true,
|
|
9
|
-
attributeFilter: ['lang']
|
|
9
|
+
attributeFilter: ['dir', 'lang']
|
|
10
10
|
});
|
|
11
11
|
export function registerTranslation(...translation) {
|
|
12
12
|
translation.map(t => {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ let fallback: Translation;
|
|
|
19
19
|
// Watch for changes on <html lang>
|
|
20
20
|
documentElementObserver.observe(document.documentElement, {
|
|
21
21
|
attributes: true,
|
|
22
|
-
attributeFilter: ['lang']
|
|
22
|
+
attributeFilter: ['dir', 'lang']
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
//
|
|
@@ -118,9 +118,10 @@ export function update() {
|
|
|
118
118
|
//
|
|
119
119
|
// private localize = new LocalizeController(this);
|
|
120
120
|
//
|
|
121
|
-
// This will add the element to the set and make it respond to changes to <html lang> automatically. To make it
|
|
122
|
-
// to changes to its own lang
|
|
121
|
+
// This will add the element to the set and make it respond to changes to <html dir|lang> automatically. To make it
|
|
122
|
+
// respond to changes to its own dir|lang properties, make it a property:
|
|
123
123
|
//
|
|
124
|
+
// @property() dir: string;
|
|
124
125
|
// @property() lang: string;
|
|
125
126
|
//
|
|
126
127
|
// To use a translation method, call it like this:
|