2022-04-26 22:48:17 +03:00
|
|
|
// swiftlint:disable all
|
|
|
|
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
// swiftlint:disable superfluous_disable_command file_length implicit_return
|
|
|
|
|
|
|
|
// MARK: - Strings
|
|
|
|
|
|
|
|
// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length
|
|
|
|
// swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces
|
2023-03-17 16:17:45 +00:00
|
|
|
public enum L10n {
|
|
|
|
/// Confirm
|
|
|
|
public static var actionConfirm: String { return L10n.tr("Localizable", "action_confirm") }
|
2022-04-26 22:48:17 +03:00
|
|
|
}
|
|
|
|
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length
|
|
|
|
// swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces
|
|
|
|
|
|
|
|
// MARK: - Implementation Details
|
|
|
|
|
2023-03-17 16:17:45 +00:00
|
|
|
extension L10n {
|
2022-04-26 22:48:17 +03:00
|
|
|
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
|
|
|
let languages = Bundle.preferredLanguages
|
|
|
|
|
|
|
|
for language in languages {
|
|
|
|
let translation = trIn(language, table, key, args)
|
|
|
|
if translation != key {
|
|
|
|
return translation
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return key
|
|
|
|
}
|
|
|
|
|
|
|
|
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String {
|
2022-06-29 18:32:14 +03:00
|
|
|
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: language) else {
|
2022-04-26 22:48:17 +03:00
|
|
|
// no translations for the desired language
|
|
|
|
return key
|
|
|
|
}
|
|
|
|
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
|
|
|
return String(format: format, locale: Locale(identifier: language), arguments: args)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-29 18:32:14 +03:00
|
|
|
private final class BundleToken {}
|
|
|
|
|