summaryrefslogtreecommitdiff
path: root/framework/I18N
diff options
context:
space:
mode:
authorxue <>2006-09-24 02:20:54 +0000
committerxue <>2006-09-24 02:20:54 +0000
commit75583383a6c00704837a753741abfc049dcc5a90 (patch)
treefcb5ac38b1eb3abfa5d17bdee494641be8d206ed /framework/I18N
parent6fd29b65290509f55172efccaacb5f91a4a884df (diff)
Merge from 3.0 branch till 1443.
Diffstat (limited to 'framework/I18N')
-rw-r--r--framework/I18N/TGlobalization.php7
-rw-r--r--framework/I18N/Translation.php4
2 files changed, 8 insertions, 3 deletions
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index d3c6d233..90fd3d53 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -93,7 +93,7 @@ class TGlobalization extends TModule
*/
public function setDefaultCulture($culture)
{
- $this->_defaultCharset = str_replace('-','_',$culture);
+ $this->_defaultCulture = str_replace('-','_',$culture);
}
/**
@@ -160,6 +160,7 @@ class TGlobalization extends TModule
* $config['catalogue'] = 'messages'; //default catalog
* $config['autosave'] = 'true'; //save untranslated message
* $config['cache'] = 'true'; //cache translated message
+ * $config['marker'] = '@@'; // surround untranslated text with '@@'
* </code>
* Throws exception is source is not found.
* @param TMap configuration options
@@ -176,7 +177,7 @@ class TGlobalization extends TModule
if(@mkdir($config['source'])===false)
throw new TConfigurationException('globalization_source_path_failed',
$config['source']);
- chmod($config['source'], 0777); //make it deletable
+ chmod($config['source'], 0777); //make it deletable
}
}
else
@@ -192,7 +193,7 @@ class TGlobalization extends TModule
if(@mkdir($config['cache'])===false)
throw new TConfigurationException('globalization_cache_path_failed',
$config['cache']);
- chmod($config['cache'], 0777); //make it deletable
+ chmod($config['cache'], 0777); //make it deletable
}
}
$this->_translation = $config;
diff --git a/framework/I18N/Translation.php b/framework/I18N/Translation.php
index 33696304..7394842b 100644
--- a/framework/I18N/Translation.php
+++ b/framework/I18N/Translation.php
@@ -54,6 +54,10 @@ class Translation extends TComponent
self::$formatter = new MessageFormat($source, $app->getCharset());
+ //mark untranslated text
+ if($ps=$config['marker'])
+ self::$formatter->setUntranslatedPS(array($ps,$ps));
+
//save the message on end request
Prado::getApplication()->attachEventHandler(
'OnEndRequest', array('Translation', 'saveMessages'));