@vesperjs/vue 0.1.1 → 0.1.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.
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -21618,7 +21618,7 @@ declare module '@vue/runtime-core' {
|
|
|
21618
21618
|
//#region src/composables/use-locale.d.ts
|
|
21619
21619
|
declare const useLocale: () => {
|
|
21620
21620
|
locale: WritableComputedRef<"en" | "ja", "en" | "ja">;
|
|
21621
|
-
|
|
21621
|
+
autodetect: () => void;
|
|
21622
21622
|
};
|
|
21623
21623
|
//#endregion
|
|
21624
21624
|
//#region src/composables/use-nano-route.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -64,13 +64,13 @@ const i18n = createI18n({
|
|
|
64
64
|
//#region src/composables/use-locale.ts
|
|
65
65
|
const useLocale = () => {
|
|
66
66
|
const { locale, availableLocales, fallbackLocale } = i18n.global;
|
|
67
|
-
const
|
|
67
|
+
const autodetect = () => {
|
|
68
68
|
const viewLocale = globalThis.navigator.languages[0];
|
|
69
69
|
locale.value = availableLocales.includes(viewLocale) ? viewLocale : fallbackLocale.value;
|
|
70
70
|
};
|
|
71
71
|
return {
|
|
72
72
|
locale,
|
|
73
|
-
|
|
73
|
+
autodetect
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
//#endregion
|