import Foundation

extension String {
    /// Looks up this string in `Localizable.strings`.
    var localized: String {
        NSLocalizedString(self, bundle: .main, comment: "")
    }

    /// Localizes UI copy, except the fixed app brand name.
    var localizedUI: String {
        self == AppBrand.name ? self : localized
    }

    func localized(with arguments: CVarArg...) -> String {
        String(format: localized, locale: Locale.current, arguments: arguments)
    }
}
