show locale example and apply new locale right away

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2017-11-12 11:06:15 +01:00
parent fd41192bb4
commit 0cacdd3132
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
3 changed files with 18 additions and 1 deletions

View File

@ -124,6 +124,10 @@ select {
}
}
#localeexample {
text-align: center;
}
input {
&#pass1,
&#pass2,

View File

@ -312,7 +312,7 @@ $(document).ready(function () {
value: selectedLocale
},
success: function() {
location.reload();
moment.locale(selectedLocale);
},
fail: function() {
OC.Notification.showTemporary(t('settings', 'An error occured while changing your locale. Please reload the page and try again.'));
@ -441,4 +441,12 @@ $(document).ready(function () {
}, user.displayName);
});
window.setInterval(function() {
$('#localeexample-time').text(moment().format('LTS'));
$('#localeexample-date').text(moment().format('L'));
$('#localeexample-fdow').text(t('settings', 'Week starts on {fdow}',
{fdow: moment().weekday(0).format('dddd')}));
}, 1000);
OC.Settings.updateAvatar = updateAvatar;

View File

@ -366,6 +366,11 @@ vendor_style('jcrop/css/jquery.Jcrop');
</option>
<?php endforeach;?>
</select>
<div id="localeexample">
<p id="localeexample-time"></p>
<p id="localeexample-date"></p>
<p id="localeexample-fdow"></p>
</div>
</form>
<?php } ?>
</div>