From d59ab677cc9ff4836f5ba6a489efc0ab946cf444 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Wed, 22 Jan 2020 17:38:32 -0500 Subject: [PATCH] dev/translation#35 Display the CiviCRM Resources dashlet in the user's language --- CRM/Dashlet/Page/GettingStarted.php | 6 ++++-- CRM/Utils/System.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CRM/Dashlet/Page/GettingStarted.php b/CRM/Dashlet/Page/GettingStarted.php index 7ce121fa69..f09a490f7e 100644 --- a/CRM/Dashlet/Page/GettingStarted.php +++ b/CRM/Dashlet/Page/GettingStarted.php @@ -72,13 +72,15 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page { * @return array */ private function _gettingStarted() { - $value = Civi::cache('community_messages')->get('dashboard_gettingStarted'); + $tsLocale = CRM_Core_I18n::getLocale(); + $key = 'dashboard_gettingStarted_' . $tsLocale; + $value = Civi::cache('community_messages')->get($key); if (!$value) { $value = $this->_getHtml($this->gettingStartedUrl()); if ($value) { - Civi::cache('community_messages')->set('dashboard_gettingStarted', $value, (60 * 60 * 24 * self::CACHE_DAYS)); + Civi::cache('community_messages')->set($key, $value, (60 * 60 * 24 * self::CACHE_DAYS)); } } diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index c72f5ea8eb..29b043f156 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1786,13 +1786,14 @@ class CRM_Utils_System { } else { $config = CRM_Core_Config::singleton(); + $tsLocale = CRM_Core_I18n::getLocale(); $vars = [ '{ver}' => CRM_Utils_System::version(), '{uf}' => $config->userFramework, '{php}' => phpversion(), '{sid}' => self::getSiteID(), '{baseUrl}' => $config->userFrameworkBaseURL, - '{lang}' => $config->lcMessages, + '{lang}' => $tsLocale, '{co}' => $config->defaultContactCountry, ]; return strtr($url, array_map('urlencode', $vars)); -- 2.25.1