add userConfigOptions>i18n>langCode

This commit is contained in:
月月
2024-09-14 11:58:21 +08:00
parent c3cae0008f
commit 1e3f49a3f8
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
import configOptions from "../modules/.configuration/user_options.js";
function getLanguageCode() {
let langEnv = GLib.getenv('LANG') || GLib.getenv('LANGUAGE') || 'C.UTF-8'; // Assume the default value contains a dot
@@ -8,7 +9,7 @@ function getLanguageCode() {
}
const translations = {};
let currentLanguage = getLanguageCode();
let currentLanguage = configOptions.i18n.langCode || getLanguageCode();
// Load language file
async function loadLanguage(lang) {
@@ -69,6 +69,9 @@ let configOptions = {
'color': 'rgba(113,227,32,0.9)',
},
},
'i18n': {
'langCode': "",//Customize the locale, such as zh_CN
},
'monitors': {
'scaleMethod': "division", // Either "division" [default] or "gdk"
},