From: Mathieu Lutfy Date: Sat, 14 Mar 2015 15:08:14 +0000 (-0400) Subject: CRM-16111: Translation string fixes (reported by r4zoli). X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d7bd49d23567b8d3a4815d0289cf4bd1eb4363ad;p=civicrm-core.git CRM-16111: Translation string fixes (reported by r4zoli). --- diff --git a/CRM/Admin/Form/LabelFormats.php b/CRM/Admin/Form/LabelFormats.php index 469c3d09a2..44675a784b 100644 --- a/CRM/Admin/Form/LabelFormats.php +++ b/CRM/Admin/Form/LabelFormats.php @@ -194,20 +194,24 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form { if ($this->_action & CRM_Core_Action::COPY) { // make a copy of the Label Format $labelFormat = CRM_Core_BAO_LabelFormat::getById($this->_id, $this->_group); + $newlabel = ts('Copy of %1', array(1 => $labelFormat['label'])); + $list = CRM_Core_BAO_LabelFormat::getList(TRUE, $this->_group); $count = 1; - $prefix = ts('Copy of '); - while (in_array($prefix . $labelFormat['label'], $list)) { - $prefix = ts('Copy') . ' (' . ++$count . ') ' . ts('of '); + + while (in_array($newlabel, $list)) { + $count++; + $newlabel = ts('Copy %1 of %2', array(1 => $count, 2 => $labelFormat['label'])); } - $labelFormat['label'] = $prefix . $labelFormat['label']; + + $labelFormat['label'] = $newlabel; $labelFormat['grouping'] = CRM_Core_BAO_LabelFormat::customGroupName(); $labelFormat['is_default'] = 0; $labelFormat['is_reserved'] = 0; $bao = new CRM_Core_BAO_LabelFormat(); $bao->saveLabelFormat($labelFormat, NULL, $this->_group); - CRM_Core_Session::setStatus($labelFormat['label'] . ts(' has been created.'), ts('Saved'), 'success'); + CRM_Core_Session::setStatus(ts('%1 has been created.', array(1 => $labelFormat['label'])), ts('Saved'), 'success'); return; } diff --git a/templates/CRM/Admin/Form/LabelFormats.tpl b/templates/CRM/Admin/Form/LabelFormats.tpl index 186cf848bd..c7a01a46f0 100644 --- a/templates/CRM/Admin/Form/LabelFormats.tpl +++ b/templates/CRM/Admin/Form/LabelFormats.tpl @@ -34,7 +34,7 @@ {elseif $action eq 16384}
- {ts 1=$formatName}Are you sure you would like to make a copy of the Label Format titled%1?{/ts} + {ts 1=$formatName}Are you sure you would like to make a copy of the Label Format titled %1?{/ts}
{else}
{include file="CRM/common/formButtons.tpl" location="top"}