From 2c3d151b24e22a63c683c7c765214850fd211319 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 31 Jan 2020 16:17:54 +0000 Subject: [PATCH] Pass language code to CiviCRM --- CRM/Utils/System/WordPress.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 595ad9ff2c..d1cbaec087 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -417,8 +417,11 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { elseif (defined('ICL_LANGUAGE_CODE')) { $language = ICL_LANGUAGE_CODE; } - - // TODO: set language variable for others WordPress plugin + // Wordpress "standard" single language mode + // We still have to check if the function exists as it may not during bootstrap + elseif (function_exists('get_locale')) { + $language = get_locale(); + } if (!empty($language)) { return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2)); -- 2.25.1