mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
Support plugin name localization
This commit is contained in:
parent
eaa77728b9
commit
4d27499108
@ -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{
|
||||||
|
Loading…
Reference in New Issue
Block a user