From 4361de538152a863ec81a0ba21732784beeab000 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 15 May 2018 10:20:31 -0400 Subject: [PATCH] Translate field labels --- CRM/Member/DAO/MembershipType.php | 10 +++++----- xml/templates/dao.tpl | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CRM/Member/DAO/MembershipType.php b/CRM/Member/DAO/MembershipType.php index f47bc47760..a5469039bf 100644 --- a/CRM/Member/DAO/MembershipType.php +++ b/CRM/Member/DAO/MembershipType.php @@ -248,7 +248,7 @@ class CRM_Member_DAO_MembershipType extends CRM_Core_DAO { 'localizable' => 1, 'html' => [ 'type' => 'Text', - 'label' => 'Name', + 'label' => ts("Name"), ], ], 'description' => [ @@ -264,7 +264,7 @@ class CRM_Member_DAO_MembershipType extends CRM_Core_DAO { 'localizable' => 1, 'html' => [ 'type' => 'TextArea', - 'label' => 'Description', + 'label' => ts("Description"), ], ], 'member_of_contact_id' => [ @@ -311,7 +311,7 @@ class CRM_Member_DAO_MembershipType extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Text', - 'label' => 'Minimum Fee', + 'label' => ts("Minimum Fee"), ], ], 'duration_unit' => [ @@ -417,7 +417,7 @@ class CRM_Member_DAO_MembershipType extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Text', - 'label' => 'Max Related', + 'label' => ts("Max Related"), ], ], 'visibility' => [ @@ -504,7 +504,7 @@ class CRM_Member_DAO_MembershipType extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'CheckBox', - 'label' => 'Enabled?', + 'label' => ts("Enabled?"), ], ], ]; diff --git a/xml/templates/dao.tpl b/xml/templates/dao.tpl index 222ffbb309..9d579be623 100644 --- a/xml/templates/dao.tpl +++ b/xml/templates/dao.tpl @@ -146,8 +146,12 @@ class {$table.className} extends CRM_Core_DAO {ldelim} 'serialize' => self::SERIALIZE_{$field.serialize|strtoupper}, {/if} {if $field.html} - 'html' => {$field.html|@print_array}, -{/if} {* field.html *} + 'html' => array( + {foreach from=$field.html item=val key=key} + '{$key}' => {if $key eq 'label'}ts("{$val}"){else}'{$val}'{/if}, + {/foreach} + ), +{/if} {if $field.pseudoconstant} 'pseudoconstant' => {$field.pseudoconstant|@print_array} {/if} {* field.pseudoconstant *} ), -- 2.25.1