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:
e7dcda5
)
CRM-14390 - Inherit CMS language don't work in WordPress
author
Donald A. Lobo
<lobo@civicrm.org>
Tue, 8 Apr 2014 19:14:16 +0000
(12:14 -0700)
committer
Donald A. Lobo
<lobo@civicrm.org>
Tue, 8 Apr 2014 19:14:16 +0000
(12:14 -0700)
https://issues.civicrm.org/jira/browse/CRM-14390
CRM/Utils/System/WordPress.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/System/WordPress.php
b/CRM/Utils/System/WordPress.php
index 389c2c06927d8f84687b5367bc196fddf1ec3e9f..9c5a980bfbfc28702e6b1e97f1b22da65268840d 100644
(file)
--- a/
CRM/Utils/System/WordPress.php
+++ b/
CRM/Utils/System/WordPress.php
@@
-415,7
+415,18
@@
class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
* @return string with the locale or null for none
*/
function getUFLocale() {
- return NULL;
+ // WPML plugin
+ if (defined('ICL_LANGUAGE_CODE')) {
+ $language = ICL_LANGUAGE_CODE;
+ }
+
+ // TODO: set language variable for others WordPress plugin
+
+ if (isset($language)) {
+ return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2));
+ } else {
+ return NULL;
+ }
}
/**