Support plugin name localization

This commit is contained in:
KatieFrogs 2022-02-18 02:44:37 +03:00
parent eaa77728b9
commit 4d27499108

View File

@ -132,7 +132,7 @@ class Plugins{
var obj = this.allPlugins[i] var obj = this.allPlugins[i]
let plugin = obj.plugin let plugin = obj.plugin
items[obj.name] = { items[obj.name] = {
name: plugin.module.name || obj.name, name: plugin.module ? this.getLocalTitle(plugin.module.name || obj.name, plugin.module.name_lang) : obj.name,
type: "toggle", type: "toggle",
default: true, default: true,
getItem: () => plugin.started, getItem: () => plugin.started,
@ -147,6 +147,16 @@ class Plugins{
} }
return items return items
} }
getLocalTitle(title, titleLang){
if(titleLang){
for(var id in titleLang){
if(id === strings.id && titleLang[id]){
return titleLang[id]
}
}
}
return title
}
} }
class PluginLoader{ class PluginLoader{