cosey 0.10.2 → 0.10.3
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/index.d.ts +1 -0
- package/index.js +1 -0
- package/locale/index.d.ts +1 -0
- package/locale/index.js +5 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type CoseyOptions } from './config';
|
|
|
3
3
|
export * from './request';
|
|
4
4
|
export * from './layout';
|
|
5
5
|
export * from './router';
|
|
6
|
+
export { i18n } from './locale';
|
|
6
7
|
export { useUserStore, useAppearanceStore, useLayoutStore } from './store';
|
|
7
8
|
export * from './config';
|
|
8
9
|
export * from './config/root-config-provider.api';
|
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { provideGlobalConfig } from './config/index.js';
|
|
|
5
5
|
export { useGlobalConfig } from './config/index.js';
|
|
6
6
|
import { registerGlobalComponents } from './layout/index.js';
|
|
7
7
|
import { createPiniaStore } from './store/index.js';
|
|
8
|
+
export { i18n } from './locale/index.js';
|
|
8
9
|
export { getAlgorithm, rootConfigProviderProps } from './config/root-config-provider.api.js';
|
|
9
10
|
export { default as RootConfigProvider } from './config/root-config-provider.js';
|
|
10
11
|
export { useAppearanceStore } from './store/appearance.js';
|
package/locale/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type Language = {
|
|
|
9
9
|
el: TranslatePair;
|
|
10
10
|
co: TranslatePair;
|
|
11
11
|
};
|
|
12
|
+
export declare let i18n: import("vue-i18n").I18n<{}, {}, {}, string, false>;
|
|
12
13
|
export declare function setupLocale(app: App, config: I18nConfig | undefined, persist: Persist): void;
|
|
13
14
|
export declare function useCoseyLocale(): Record<string, any>;
|
|
14
15
|
export declare function useLocaleMessages(): {
|
package/locale/index.js
CHANGED
|
@@ -15,6 +15,9 @@ function getMessages(config, type) {
|
|
|
15
15
|
}
|
|
16
16
|
const coseyLocaleKey = Symbol("coseyLocale");
|
|
17
17
|
const localeMessagesKey = Symbol("localeMessages");
|
|
18
|
+
let i18n = createI18n({
|
|
19
|
+
legacy: false
|
|
20
|
+
});
|
|
18
21
|
function setupLocale(app, config = {}, persist) {
|
|
19
22
|
const mergedConfig = defaultsDeep(config, defaultI18nConfig);
|
|
20
23
|
const appMessages = getMessages(mergedConfig, "app");
|
|
@@ -22,7 +25,7 @@ function setupLocale(app, config = {}, persist) {
|
|
|
22
25
|
const dayjsMessages = getMessages(mergedConfig, "dayjs");
|
|
23
26
|
const locale = persist.get(langKey) || mergedConfig.locale;
|
|
24
27
|
const coseyLocale = shallowRef({});
|
|
25
|
-
|
|
28
|
+
i18n = createI18n({
|
|
26
29
|
legacy: false,
|
|
27
30
|
locale,
|
|
28
31
|
fallbackLocale: locale,
|
|
@@ -55,4 +58,4 @@ function useLocaleMessages() {
|
|
|
55
58
|
return inject(localeMessagesKey, []);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
export { setupLocale, useCoseyLocale, useLocaleMessages };
|
|
61
|
+
export { i18n, setupLocale, useCoseyLocale, useLocaleMessages };
|