Ticket #387: bug387.patch
| File bug387.patch, 3.3 kB (added by Julien, 1 year ago) |
|---|
-
lib/jelix/core/jSelector.class.php
old new 458 458 } 459 459 $this->locale = $locale; 460 460 $this->charset = $charset; 461 $this->_dirname = 'locales/' .$locale.'/';462 461 $this->_suffix = '.'.$charset.'.properties'; 463 $this->_cacheSuffix = '.'.$charset.'.php';464 462 $this->_compilerPath=JELIX_LIB_CORE_PATH.'jLocalesCompiler.class.php'; 465 463 466 464 #if ENABLE_PHP_JELIX … … 492 490 throw new jExceptionSelector('jelix~errors.selector.module.unknow', $this->toString()); 493 491 } 494 492 495 // on regarde si la locale a été redéfini 496 $overloadedPath = JELIX_APP_VAR_PATH.'overloads/'.$this->module.'/'.$this->_dirname.$this->resource.$this->_suffix; 497 if (is_readable ($overloadedPath)){ 498 $this->_path = $overloadedPath; 499 $this->_where = 'overloaded/'; 500 return; 493 494 $availableLocales = array($this->locale); 495 if($this->locale !== $gJConfig->locale) 496 $availableLocales[] = $gJConfig->locale; 497 if($this->locale !== $gJConfig->internalLocale && $gJConfig->locale !== $gJConfig->internalLocale) 498 $availableLocales[] = $gJConfig->internalLocale; 499 500 foreach($availableLocales as $locale){ 501 $this->_dirname = 'locales/' .$locale.'/'; 502 $overloadedPath = JELIX_APP_VAR_PATH.'overloads/'.$this->module.'/'.$this->_dirname.$this->resource.$this->_suffix; 503 if (is_readable ($overloadedPath)){ 504 $this->_path = $overloadedPath; 505 $this->_where = 'overloaded/'; 506 $this->_cacheSuffix = '.'.$locale.'.'.$this->charset.'.php'; 507 break; 508 } 509 $path = $gJConfig->_modulesPathList[$this->module].$this->_dirname.$this->resource.$this->_suffix; 510 if (is_readable ($path)){ 511 $this->_path = $path; 512 $this->_where = 'modules/'; 513 $this->_cacheSuffix = '.'.$locale.'.'.$this->charset.'.php'; 514 break; 515 } 501 516 } 502 // et sinon, on regarde si la locale existe dans le module en question 503 $this->_path = $gJConfig->_modulesPathList[$this->module].$this->_dirname.$this->resource.$this->_suffix; 504 505 if (!is_readable ($this->_path)){ 517 518 if(!$this->_path){ 506 519 throw new jExceptionSelector('jelix~errors.selector.invalid.target', array($this->toString(), "locale")); 507 520 } 508 $this->_where = 'modules/';509 521 } 510 522 511 523 protected function _createCachePath(){ -
lib/jelix/core/defaultconfig.ini.php
old new 7 7 charset = "UTF-8" 8 8 timeZone = "Europe/Paris" 9 9 10 ; internal locale, for jelix localized errors, when no locale can be found at all 11 ; (specific (de_AT) > generic (de_DE) > default-specific (es_AR) > default generic (es_ES)). 12 ; Must be en_EN of fr_FR (one the the native jelix generic locales) 13 internalLocale = en_EN 14 10 15 checkTrustedModules = off 11 16 12 17 ; list of modules : module,module,module
