From bd1446932282e6f3fafa7b857459e5835d31563e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 20 Jun 2021 19:31:30 -0700 Subject: [PATCH] msgtplui - Workflow.html - Hide translation widgets if there is only one locale --- ext/msgtplui/ang/msgtplui/ListCtrl.js | 4 ++++ ext/msgtplui/ang/msgtplui/Workflow.html | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ext/msgtplui/ang/msgtplui/ListCtrl.js b/ext/msgtplui/ang/msgtplui/ListCtrl.js index 8dc55c3f5a..d45c026943 100644 --- a/ext/msgtplui/ang/msgtplui/ListCtrl.js +++ b/ext/msgtplui/ang/msgtplui/ListCtrl.js @@ -40,6 +40,10 @@ } ); + $ctrl.supportsTranslation = function() { + return CRM.msgtplui.uiLanguages && _.size(CRM.msgtplui.uiLanguages) > 1; + }; + function findTranslations(record) { return _.reduce($ctrl.records, function(existing, rec){ if (rec._is_translation && record.id === rec.id) { diff --git a/ext/msgtplui/ang/msgtplui/Workflow.html b/ext/msgtplui/ang/msgtplui/Workflow.html index 21104c33a3..c3ef3f6a20 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.html +++ b/ext/msgtplui/ang/msgtplui/Workflow.html @@ -12,16 +12,16 @@ {{ts('Title')}} - {{ts('Locale')}} - - + {{ts('Locale')}} + + {{record.msg_title}} - {{record.tx_language_label || ts('Standard')}} + {{record.tx_language_label || ts('Standard')}} {{ts('Current')}} @@ -30,7 +30,7 @@ {{ts('Current')}} - + {{ts('Draft')}} @@ -38,7 +38,7 @@ {{ts('Draft')}} - + {{ts('Translate')}} -- 2.25.1