i18n-keyless-node 1.10.2 → 1.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/dist/service.d.ts +1 -3
- package/dist/service.js +1 -1
- package/package.json +1 -1
package/dist/service.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
type NodeConfig = Omit<I18nConfig, "getAllTranslations" | "storage">;
|
|
1
|
+
import { type Lang, type NodeConfig, type TranslationOptions } from "i18n-keyless-core";
|
|
3
2
|
export declare function init(newConfig: NodeConfig): Promise<NodeConfig>;
|
|
4
3
|
export declare function getTranslation(key: string, currentLanguage: Lang, options?: TranslationOptions): string;
|
|
5
|
-
export {};
|
package/dist/service.js
CHANGED
|
@@ -5,7 +5,6 @@ const store = {
|
|
|
5
5
|
lastRefresh: "",
|
|
6
6
|
config: null,
|
|
7
7
|
setTranslations: () => { },
|
|
8
|
-
setLanguage: () => { },
|
|
9
8
|
};
|
|
10
9
|
queue.on("empty", () => {
|
|
11
10
|
// when each word is translated, fetch the translations for the current language
|
|
@@ -34,6 +33,7 @@ export async function init(newConfig) {
|
|
|
34
33
|
}
|
|
35
34
|
store.config = newConfig;
|
|
36
35
|
store.config.onInit?.(newConfig.languages.primary);
|
|
36
|
+
getAllTranslationsForAllLanguages(store).then(store.setTranslations);
|
|
37
37
|
return newConfig;
|
|
38
38
|
}
|
|
39
39
|
export function getTranslation(key, currentLanguage, options) {
|