@feugene/fint-i18n 0.2.1 → 0.2.2
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.
|
@@ -190,7 +190,6 @@ function m(t) {
|
|
|
190
190
|
var h = class {
|
|
191
191
|
locale;
|
|
192
192
|
fallbackLocale;
|
|
193
|
-
globalInstall;
|
|
194
193
|
messages = t({});
|
|
195
194
|
compiledMessages = Object.create(null);
|
|
196
195
|
loaderRegistry;
|
|
@@ -202,7 +201,7 @@ var h = class {
|
|
|
202
201
|
skipNextUsedBlockLoadLocale = null;
|
|
203
202
|
hooks = new a();
|
|
204
203
|
constructor(e) {
|
|
205
|
-
this.locale = n(e.locale), this.fallbackLocale = e.fallbackLocale || "", this.loaderRegistry = new l(e.loaders),
|
|
204
|
+
this.locale = n(e.locale), this.fallbackLocale = e.fallbackLocale || "", this.loaderRegistry = new l(e.loaders), e.plugins && e.plugins.forEach((e) => e.install(this)), r(this.locale, (e, t) => {
|
|
206
205
|
if (e !== t) {
|
|
207
206
|
if (this.skipNextUsedBlockLoadLocale === e) {
|
|
208
207
|
this.skipNextUsedBlockLoadLocale = null;
|
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-CJdrAmJT.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-CJdrAmJT.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 };
|
|
@@ -4,7 +4,6 @@ import type { FintI18nOptions, Locale, MessageValue, TranslateOptions } from './
|
|
|
4
4
|
export declare class FintI18n {
|
|
5
5
|
locale: Ref<Locale>;
|
|
6
6
|
fallbackLocale: Locale;
|
|
7
|
-
globalInstall: boolean;
|
|
8
7
|
readonly messages: Record<Locale, any>;
|
|
9
8
|
private compiledMessages;
|
|
10
9
|
private readonly loaderRegistry;
|
|
@@ -6,9 +6,8 @@ export interface InstallI18nOptions {
|
|
|
6
6
|
/**
|
|
7
7
|
* Управляет регистрацией глобальных свойств ($t, $i18n).
|
|
8
8
|
* - функция: вызывается вместо стандартной регистрации;
|
|
9
|
-
* - `true
|
|
9
|
+
* - `true` (по умолчанию): выполняется стандартная регистрация;
|
|
10
10
|
* - `false`: ничего не происходит.
|
|
11
|
-
* Если опция не передана — используется значение `i18n.globalInstall`.
|
|
12
11
|
*/
|
|
13
12
|
globalInstall?: boolean | GlobalInstallFn;
|
|
14
13
|
}
|
package/dist/vue.js
CHANGED
|
@@ -47,7 +47,7 @@ function s(e, t) {
|
|
|
47
47
|
}
|
|
48
48
|
function c(e, t, r = {}) {
|
|
49
49
|
e.provide(n, t);
|
|
50
|
-
let i = r.globalInstall ??
|
|
50
|
+
let i = r.globalInstall ?? !0;
|
|
51
51
|
typeof i == "function" ? i(e, t) : i && s(e, t);
|
|
52
52
|
let o = r.directive === !1 ? null : typeof r.directive == "string" ? r.directive : "t";
|
|
53
53
|
o && e.directive(o, a(t));
|
package/package.json
CHANGED