projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa6737a
)
Pass language code to CiviCRM
author
Matthew Wire
<mjw@mjwconsult.co.uk>
Fri, 31 Jan 2020 16:17:54 +0000
(16:17 +0000)
committer
Matthew Wire
<mjw@mjwconsult.co.uk>
Fri, 31 Jan 2020 16:17:54 +0000
(16:17 +0000)
CRM/Utils/System/WordPress.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/System/WordPress.php
b/CRM/Utils/System/WordPress.php
index 595ad9ff2c5a1f1c63b32dc72ff52d96e43fab29..d1cbaec0872b4d20f01f1b55dfe6a6899f2e7b11 100644
(file)
--- 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;
}
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));
if (!empty($language)) {
return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2));