@kopynator/core 1.0.9 → 1.0.10
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 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -57,6 +57,7 @@ declare class Kopynator {
|
|
|
57
57
|
constructor(config: KopyConfig);
|
|
58
58
|
/**
|
|
59
59
|
* Initialize the SDK and load initial translations.
|
|
60
|
+
* Only one request: the current locale (default or saved). Selector uses config.languages if provided.
|
|
60
61
|
*/
|
|
61
62
|
init(): Promise<void>;
|
|
62
63
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare class Kopynator {
|
|
|
57
57
|
constructor(config: KopyConfig);
|
|
58
58
|
/**
|
|
59
59
|
* Initialize the SDK and load initial translations.
|
|
60
|
+
* Only one request: the current locale (default or saved). Selector uses config.languages if provided.
|
|
60
61
|
*/
|
|
61
62
|
init(): Promise<void>;
|
|
62
63
|
/**
|
package/dist/index.js
CHANGED
|
@@ -175,13 +175,13 @@ var Kopynator = class {
|
|
|
175
175
|
availableLanguages = [];
|
|
176
176
|
/**
|
|
177
177
|
* Initialize the SDK and load initial translations.
|
|
178
|
+
* Only one request: the current locale (default or saved). Selector uses config.languages if provided.
|
|
178
179
|
*/
|
|
179
180
|
async init() {
|
|
180
|
-
|
|
181
|
-
if (this.config.mode !== "local") {
|
|
182
|
-
|
|
181
|
+
await this.loadLocale(this.currentLocale);
|
|
182
|
+
if (this.config.mode !== "local" && (!this.config.languages || this.config.languages.length === 0)) {
|
|
183
|
+
await this.refreshAvailableLanguages();
|
|
183
184
|
}
|
|
184
|
-
await Promise.all(tasks);
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
187
|
* Fetch and update the list of available languages from the API.
|
package/dist/index.mjs
CHANGED
|
@@ -144,13 +144,13 @@ var Kopynator = class {
|
|
|
144
144
|
availableLanguages = [];
|
|
145
145
|
/**
|
|
146
146
|
* Initialize the SDK and load initial translations.
|
|
147
|
+
* Only one request: the current locale (default or saved). Selector uses config.languages if provided.
|
|
147
148
|
*/
|
|
148
149
|
async init() {
|
|
149
|
-
|
|
150
|
-
if (this.config.mode !== "local") {
|
|
151
|
-
|
|
150
|
+
await this.loadLocale(this.currentLocale);
|
|
151
|
+
if (this.config.mode !== "local" && (!this.config.languages || this.config.languages.length === 0)) {
|
|
152
|
+
await this.refreshAvailableLanguages();
|
|
152
153
|
}
|
|
153
|
-
await Promise.all(tasks);
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Fetch and update the list of available languages from the API.
|