Changeset 1413020
- Timestamp:
- 05/09/2016 01:59:23 PM (10 years ago)
- Location:
- bablic
- Files:
-
- 2 edited
-
tags/2.0/Bablic.php (modified) (1 diff)
-
trunk/Bablic.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bablic/tags/2.0/Bablic.php
r1409632 r1413020 109 109 return $options['orig']; 110 110 } 111 function get_locale(){ 111 function get_locale($lang){ 112 $options = $this->optionsGetOptions(); 113 if(!$lang) 114 $lang = $options['orig']; 115 if(is_admin()) 116 return $lang; 112 117 $header = (isset($_SERVER['HTTP_BABLIC_LOCALE']) ? $_SERVER['HTTP_BABLIC_LOCALE'] : null); 118 $bablic_locale = ''; 113 119 if($header){ 114 return$header;120 $bablic_locale = $header; 115 121 } 116 122 $url = $_SERVER['REQUEST_URI']; 117 return $this->get_locale_from_url($url); 123 $bablic_locale = $this->get_locale_from_url($url); 124 if(!$bablic_locale || $bablic_locale == $options['orig']) 125 return $lang; 126 return $bablic_locale; 118 127 } 119 128 -
bablic/trunk/Bablic.php
r1409632 r1413020 109 109 return $options['orig']; 110 110 } 111 function get_locale(){ 111 function get_locale($lang){ 112 $options = $this->optionsGetOptions(); 113 if(!$lang) 114 $lang = $options['orig']; 115 if(is_admin()) 116 return $lang; 112 117 $header = (isset($_SERVER['HTTP_BABLIC_LOCALE']) ? $_SERVER['HTTP_BABLIC_LOCALE'] : null); 118 $bablic_locale = ''; 113 119 if($header){ 114 return$header;120 $bablic_locale = $header; 115 121 } 116 122 $url = $_SERVER['REQUEST_URI']; 117 return $this->get_locale_from_url($url); 123 $bablic_locale = $this->get_locale_from_url($url); 124 if(!$bablic_locale || $bablic_locale == $options['orig']) 125 return $lang; 126 return $bablic_locale; 118 127 } 119 128
Note: See TracChangeset
for help on using the changeset viewer.