Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/translation#54 Ensure that Component titles are translated in lin… #18690

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CRM/Admin/Page/ConfigTaskList.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public function run() {
foreach ($result['values'][0]['enable_components'] as $component) {
$enabled[$component] = 1;
}

// Create an array of translated Component titles to use as part of links on the page.
$translatedComponents = CRM_Core_Component::getNames(TRUE);
$translatedTitles = [];
foreach (CRM_Core_Component::getNames() as $key => $component) {
$translatedTitles[$component] = $translatedComponents[$key];
}
$this->assign('componentTitles', $translatedTitles);
$this->assign('enabledComponents', $enabled);

return parent::run();
Expand Down
16 changes: 8 additions & 8 deletions templates/CRM/Admin/Page/ConfigTaskList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -141,35 +141,35 @@
<td colspan="2">{ts}Components{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap" style="width: 10%;">{docURL page="user/contributions/what-is-civicontribute" text="CiviContribute"}</td>
<td class="tasklist nowrap" style="width: 10%;">{docURL page="user/contributions/what-is-civicontribute" text=$componentTitles.CiviContribute}</td>
<td>{ts}Online fundraising and donor management, as well as offline contribution processing and tracking.{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap" style="width: 10%;">{docURL page="user/pledges/what-is-civipledge" text="CiviPledge"}</td>
<td class="tasklist nowrap" style="width: 10%;">{docURL page="user/pledges/what-is-civipledge" text=$componentTitles.CiviPledge}</td>
<td>{ts}Accept and track pledges (for recurring gifts).{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap">{docURL page="user/events/what-is-civievent" text="CiviEvent"}</td>
<td class="tasklist nowrap">{docURL page="user/events/what-is-civievent" text=$componentTitles.CiviEvent}</td>
<td>{ts}Online event registration and participant tracking.{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap">{docURL page="user/membership/what-is-civimember" text="CiviMember"}</td>
<td class="tasklist nowrap">{docURL page="user/membership/what-is-civimember" text=$componentTitles.CiviMember}</td>
<td>{ts}Online signup and membership management.{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap">{docURL page="user/email/what-is-civimail" text="CiviMail"}</td>
<td class="tasklist nowrap">{docURL page="user/email/what-is-civimail" text=$componentTitles.CiviMail}</td>
<td>{ts}Personalized email blasts and newsletters.{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap">{docURL page="user/campaign/what-is-civicampaign" text="CiviCampaign"}</td>
<td class="tasklist nowrap">{docURL page="user/campaign/what-is-civicampaign" text=$componentTitles.CiviCampaign}</td>
<td>{ts}Link together events, mailings, activities, and contributions. Create surveys and online petitions.{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap">{docURL page="user/case-management/what-is-civicase" text="CiviCase"}</td>
<td class="tasklist nowrap">{docURL page="user/case-management/what-is-civicase" text=$componentTitles.CiviCase}</td>
<td>{ts}Integrated case management for human service providers{/ts}</td>
</tr>
<tr class="even">
<td class="tasklist nowrap">{docURL page="user/grants/what-is-civigrant" text="CiviGrant"}</td>
<td class="tasklist nowrap">{docURL page="user/grants/what-is-civigrant" text=$componentTitles.CiviGrant}</td>
<td>{ts}Distribute funds to others, for example foundations, grant givers, etc.{/ts}</td>
</tr>
</table>