Get current locale from the lang HTML attribute
The language attribute is present in all layouts since commit 025923ac4,
so there's no need to use the language selector locale. Besides, it
wouldn't work if there's only one locale and the language selector isn't
shown.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
App.Datepicker = {
|
||||
initialize: function() {
|
||||
var locale;
|
||||
locale = $("#js-locale").data("current-locale");
|
||||
locale = document.documentElement.lang;
|
||||
$(".js-calendar").datepicker({
|
||||
maxDate: "+0d"
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% if I18n.available_locales.size > 1 %>
|
||||
<div class="locale" id="js-locale" data-current-locale="<%= I18n.locale %>">
|
||||
<div class="locale">
|
||||
<form class="locale-form">
|
||||
<label class="inline-block" for="locale-switcher">
|
||||
<%= t("layouts.header.locale") %>
|
||||
|
||||
Reference in New Issue
Block a user