summaryrefslogtreecommitdiff
path: root/framework/I18N/TGlobalization.php
diff options
context:
space:
mode:
authorxue <>2006-08-05 21:34:30 +0000
committerxue <>2006-08-05 21:34:30 +0000
commitb7f95ce37ae577e95a81e64aa2aaf3e2e698109d (patch)
tree85c6b9961ebbd4c9283fbd9b841703f9e4c47307 /framework/I18N/TGlobalization.php
parent550ba06593b467b643862d41a00ca2dd12ee704b (diff)
merge from 3.0 branch till 1329.
Diffstat (limited to 'framework/I18N/TGlobalization.php')
-rw-r--r--framework/I18N/TGlobalization.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index aa545d21..1ea7ce2b 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -168,12 +168,33 @@ class TGlobalization extends TModule
{
if($config['type'] == 'XLIFF' || $config['type'] == 'gettext')
{
- $config['source'] = Prado::getPathOfNamespace($config['source']);
- if($config['source']===null || !is_dir($config['source']))
- throw new TException("invalid source dir '{$config['source']}'");
+ if($config['source'])
+ {
+ $config['source'] = Prado::getPathOfNamespace($config['source']);
+ if(!is_dir($config['source']))
+ {
+ if(@mkdir($config['source'])===false)
+ throw new TConfigurationException('globalization_source_path_failed',
+ $config['source']);
+ chmod($config['source'], 0777); //make it deletable
+ }
+ }
+ else
+ {
+ throw new TConfigurationException("invalid source dir '{$config['source']}'");
+ }
}
if($config['cache'])
+ {
$config['cache'] = $this->getApplication()->getRunTimePath().'/i18n';
+ if(!is_dir($config['cache']))
+ {
+ if(@mkdir($config['cache'])===false)
+ throw new TConfigurationException('globalization_cache_path_failed',
+ $config['cache']);
+ chmod($config['cache'], 0777); //make it deletable
+ }
+ }
$this->_translation = $config;
}