@yiiamee/multilinguist 1.2.0 → 1.2.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.
@@ -26,7 +26,7 @@ export default function useLocalization(supportedLanguages, defaultLocale) {
26
26
  const t = (key, variables) => {
27
27
  const messages = loadedLanguages.value[locale.value];
28
28
  let translatedText = messages?.[key] ?? key;
29
- if (key.includes(".")) {
29
+ if (key.includes(".") && !messages?.[key]) {
30
30
  const nestedKeyArray = key.split(".");
31
31
  translatedText = nestedKeyArray.reduce((acc, key2) => acc?.[key2], messages);
32
32
  }
@@ -1,5 +1,5 @@
1
1
  export default function useMultilinguist(): {
2
- t: (key: import("../types/generated-locales.js").LocaleKey, variables?: Record<string, string>) => string;
2
+ t: (key: LocaleKey, variables?: Record<string, string>) => string;
3
3
  setLocale: (locale: string) => void;
4
4
  initLocalization: () => Promise<void>;
5
5
  locale: import("vue").Ref<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yiiamee/multilinguist",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Nuxt 3 Multilinguist Localization module",
5
5
  "repository": "yiiameeMich/multilinguist",
6
6
  "license": "MIT",
@@ -1,11 +0,0 @@
1
- // AUTO-GENERATED FILE — DO NOT EDIT MANUALLY
2
- export interface TranslationMessages {
3
- "Hello, World": string;
4
- "Switch Locale": string;
5
- "Paste your variable here": string;
6
- "nested.Nested key": string;
7
- "nested.Language": string;
8
- "nested.nested second level.nested second level language": string;
9
- }
10
-
11
- export type LocaleKey = keyof TranslationMessages;