mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +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]
|
||||
let plugin = obj.plugin
|
||||
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",
|
||||
default: true,
|
||||
getItem: () => plugin.started,
|
||||
@ -147,6 +147,16 @@ class Plugins{
|
||||
}
|
||||
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{
|
||||
|
Loading…
Reference in New Issue
Block a user