diff --git a/core/js/js.js b/core/js/js.js index 566a3d4d8cd8db4eb9def4769651550f2c5424f4..94b78a2e9a9c89d536b285d12f61091dc2cf6ad7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -966,6 +966,12 @@ function object(o) { */ function initCore() { + /** + * Set users local to moment.js as soon as possible + */ + moment.locale($('html').prop('lang')); + + /** * Calls the server periodically to ensure that session doesn't * time out diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 963bf4cf5451f6fa592ee2ecb575a77ec9ec84e6..3325bc9165e4f6f7bd298b1de5ff23dfd4e4359a 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -1,10 +1,10 @@ <!DOCTYPE html> -<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]--> -<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]--> -<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false"><![endif]--> -<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false"><![endif]--> -<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false"><![endif]--> -<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false"><!--<![endif]--> +<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false" lang="<?php p($_['language']); ?>"><![endif]--> +<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><!--<![endif]--> <head> <title> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index da40fd83ad8044a736cb937caa43d7f54badcb19..0ad2ea4d8073b69467d34eda63f60e8d137e62d0 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -1,10 +1,10 @@ <!DOCTYPE html> -<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]--> -<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]--> -<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false"><![endif]--> -<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false"><![endif]--> -<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false"><![endif]--> -<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false"><!--<![endif]--> +<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false" lang="<?php p($_['language']); ?>"><![endif]--> +<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><!--<![endif]--> <head data-requesttoken="<?php p($_['requesttoken']); ?>"> <title> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index d0c6f9c38f5bac3db31b5fc44ae20e3e4091f1de..6164d16ac177ac22852e1a7133525dd7c5f1f88f 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -1,10 +1,10 @@ <!DOCTYPE html> -<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]--> -<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]--> -<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false"><![endif]--> -<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false"><![endif]--> -<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false"><![endif]--> -<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false"><!--<![endif]--> +<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false" lang="<?php p($_['language']); ?>"><![endif]--> +<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]--> +<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><!--<![endif]--> <head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>"> <title> diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php index cbaadd5768fb8fc0d2da2217c74460f2bf4749b0..a93449f202fd53b6bac199d7b6fc20a73e5ccb1b 100644 --- a/lib/private/templatelayout.php +++ b/lib/private/templatelayout.php @@ -33,7 +33,6 @@ class OC_TemplateLayout extends OC_Template { $this->config = \OC::$server->getConfig(); // Decide which page we show - if( $renderAs == 'user' ) { parent::__construct( 'core', 'layout.user' ); if(in_array(OC_APP::getCurrentApp(), array('settings','admin', 'help'))!==false) { @@ -85,7 +84,11 @@ class OC_TemplateLayout extends OC_Template { $this->assign('bodyid', 'body-login'); } else { parent::__construct('core', 'layout.base'); + } + // Send the language to our layouts + $this->assign('language', OC_L10N::findLanguage()); + if(empty(self::$versionHash)) { self::$versionHash = md5(implode(',', OC_App::getAppVersions()));