Strings.swift 5.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen

import Foundation

private class RingStringsBundleToken {}

// swiftlint:disable file_length
// swiftlint:disable line_length

// swiftlint:disable type_body_length
// swiftlint:disable nesting
// swiftlint:disable variable_name
// swiftlint:disable valid_docs

enum L10n {
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

  enum Alerts {
    /// Account Added
    static let accountAddedTitle = L10n.tr("alerts.accountAddedTitle")
    /// Can't find account
    static let accountCannotBeFoundTitle = L10n.tr("alerts.accountCannotBeFoundTitle")
    /// The account couldn't be created.
    static let accountDefaultErrorMessage = L10n.tr("alerts.accountDefaultErrorMessage")
    /// Unknown error
    static let accountDefaultErrorTitle = L10n.tr("alerts.accountDefaultErrorTitle")
    /// Could not add account because Ring couldn't connect to the distributed network. Check your device connectivity.
    static let accountNoNetworkMessage = L10n.tr("alerts.accountNoNetworkMessage")
    /// Can't connect to the network
    static let accountNoNetworkTitle = L10n.tr("alerts.accountNoNetworkTitle")
    /// Account couldn't be found on the Ring network. Make sure it was exported on Ring from an existing device, and that provided credentials are correct.
    static let acountCannotBeFoundMessage = L10n.tr("alerts.acountCannotBeFoundMessage")
  }

  enum Createaccount {
    /// Choose strong password you will remember to protect your Ring account.
    static let chooseStrongPassword = L10n.tr("createAccount.chooseStrongPassword")
    /// Create your Ring account
    static let createAccountFormTitle = L10n.tr("createAccount.createAccountFormTitle")
    /// Enter new username
    static let enterNewUsernamePlaceholder = L10n.tr("createAccount.enterNewUsernamePlaceholder")
    /// Invalid username
    static let invalidUsername = L10n.tr("createAccount.invalidUsername")
    /// Loading...
    static let loading = L10n.tr("createAccount.loading")
    /// Looking for username availability...
    static let lookingForUsernameAvailability = L10n.tr("createAccount.lookingForUsernameAvailability")
    /// New Password
    static let newPasswordPlaceholder = L10n.tr("createAccount.newPasswordPlaceholder")
    /// 6 characters minimum
    static let passwordCharactersNumberError = L10n.tr("createAccount.passwordCharactersNumberError")
    /// Passwords do not match
    static let passwordNotMatchingError = L10n.tr("createAccount.passwordNotMatchingError")
    /// Register public username (experimental)
    static let registerPublicUsername = L10n.tr("createAccount.registerPublicUsername")
    /// Repeat new password
    static let repeatPasswordPlaceholder = L10n.tr("createAccount.repeatPasswordPlaceholder")
    /// Username already taken
    static let usernameAlreadyTaken = L10n.tr("createAccount.usernameAlreadyTaken")
    /// Adding account
    static let waitCreateAccountTitle = L10n.tr("createAccount.waitCreateAccountTitle")
  }

  enum Global {
    /// Home
    static let homeTabBarTitle = L10n.tr("global.homeTabBarTitle")
Thibault Wittemberg's avatar
Thibault Wittemberg committed
66 67
    /// Me
    static let meTabBarTitle = L10n.tr("global.meTabBarTitle")
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
    /// Ok
    static let ok = L10n.tr("global.ok")
  }

  enum Smartlist {
    /// Conversations
    static let conversations = L10n.tr("smartlist.conversations")
    /// No results
    static let noResults = L10n.tr("smartlist.noResults")
    /// Searching...
    static let searching = L10n.tr("smartlist.searching")
    /// User found
    static let userFound = L10n.tr("smartlist.userFound")
    /// Yesterday
    static let yesterday = L10n.tr("smartlist.yesterday")
  }

  enum Welcome {
    /// Create a Ring account
    static let createAccount = L10n.tr("welcome.createAccount")
    /// Link this device to an account
    static let linkDeviceButton = L10n.tr("welcome.linkDeviceButton")
    /// A Ring account allows you to reach people securely in peer to peer through fully distributed network
    static let text = L10n.tr("welcome.text")
    /// Welcome to Ring
    static let title = L10n.tr("welcome.title")
  }
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
}

	struct LocalizableString {
        let key: String
        let args: [CVarArg]

        /**
         Returns String from Current Bundle
         */
        public var string: String {
            let format: String = NSLocalizedString(key, tableName: nil, bundle: Bundle(for: RingStringsBundleToken.self), value: "", comment: "")
            return String(format: format, locale: Locale.current, arguments: args)
        }

        /**
         Returns String translated from App's Bundle is found, otherwise from Current Bundle
         */
        public var smartString: String {
            // Load from App's Bundle first
            var format: String = NSLocalizedString(key, tableName: nil, bundle: Bundle.main, value: "", comment: "")
            if format != "" && format != key {
                return String(format: format, locale: Locale.current, arguments: args)
            }
            // Load from Current Bundle
            format = NSLocalizedString(key, tableName: nil, bundle: Bundle(for: RingStringsBundleToken.self), value: "", comment: "")

            return String(format: format, locale: Locale.current, arguments: args)
        }
    }

extension L10n {
  fileprivate static func tr(_ key: String, _ args: CVarArg...) -> LocalizableString {
    return LocalizableString(key: key, args: args)
  }
}

// swiftlint:enable type_body_length
// swiftlint:enable nesting
// swiftlint:enable variable_name
// swiftlint:enable valid_docs