projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
duped css
[Pman.Core]
/
I18n.php
diff --git
a/I18n.php
b/I18n.php
index
7339009
..
5f70c7a
100644
(file)
--- a/
I18n.php
+++ b/
I18n.php
@@
-81,7
+81,9
@@
class Pman_Core_I18n extends Pman
}
}
- function guessUsersLanguage() {
+ function guessUsersLanguage()
+ {
+ $this->sessionState(0);
$lang = !$this->authUser || empty($this->authUser->lang ) ? 'en' : $this->authUser->lang;
$lang = !$this->authUser || empty($this->authUser->lang ) ? 'en' : $this->authUser->lang;
@@
-105,7
+107,7
@@
class Pman_Core_I18n extends Pman
return explode('_', $lang);
}
return explode('_', $lang);
}
- function get($s ='')
+ function get($s =''
, $opts=array()
)
{
$this->sessionState(0);
{
$this->sessionState(0);
@@
-118,7
+120,7
@@
class Pman_Core_I18n extends Pman
$i = DB_DataObject::Factory('I18n');
$i = DB_DataObject::Factory('I18n');
-
+ $i->is_active = 1;
switch($s) {
case 'Lang':
switch($s) {
case 'Lang':
@@
-187,7
+189,8
@@
class Pman_Core_I18n extends Pman
foreach($langs as $lang)
{
//$rlang = array_shift(explode('_', strtoupper($lang)));
foreach($langs as $lang)
{
//$rlang = array_shift(explode('_', strtoupper($lang)));
- $rlang = array_shift(explode('_', $lang));
+ $ll = explode('_', $lang);
+ $rlang = array_shift($ll);
$ar[$lang] = array();
$i = DB_DataObject::Factory('I18n');
$ar[$lang] = array();
$i = DB_DataObject::Factory('I18n');
@@
-197,8
+200,13
@@
class Pman_Core_I18n extends Pman
$i = DB_DataObject::Factory('I18n');
$ar[$lang]['m'] = $i->toTransList('m', $rlang);
}
$i = DB_DataObject::Factory('I18n');
$ar[$lang]['m'] = $i->toTransList('m', $rlang);
}
+ require_once 'I18Nv2/CurrencyMap.php';
+
+ $ar['currency_map'] = I18Nv2_CurrencyMap::$s_map;
+
//echo '<PRE>';print_r($ar);
header('Content-type: text/javascript');
//echo '<PRE>';print_r($ar);
header('Content-type: text/javascript');
+ echo "Roo.namespace('Pman.I18n');";
echo 'Pman.I18n.Data = ' . json_encode($ar);
exit;
echo 'Pman.I18n.Data = ' . json_encode($ar);
exit;
@@
-227,7
+235,12
@@
class Pman_Core_I18n extends Pman
if (empty($k)) {
return '??';
}
if (empty($k)) {
return '??';
}
- $lang = !$au || empty($au->lang ) ? 'en' : is_string($au) ? $au : $au->lang;
+ $fo = &PEAR::getStaticProperty('HTML_Template_Flexy','options');
+
+ $fallback_lang = empty($fo['locale']) ? 'en' : $fo['locale'];
+
+
+ $lang = empty($au ) ? $fallback_lang : (is_string($au) ? $au : $au->lang);
// does it need caching?
// does it need caching?
@@
-270,15
+283,19
@@
class Pman_Core_I18n extends Pman
* DO NOT USE THIS -- see core_curr_rates dataobject.
*
*/
* DO NOT USE THIS -- see core_curr_rates dataobject.
*
*/
- var $rates = array();
+
+
+
function loadRates()
function loadRates()
- {
- if (!empty($this->rates)) {
- return true;
- }
+ {
+ static $rates = array();
- $this->rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
+ if (!empty($rates)) {
+ $this->rates = $rates;
+ return;
+ }
+ $this->rates = $rates = DB_DAtaObject::Factory('core_curr_rate')->currentRates();
}
}