diff --git a/core/js/js.js b/core/js/js.js
index 566a3d4d8c..94b78a2e9a 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 963bf4cf54..3325bc9165 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -1,10 +1,10 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index da40fd83ad..0ad2ea4d80 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -1,10 +1,10 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 9445175efc..645a4c3065 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -1,10 +1,10 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php
index f5f079c8b2..b294cef55e 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) {
@@ -84,7 +83,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()));