wj-elements 0.1.59 → 0.1.60
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/dist/localize.js +11 -11
- package/package.json +1 -1
package/dist/localize.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class s {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
this.element = t, this.lang = this.element.lang || document.documentElement.lang || "sk", this.dir = this.element.dir || document.documentElement.dir || "ltr", this.setLanguage();
|
|
4
4
|
}
|
|
@@ -14,9 +14,9 @@ class r {
|
|
|
14
14
|
const e = this.languages.get(this.currentLang);
|
|
15
15
|
return e && e[t] || t;
|
|
16
16
|
}
|
|
17
|
-
translatePlural(t, e) {
|
|
18
|
-
const
|
|
19
|
-
return e != null && (t += "." +
|
|
17
|
+
translatePlural(t, e = 0, a = "cardinal") {
|
|
18
|
+
const r = new Intl.PluralRules(this.lang, { type: a });
|
|
19
|
+
return e != null && (t += "." + r.select(e)), this.translate(t);
|
|
20
20
|
}
|
|
21
21
|
// Formátovanie čísla podľa aktuálneho jazyka
|
|
22
22
|
formatNumber(t, e) {
|
|
@@ -26,24 +26,24 @@ class r {
|
|
|
26
26
|
formatDate(t) {
|
|
27
27
|
return new Intl.DateTimeFormat(this.currentLang).format(new Date(t));
|
|
28
28
|
}
|
|
29
|
-
relativeTime(t = 0, e,
|
|
30
|
-
return new Intl.RelativeTimeFormat(this.currentLang,
|
|
29
|
+
relativeTime(t = 0, e, a = { numeric: "auto" }) {
|
|
30
|
+
return new Intl.RelativeTimeFormat(this.currentLang, a).format(t, e);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
function l(...n) {
|
|
34
|
+
n.map((t) => {
|
|
35
35
|
const e = t.code.toLowerCase();
|
|
36
36
|
translations.has(e) ? translations.set(e, { ...translations.get(e), ...t }) : translations.set(e, t);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class i extends s {
|
|
40
40
|
constructor(t) {
|
|
41
41
|
super(t);
|
|
42
42
|
}
|
|
43
43
|
static registerTranslation(...t) {
|
|
44
|
-
|
|
44
|
+
l(...t);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
i as Localizer
|
|
49
49
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.60",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|