@feugene/fint-i18n 0.1.0 → 0.1.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/README.md +6 -0
- package/README.ru.md +3 -0
- package/dist/chunks/{core-Dbw0feTs.js → core-dRlduVk2.js} +2 -2
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins.js +1 -1
- package/dist/types/core/hooks.d.ts +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @feugene/fint-i18n
|
|
2
2
|
|
|
3
|
+
[](https://codecov.io/gh/efureev/fint-i18n)
|
|
4
|
+
[](https://badge.fury.io/js/@feugene%2Ffint-i18n)
|
|
5
|
+
[](https://bundlephobia.com/package/@feugene/fint-i18n)
|
|
6
|
+
[](https://bundlephobia.com/package/@feugene/fint-i18n)
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
[Русская версия (Russian version)](./README.ru.md)
|
|
4
10
|
|
|
5
11
|
Localization library for Vue 3 with lazy-loading blocks, template compilation, and extensible plugins.
|
package/README.ru.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# @feugene/fint-i18n
|
|
2
2
|
|
|
3
|
+
[](https://codecov.io/gh/efureev/fint-i18n)
|
|
4
|
+
[](https://badge.fury.io/js/@feugene%2Ffint-i18n)
|
|
5
|
+
|
|
3
6
|
Библиотека локализации для Vue 3 с ленивой загрузкой блоков, компиляцией шаблонов и расширяемыми плагинами.
|
|
4
7
|
|
|
5
8
|
## Особенности
|
|
@@ -171,8 +171,8 @@ var f = class {
|
|
|
171
171
|
let r = this.locale.value, i = d(t), a = this.hooks.emitSync("onTranslate", {
|
|
172
172
|
key: e,
|
|
173
173
|
params: i,
|
|
174
|
-
result: this.resolve(r, e, i)
|
|
175
|
-
}).result;
|
|
174
|
+
result: this.resolve(r, e, i)
|
|
175
|
+
}).result ?? e;
|
|
176
176
|
if (a === e) {
|
|
177
177
|
let t = n?.fallbackLocale || this.fallbackLocale;
|
|
178
178
|
if (t && t !== r) {
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./chunks/core-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./chunks/core-dRlduVk2.js";
|
|
2
2
|
export { r as FintI18n, n as HookManager, e as compileTemplate, t as createFintI18n };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./chunks/core-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./chunks/core-dRlduVk2.js";
|
|
2
2
|
import { FINT_I18N_KEY as i, createVTDirective as a, installI18n as o, useFintI18n as s, useI18nScope as c } from "./vue.js";
|
|
3
3
|
import { BridgePlugin as l, HookLoggerPlugin as u, PersistencePlugin as d } from "./plugins.js";
|
|
4
4
|
export { l as BridgePlugin, i as FINT_I18N_KEY, r as FintI18n, u as HookLoggerPlugin, n as HookManager, d as PersistencePlugin, e as compileTemplate, t as createFintI18n, a as createVTDirective, o as installI18n, s as useFintI18n, c as useI18nScope };
|
package/dist/plugins.js
CHANGED
|
@@ -12,7 +12,7 @@ var t = class {
|
|
|
12
12
|
}
|
|
13
13
|
install(e) {
|
|
14
14
|
let t = this.options.key, n = this.options.storage || (typeof window < "u" ? window.localStorage : void 0);
|
|
15
|
-
if (!n) return;
|
|
15
|
+
if (!n || typeof n.getItem != "function") return;
|
|
16
16
|
let r = n.getItem(t);
|
|
17
17
|
r && (e.locale.value = r), e.hooks.on("onLocaleChange", ({ locale: e }) => {
|
|
18
18
|
n.setItem(t, e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feugene/fint-i18n",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Lightweight Vue 3 i18n library with lazy-loading blocks and template caching",
|
|
5
5
|
"author": "feugene <feugene@example.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
"translation"
|
|
22
22
|
],
|
|
23
23
|
"type": "module",
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"access": "public",
|
|
26
|
-
"registry": "https://registry.npmjs.org/"
|
|
27
|
-
},
|
|
28
24
|
"files": [
|
|
29
25
|
"dist"
|
|
30
26
|
],
|
|
@@ -52,11 +48,13 @@
|
|
|
52
48
|
},
|
|
53
49
|
"devDependencies": {
|
|
54
50
|
"@antfu/eslint-config": "^7.7.3",
|
|
51
|
+
"@codecov/vite-plugin": "^1.9.1",
|
|
55
52
|
"@iconify-json/lucide": "^1.2.101",
|
|
56
53
|
"@types/node": "^25.5.2",
|
|
57
54
|
"@unocss/eslint-plugin": "^66.6.7",
|
|
58
55
|
"@unocss/reset": "^66.6.7",
|
|
59
56
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
57
|
+
"@vitest/coverage-v8": "^4.1.3",
|
|
60
58
|
"@vue/test-utils": "^2.4.6",
|
|
61
59
|
"eslint": "^10.2.0",
|
|
62
60
|
"globals": "^17.4.0",
|
|
@@ -80,6 +78,9 @@
|
|
|
80
78
|
"type-check": "vue-tsc --noEmit",
|
|
81
79
|
"test": "vitest",
|
|
82
80
|
"test:run": "vitest run",
|
|
81
|
+
"test:coverage": "yarn test:coverage:package && yarn test:coverage:playground",
|
|
82
|
+
"test:coverage:package": "vitest run --coverage",
|
|
83
|
+
"test:coverage:playground": "vitest run --config playground/vite.config.ts --coverage",
|
|
83
84
|
"lint": "eslint .",
|
|
84
85
|
"lint:fix": "eslint . --fix"
|
|
85
86
|
}
|