Beam/ElementX/Sources/Generated/Strings.swift

46 lines
1.5 KiB
Swift
Raw Normal View History

// 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
public enum L10n {
/// Confirm
public static var actionConfirm: String { return L10n.tr("Localizable", "action_confirm") }
}
// 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
extension L10n {
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 {
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: language) else {
// 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)
}
}
private final class BundleToken {}