mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 10:22:58 +08:00
feat: 改进事件系统与全局快捷键 (#62)
This commit is contained in:
@@ -40,12 +40,17 @@ object I18n {
|
||||
}
|
||||
|
||||
fun getString(key: String, vararg args: Any): String {
|
||||
val text = getString(key)
|
||||
if (args.isNotEmpty()) {
|
||||
return MessageFormat.format(text, *args)
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
|
||||
fun getString(key: String): String {
|
||||
try {
|
||||
val text = substitutor.replace(bundle.getString(key))
|
||||
if (args.isNotEmpty()) {
|
||||
return MessageFormat.format(text, *args)
|
||||
}
|
||||
return text
|
||||
return substitutor.replace(bundle.getString(key))
|
||||
} catch (e: MissingResourceException) {
|
||||
if (log.isWarnEnabled) {
|
||||
log.warn(e.message, e)
|
||||
@@ -54,4 +59,5 @@ object I18n {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user