mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 14:57:16 +08:00
fix: 菜单翻译无法被自动读取
This commit is contained in:
@@ -31,29 +31,3 @@ export function $ngettext(
|
||||
export function setCurrent(language: string) {
|
||||
gettext.current = language
|
||||
}
|
||||
|
||||
// 变通方法,由于 gettext 不能直接对动态标题进行翻译
|
||||
export function translateTitle(key: string): string {
|
||||
const titles: { [key: string]: string } = {
|
||||
// 主菜单标题
|
||||
Apps: $gettext('Apps'),
|
||||
Backup: $gettext('Backup'),
|
||||
Certificate: $gettext('Certificate'),
|
||||
Container: $gettext('Container'),
|
||||
Dashboard: $gettext('Dashboard'),
|
||||
Update: $gettext('Update'),
|
||||
Database: $gettext('Database'),
|
||||
Files: $gettext('Files'),
|
||||
Firewall: $gettext('Firewall'),
|
||||
Monitoring: $gettext('Monitoring'),
|
||||
Settings: $gettext('Settings'),
|
||||
Terminal: $gettext('Terminal'),
|
||||
Tasks: $gettext('Tasks'),
|
||||
Website: $gettext('Website'),
|
||||
// 应用标题
|
||||
'Rat Benchmark': $gettext('Rat Benchmark'),
|
||||
Toolbox: $gettext('Toolbox')
|
||||
}
|
||||
|
||||
return titles[key] || key
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export { translateTitle } from '@/locales/menu'
|
||||
export * from './auth'
|
||||
export * from './common'
|
||||
export * from './file'
|
||||
|
||||
Reference in New Issue
Block a user