Skip to content

EspoCRM – Open Source CRM Application

label translation in layout

Yurii11ad658709dc
diff --git a/client/src/views/record/detail.js b/client/src/views/record/detail.js
index 63387b280a..6bd7308d2c 100644
--- a/client/src/views/record/detail.js
+++ b/client/src/views/record/detail.js
@@ -141,6 +141,7 @@ class DetailRecordView extends BaseRecordView {
* @property {string} [labelText] A label text (not-translatable).
* @property {boolean} [noLabel] No label.
* @property {string} [label] A translatable label (using the `fields` category).
+ * @property {string|null} [labelTranslation] A label translation path. As of v9.4.
* @property {1|2|3|4} [span] A width.
*/
@@ -3292,6 +3293,9 @@ class DetailRecordView extends BaseRecordView {
if ('labelText' in cellDefs) {
o.labelText = cellDefs.labelText;
cell.customLabel = cellDefs.labelText;
+ } else if (cellDefs.labelTranslation) {
+ o.labelText = this.getLanguage().translatePath(cellDefs.labelTranslation);
+ cell.customLabel = o.labelText;
}
if ('customLabel' in cellDefs) {
diff --git a/schema/layouts/detail.json b/schema/layouts/detail.json
index afbf271579..b7a3f3620a 100644
--- a/schema/layouts/detail.json
+++ b/schema/layouts/detail.json
@@ -74,6 +74,10 @@
"type": "string",
"description": "A label text (not-translatable)."
},
+ "labelTranslation": {
+ "type": "string",
+ "description": "A translatable label path. As of v9.4.0."
+ },
"noLabel": {
"type": "boolean",
"description": "Do not show a label."