mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-16 01:47:30 +01:00
fix user locale handling (#190)
* fix some french translations add more translations fix langage preference setup * handle i18n for delete space or folder * fix content layout for help text
This commit is contained in:
@@ -121,20 +121,26 @@ function boot_spacedeck() {
|
||||
var lang = "en";
|
||||
|
||||
window.refreshLocale = function() {
|
||||
if (spacedeck && spacedeck.user && spacedeck.user.preferences) {
|
||||
lang = spacedeck.user.preferences.language || "en";
|
||||
var old_lang = lang;
|
||||
if (spacedeck && spacedeck.user && spacedeck.user.prefs_language) {
|
||||
lang = spacedeck.user.prefs_language || "en";
|
||||
} else if (window.browser_lang) {
|
||||
lang = window.browser_lang;
|
||||
}
|
||||
if (lang != old_lang) {
|
||||
i18n.init({ lng: lang, resStore: window.locales }, function(err, t) {
|
||||
console.log("i18n initialized: "+lang);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.refreshLocale();
|
||||
|
||||
|
||||
i18n.init({ lng: lang, resStore: window.locales }, function(err, t) {
|
||||
console.log("i18n initialized: "+lang);
|
||||
});
|
||||
|
||||
window.__ = function() {
|
||||
window.__ = function() {
|
||||
var params = Array.prototype.slice.call(arguments);
|
||||
params.shift();
|
||||
window.refreshLocale();
|
||||
|
||||
Reference in New Issue
Block a user