[-] Core: Locales should be setted anywhere #PSCFV-5953

This commit is contained in:
Rémi Gaillard committed 2012-12-04 15:40:17 +01:00
1 parent a1e91bcfa9
commit 4e9c534f1b
2 files changed
+12 -11

No files matched your search

+4 -10
View File
@@ -252,12 +252,6 @@ class FrontControllerCore extends Controller
CartRule::autoAddToCart($this->context); CartRule::autoAddToCart($this->context);
} }
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8');
setlocale(LC_COLLATE, $locale);
setlocale(LC_CTYPE, $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_NUMERIC, 'en_US.UTF-8');
/* get page name to display it in body id */ /* get page name to display it in body id */
// Are we in a payment module // Are we in a payment module
@@ -1144,12 +1138,12 @@ class FrontControllerCore extends Controller
* @return array * @return array
*/ */
public function initLogoAndFavicon() public function initLogoAndFavicon()
{ {
return array( return array(
'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'), 'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'),
'logo_image_width' => ($this->context->getMobileDevice() == false ? Configuration::get('SHOP_LOGO_WIDTH') : Configuration::get('SHOP_LOGO_MOBILE_WIDTH')), 'logo_image_width' => ($this->context->getMobileDevice() == false ? Configuration::get('SHOP_LOGO_WIDTH') : Configuration::get('SHOP_LOGO_MOBILE_WIDTH')),
'logo_image_height' => ($this->context->getMobileDevice() == false ? Configuration::get('SHOP_LOGO_HEIGHT') : Configuration::get('SHOP_LOGO_MOBILE_HEIGHT')), 'logo_image_height' => ($this->context->getMobileDevice() == false ? Configuration::get('SHOP_LOGO_HEIGHT') : Configuration::get('SHOP_LOGO_MOBILE_HEIGHT')),
'logo_url' => ($this->context->getMobileDevice() == false ? _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME') : _PS_IMG_.Configuration::get('PS_LOGO_MOBILE').'?'.Configuration::get('PS_IMG_UPDATE_TIME')) 'logo_url' => ($this->context->getMobileDevice() == false ? _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME') : _PS_IMG_.Configuration::get('PS_LOGO_MOBILE').'?'.Configuration::get('PS_IMG_UPDATE_TIME'))
); );
} }
} }
+8 -1
View File
@@ -107,6 +107,13 @@ Context::getContext()->country = $defaultCountry;
/* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */ /* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */
@date_default_timezone_set(Configuration::get('PS_TIMEZONE')); @date_default_timezone_set(Configuration::get('PS_TIMEZONE'));
/* Set locales */
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8');
setlocale(LC_COLLATE, $locale);
setlocale(LC_CTYPE, $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_NUMERIC, 'en_US.UTF-8');
/* Instantiate cookie */ /* Instantiate cookie */
@@ -122,7 +129,7 @@ else
else else
{ {
$domains = null; $domains = null;
if(Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl) if (Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl)
$domains = array(Context::getContext()->shop->domain_ssl, Context::getContext()->shop->domain); $domains = array(Context::getContext()->shop->domain_ssl, Context::getContext()->shop->domain);
$cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookie_lifetime, $domains); $cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookie_lifetime, $domains);