@formio/js 5.0.0-dev.5907.acfdf08 → 5.0.0-dev.5908.0f1a78f
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/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/_classes/component/Component.js +1 -1
- package/lib/cjs/utils/i18n.js +5 -0
- package/lib/mjs/components/_classes/component/Component.js +1 -1
- package/lib/mjs/utils/i18n.js +4 -0
- package/package.json +1 -1
|
@@ -2516,7 +2516,7 @@ class Component extends Element_1.default {
|
|
|
2516
2516
|
}
|
|
2517
2517
|
return value;
|
|
2518
2518
|
};
|
|
2519
|
-
if (
|
|
2519
|
+
if (this.defaultMask) {
|
|
2520
2520
|
if (Array.isArray(defaultValue)) {
|
|
2521
2521
|
defaultValue = defaultValue.map(checkMask);
|
|
2522
2522
|
}
|
package/lib/cjs/utils/i18n.js
CHANGED
|
@@ -79,7 +79,12 @@ class I18n {
|
|
|
79
79
|
this.languages[language] = strings;
|
|
80
80
|
}
|
|
81
81
|
t(text, ...args) {
|
|
82
|
+
var _a;
|
|
82
83
|
if (this.currentLanguage[text]) {
|
|
84
|
+
const customTranslationFieldName = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.field;
|
|
85
|
+
if (customTranslationFieldName && this.currentLanguage[customTranslationFieldName]) {
|
|
86
|
+
args[0].field = this.currentLanguage[customTranslationFieldName];
|
|
87
|
+
}
|
|
83
88
|
return utils_1.Evaluator.interpolateString(this.currentLanguage[text], ...args);
|
|
84
89
|
}
|
|
85
90
|
return utils_1.Evaluator.interpolateString(text, ...args);
|
|
@@ -2482,7 +2482,7 @@ export default class Component extends Element {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
return value;
|
|
2484
2484
|
};
|
|
2485
|
-
if (
|
|
2485
|
+
if (this.defaultMask) {
|
|
2486
2486
|
if (Array.isArray(defaultValue)) {
|
|
2487
2487
|
defaultValue = defaultValue.map(checkMask);
|
|
2488
2488
|
}
|
package/lib/mjs/utils/i18n.js
CHANGED
|
@@ -74,6 +74,10 @@ export class I18n {
|
|
|
74
74
|
}
|
|
75
75
|
t(text, ...args) {
|
|
76
76
|
if (this.currentLanguage[text]) {
|
|
77
|
+
const customTranslationFieldName = args[0]?.field;
|
|
78
|
+
if (customTranslationFieldName && this.currentLanguage[customTranslationFieldName]) {
|
|
79
|
+
args[0].field = this.currentLanguage[customTranslationFieldName];
|
|
80
|
+
}
|
|
77
81
|
return Evaluator.interpolateString(this.currentLanguage[text], ...args);
|
|
78
82
|
}
|
|
79
83
|
return Evaluator.interpolateString(text, ...args);
|