From 20ad3ea36899301578fe49e280b727df2366ad6e Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 15 Apr 2022 15:33:10 +1200 Subject: [PATCH] Standardise import text for CustomData import --- CRM/Custom/Import/Form/DataSource.php | 22 +++++++++++++++++++ CRM/Import/Form/DataSource.php | 5 ++--- .../CRM/Custom/Import/Form/DataSource.tpl | 18 +++++++-------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index 4257fd0dc6..92514fc07b 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -24,6 +24,28 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Import_Form_DataSource { const IMPORT_ENTITY = 'Multi value custom data'; + /** + * Get the import entity (translated). + * + * Used for template layer text. + * + * @return string + */ + protected function getTranslatedEntity(): string { + return ts('Multi-value Custom Data'); + } + + /** + * Get the import entity plural (translated). + * + * Used for template layer text. + * + * @return string + */ + protected function getTranslatedEntities(): string { + return ts('multi-value custom data records'); + } + /** * @return array */ diff --git a/CRM/Import/Form/DataSource.php b/CRM/Import/Form/DataSource.php index 8002f87e44..bf8c60984d 100644 --- a/CRM/Import/Form/DataSource.php +++ b/CRM/Import/Form/DataSource.php @@ -44,7 +44,7 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms { * @return string */ protected function getTranslatedEntity(): string { - return Civi\Api4\Utils\CoreUtil::getInfoItem($this::IMPORT_ENTITY, 'title'); + return (string) Civi\Api4\Utils\CoreUtil::getInfoItem($this::IMPORT_ENTITY, 'title'); } /** @@ -55,8 +55,7 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms { * @return string */ protected function getTranslatedEntities(): string { - return Civi\Api4\Utils\CoreUtil::getInfoItem($this::IMPORT_ENTITY, 'title_plural'); - + return (string) Civi\Api4\Utils\CoreUtil::getInfoItem($this::IMPORT_ENTITY, 'title_plural'); } /** diff --git a/templates/CRM/Custom/Import/Form/DataSource.tpl b/templates/CRM/Custom/Import/Form/DataSource.tpl index da84c32318..a5fde9dd84 100644 --- a/templates/CRM/Custom/Import/Form/DataSource.tpl +++ b/templates/CRM/Custom/Import/Form/DataSource.tpl @@ -18,14 +18,14 @@ {ts}This import screen cannot be used because there are no Multi-value custom data groups.{/ts} {/if} -
- {ts}The Multi-value Custom Data Import Wizard allows you to easily upload data to populate multi-value custom data records (such as employment or education history) for existing contacts.{/ts} - {ts}Files to be imported must be in the 'comma-separated-values' format (CSV) and must contain data needed to match the incoming data to an existing contact record in your CiviCRM database.{/ts} {help id='upload'} -
+
+ {ts 1=$importEntity 2= $importEntities}The %1 Import Wizard allows you to easily upload %2 from other applications into CiviCRM.{/ts} + {ts}Files to be imported must be in the 'comma-separated-values' format (CSV) and must contain data needed to match an existing contact in your CiviCRM database.{/ts} {help id='upload'} +
{include file="CRM/common/formButtons.tpl" location="top"}
- + - + - + @@ -58,11 +58,11 @@ - + {include file="CRM/Core/Date.tpl"} {if $savedMapping} - + -- 2.25.1
{$form.uploadFile.label} {$form.uploadFile.html}
@@ -45,11 +45,11 @@
{$form.multipleCustomData.label} {$form.multipleCustomData.html}
{$form.contactType.label} {$form.contactType.html}
{$form.fieldSeparator.label} {help id='id-fieldSeparator' file='CRM/Contact/Import/Form/DataSource'} {$form.fieldSeparator.html}
{$form.savedMapping.label} {$form.savedMapping.html}