@vnejs/plugins.text.locs 0.1.4 → 0.1.6
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/modules/locs.js +3 -3
- package/package.json +1 -1
package/modules/locs.js
CHANGED
|
@@ -32,7 +32,7 @@ export class TextLocs extends Module {
|
|
|
32
32
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
|
-
textReplaceHandler = async (text = "", label = "") => {
|
|
35
|
+
textReplaceHandler = async ({ text = "", label = "" } = {}) => {
|
|
36
36
|
const locs = await this.emitOne(this.EVENTS.LOCS.GET, { label });
|
|
37
37
|
|
|
38
38
|
return locs?.[text] || text;
|
|
@@ -53,9 +53,9 @@ export class TextLocs extends Module {
|
|
|
53
53
|
const { label } = this.globalState.scenario;
|
|
54
54
|
|
|
55
55
|
const loadedLocs = await this.getLoadedLocs(label);
|
|
56
|
-
if (loadedLocs) return loadedLocs;
|
|
57
56
|
|
|
58
|
-
await this.emit(this.EVENTS.LOCS.LOAD, { label });
|
|
57
|
+
if (!loadedLocs) await this.emit(this.EVENTS.LOCS.LOAD, { label });
|
|
58
|
+
|
|
59
59
|
await this.emit(this.EVENTS.TEXT.RECALC);
|
|
60
60
|
};
|
|
61
61
|
onLocsGet = async ({ label = this.PARAMS.SCENARIO.INIT_LABEL_NAME, lang = null } = {}) => {
|