Files
wehub-resource-sync 1d1286fadb
Build / Build and test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:18:38 +08:00

43 lines
1.2 KiB
Swift

import Foundation
import MacToolsPluginKit
enum AppL10n {
static func string(
_ key: String,
defaultValue: String,
table: String = "Localizable",
bundle: Bundle = .main
) -> String {
PluginRuntimeLocalization.string(
key,
defaultValue: defaultValue,
table: table,
bundle: bundle
)
}
static func settings(_ key: String, defaultValue: String) -> String {
string(key, defaultValue: defaultValue, table: "Settings")
}
static func plugins(_ key: String, defaultValue: String) -> String {
string(key, defaultValue: defaultValue, table: "Plugins")
}
static func settingsFormat(_ key: String, defaultValue: String, _ arguments: CVarArg...) -> String {
String(
format: settings(key, defaultValue: defaultValue),
locale: PluginRuntimeLocalization.locale,
arguments: arguments
)
}
static func pluginsFormat(_ key: String, defaultValue: String, _ arguments: CVarArg...) -> String {
String(
format: plugins(key, defaultValue: defaultValue),
locale: PluginRuntimeLocalization.locale,
arguments: arguments
)
}
}