Skip to content
Snippets Groups Projects
Strings.swift 56 KiB
Newer Older
Bruno Muniz's avatar
Bruno Muniz committed
      }
      public enum Notifications {
        /// Selecting this setting will share your account ID and unique phone identifiers with a notification service run by the xx network team. However, these details are obfuscated via an #ID collision system# when you receive a notification. As a result, both the notifications service and your notifications provider (Firebase on Android, Apple on iOS) cannot tell exactly when you receive a message.
        public static let subtitle = Localized.tr("Localizable", "settings.infoPopUp.notifications.subtitle")
        /// Notifications
        public static let title = Localized.tr("Localizable", "settings.infoPopUp.notifications.title")
      }
      public enum Privacy {
        /// Because xx messenger does not capture your personal data or save your private keys, we will not be able to, at this time, help new users recover their account in case of being locked out, changing devices, etc. Account recovery support that continues to protect your privacy and personal data will be coming soon.
        public static let subtitle = Localized.tr("Localizable", "settings.infoPopUp.privacy.subtitle")
        /// Please note
        public static let title = Localized.tr("Localizable", "settings.infoPopUp.privacy.title")
      }
      public enum Traffic {
        /// Cover Traffic hides when you are sending messages by randomly sending messages to random users.  Other user’s phones will pick up these messages but they will not see them or know you sent them. As a result, it not only hides when you send messages, but helps hide who you are talking to. #Read more about it#
        public static let subtitle = Localized.tr("Localizable", "settings.infoPopUp.traffic.subtitle")
        /// Cover Traffic
        public static let title = Localized.tr("Localizable", "settings.infoPopUp.traffic.title")
      }
    }
    public enum Popup {
      /// %@ will be opened using your default browser
      public static func subtitle(_ p1: Any) -> String {
        return Localized.tr("Localizable", "settings.popup.subtitle", String(describing: p1))
      }
      /// Do you want to open %@?
      public static func title(_ p1: Any) -> String {
        return Localized.tr("Localizable", "settings.popup.title", String(describing: p1))
      }
    }
    public enum RemoteNotifications {
      /// Enable remote push notifications.
      public static let description = Localized.tr("Localizable", "settings.remoteNotifications.description")
      /// Push Notifications
      public static let title = Localized.tr("Localizable", "settings.remoteNotifications.title")
    }
    public enum Traffic {
      /// Enable cover traffic
      public static let subtitle = Localized.tr("Localizable", "settings.traffic.subtitle")
      /// Cover Traffic
      public static let title = Localized.tr("Localizable", "settings.traffic.title")
    }
  }

  public enum Shared {
    /// Done
    public static let done = Localized.tr("Localizable", "shared.done")
    /// #No internet connection.# Connect to a network to continue receiving messages.
    public static let networkIssue = Localized.tr("Localizable", "shared.networkIssue")
    /// #Your request failed#
    public static let requestFailed = Localized.tr("Localizable", "shared.requestFailed")
    /// Resend
    public static let resend = Localized.tr("Localizable", "shared.resend")
    public enum Search {
      /// Search
      public static let placeholder = Localized.tr("Localizable", "shared.search.placeholder")
    }
  }

  public enum Validator {
    public enum Code {
      /// Code length should be at least 4 chars
      public static let minimum = Localized.tr("Localizable", "validator.code.minimum")
    }
    public enum Email {
      /// The email provided is invalid
      public static let invalid = Localized.tr("Localizable", "validator.email.invalid")
      /// ^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
      public static let regex = Localized.tr("Localizable", "validator.email.regex")
    }
    public enum Phone {
      /// Phone length should be maximum 32 chars
      public static let maximum = Localized.tr("Localizable", "validator.phone.maximum")
      /// Phone length should be at least 4 chars
      public static let minimum = Localized.tr("Localizable", "validator.phone.minimum")
      /// This phone format doesn't fit the country
      public static let regexIssue = Localized.tr("Localizable", "validator.phone.regexIssue")
    }
    public enum Username {
      /// Character requirement met
      public static let approved = Localized.tr("Localizable", "validator.username.approved")
      /// Username can't be empty
      public static let empty = Localized.tr("Localizable", "validator.username.empty")
      /// The username provided contains one or more forbidden chars
      public static let invalid = Localized.tr("Localizable", "validator.username.invalid")
      /// Max character limit reached.
      public static let maximum = Localized.tr("Localizable", "validator.username.maximum")
      /// Username must be at least 4 characters
      public static let minimum = Localized.tr("Localizable", "validator.username.minimum")
      /// ^[a-zA-Z0-9][a-zA-Z0-9_\-+@.#]*[a-zA-Z0-9]$
      public static let regex = Localized.tr("Localizable", "validator.username.regex")
      /// Username must start and end with alphanumeric characters
      public static let startEnd = Localized.tr("Localizable", "validator.username.startEnd")
    }
  }
}
// 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 Localized {
  private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
    let format = BundleToken.bundle.localizedString(forKey: key, value: nil, table: table)
    return String(format: format, locale: Locale.current, arguments: args)
  }
}

// swiftlint:disable convenience_type
private final class BundleToken {
  static let bundle: Bundle = {
    #if SWIFT_PACKAGE
    return Bundle.module
    #else
    return Bundle(for: BundleToken.self)
    #endif
  }()
}
// swiftlint:enable convenience_type