forked from Shinonome/dots-hyprland
add userConfigOptions>i18n>langCode
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
|
import configOptions from "../modules/.configuration/user_options.js";
|
||||||
|
|
||||||
function getLanguageCode() {
|
function getLanguageCode() {
|
||||||
let langEnv = GLib.getenv('LANG') || GLib.getenv('LANGUAGE') || 'C.UTF-8'; // Assume the default value contains a dot
|
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 = {};
|
const translations = {};
|
||||||
let currentLanguage = getLanguageCode();
|
let currentLanguage = configOptions.i18n.langCode || getLanguageCode();
|
||||||
|
|
||||||
// Load language file
|
// Load language file
|
||||||
async function loadLanguage(lang) {
|
async function loadLanguage(lang) {
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ let configOptions = {
|
|||||||
'color': 'rgba(113,227,32,0.9)',
|
'color': 'rgba(113,227,32,0.9)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'i18n': {
|
||||||
|
'langCode': "",//Customize the locale, such as zh_CN
|
||||||
|
},
|
||||||
'monitors': {
|
'monitors': {
|
||||||
'scaleMethod': "division", // Either "division" [default] or "gdk"
|
'scaleMethod': "division", // Either "division" [default] or "gdk"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user