Localization

HYPR SDK for iOS

Localizable.strings

The localizable.strings file contains strings from HYPR SDK for iOS.

"There is no Touch ID registered on the device. You can add one in your phone’s settings." = "";
"Please enter the Device Passcode at the Lock Screen to unlock Touch ID."= "";
"HYPR Fingerprint"= "";
"Login Failed"= "";
"Login Successful"= "";
"Operation successful"= "";
"Do you want to complete this authentication?"= "";
"Do you want to confirm this transaction?"= "";
"OK"= "";
"Do you want to confirm this operation?"= "";
"FAILED"= "";
"Confirm"= "";
"Cancel"= "";
"Begin"= "";
"Incorrect PIN"= "";
"Please check your PIN and try again"= "";
"Try Again"= "";
"Enter %lu Digit PIN"= "";
"Confirm %lu Digit PIN"= "";
"There is no Face ID registered on the device. You can add one in your phone’s settings."= "";
"There is no Passcode and FaceID set on the device. You can set them in your phone’s settings."= "";
"Please enter the Device Passcode at the Lock Screen to unlock Face ID."= "";
"There is no Touch ID registered on the device. You can add one in your phone’s settings." = "Translation: There is no Touch ID registered on the device. You can add one in your phone’s settings.";
"Please enter the Device Passcode at the Lock Screen to unlock Touch ID."= "Translation: Please enter the Device Passcode at the Lock Screen to unlock Touch ID.";
"HYPR Fingerprint"= "Translation: HYPR Fingerprint";
"Login Failed"= "Translation: Login Failed";
"Login Successful"= "Translation: Login Successful";
"Operation successful"= "Translation: Operation successful";
"Do you want to complete this authentication?"= "Translation: Do you want to complete this authentication?";
"Do you want to confirm this transaction?"= "Translation: Do you want to confirm this transaction?";
"OK"= "Translation: OK";
"Do you want to confirm this operation?"= "Translation: Do you want to confirm this operation?";
"FAILED"= "Translation: FAILED";
"Confirm"= "Translation: Confirm";
"Cancel"= "Translation: Cancel";
"Begin"= "Translation: Begin";
"Incorrect PIN"= "Translation: Incorrect PIN";
"Please check your PIN and try again"= "Translation: Please check your PIN and try again";
"Try Again"= "Translation: Try Again";
"Enter %lu Digit PIN"= "Translation: Enter %lu Digit PIN";
"Confirm %lu Digit PIN"= "Translation: Confirm %lu Digit PIN";
"There is no Face ID registered on the device. You can add one in your phone’s settings."= "Translation: There is no Face ID registered on the device. You can add one in your phone’s settings.";
"There is no Passcode and FaceID set on the device. You can set them in your phone’s settings."= "Translation: There is no Passcode and FaceID set on the device. You can set them in your phone’s settings.";
"Please enter the Device Passcode at the Lock Screen to unlock Face ID."= "Translation: Please enter the Device Passcode at the Lock Screen to unlock Face ID.";
"Confirm %lu Digit PIN"="Translation: Confirm %lu Digit PIN";
"Confirm Transaction"="Translation: Confirm Transaction";
"To enroll your Voice, please type a word or\n phrase you'd like to use as your unique\n signature:"="Translation: To enroll your Voice, please type a word or\n phrase you'd like to use as your unique\n signature:";
"ENROLL"="Translation: ENROLL";
"Please Authenticate Yourself"="Translation: Please Authenticate Yourself";
"Authentication Failed"="Translation: Authentication Failed";
"Your selected word or phrase will be your\n future signature authentication. Make sure\n it is memorable."="Translation: Your selected word or phrase will be your\n future signature authentication. Make sure\n it is memorable.";
"Enter %lu Digit PIN"="Translation: Enter %lu Digit PIN";
"Seems like we do not have a permission to use your Face ID..."="Translation: Seems like we do not have a permission to use your Face ID...";
"I FORGOT"="Translation: I FORGOT";
"Please try again later"="Translation: Please try again later";
"Dismiss"="Translation: Dismiss";
"Registration Failed."="Translation: Registration Failed.";
"Cancel"="Translation: Cancel";
"Please state your selected word or phrase\n in your natural voice."="Translation: Please state your selected word or phrase\n in your natural voice.";
"Confirm"="Translation: Confirm";
"Voice Authentication"="Translation: Voice Authentication";
"Say your word or phrase out loud"="Translation: Say your word or phrase out loud";
"Keep repeating until your voice is\n successfully recorded."="Translation: Keep repeating until your voice is\n successfully recorded.";
"OK"="Translation: OK";
"Your authentication has failed. Please remove and re-enroll the account to continue."="Translation: Your authentication has failed. Please remove and re-enroll the account to continue.";
"Open Settings"="Translation: Open Settings";
"Your word or phrase is"="Translation: Your word or phrase is";
"Seems like we do not have a permission to use your camera..."="Translation: Seems like we do not have a permission to use your camera...";
"Authentication Failed."="Translation: Authentication Failed.";
"Make sure to position your face within the outline."="Translation: Make sure to position your face within the outline.";
"Decentralized PIN Enrollment"="Translation: Decentralized PIN Enrollment";
"Decentralized PIN Authentication"="Translation: Decentralized PIN Authentication";
"Seems like we do not have a permission to use your microphone..."="Translation: Seems like we do not have a permission to use your microphone...";
"Cance"="Translation: Cancel";
"Enrolled"="Translation: Enrolled";
"Verified"="Translation: Verified";
"Failed"="Translation: Failed";

Localizing Error Strings

Skip to Step 3 if you can see the localizable.strings file in your project already.

  1. Create an empty localizable.strings file in the Base.lproj folder.

  2. Go to your Xcode project and add localizable.strings file to your project.

  3. Click on the project file and then choose the project (not target) in the left menu.

3348
  1. Click + in section Localizations and choose the language you want to add; for example, French (fr).
3110
  1. In the next menu ensure the localizable.string file is checked (you can uncheck everything else) and click Finish. It will create the fr.lproj folder in your project folder and add another instance to your localizable.strings, which you will see in your project navigator. It will be named Localizable.strings (French).
1466 3348
  1. The values on the right are the language-specific-values to be displayed in place of the default phrasing. Those values will be applied as soon as you switch the iPhone language to the language in question (French for this example).

πŸ“˜

Left No Trace

Do not modify the left side of the β€œ=β€œ sign in any of the localizable files; these values are keys and must remain unchanged.

πŸ“˜

Bad FIDO

Currently the error list includes only FIDO-related errors; it is not full and does not include user agent errors, etc. It is expected to expand with SDK growth; updating the list is the responsibility of the SDK consumer.

Example Code

Create the dictionary that will map error codes from HYPRError.h to its string representation from the same file:

// This class takes the error codes defined in HYPRError.h and converts them to strings, which are used as a keys in the Localizable.strings files

class HYPRErrorCodeMapper: NSObject {
    
    func map(code : Int) -> String {
        if let localizedKey = map[code] {
            return NSLocalizedString(localizedKey, comment: "")
        }
        return ""
    }
    
    let map = [
				...
        -7036 :    "HYPRErrorFaceAuthenticatorVerificationResultTimedOut",
        -7037 :    "HYPRErrorFaceAuthenticatorVerificationResultUnknownError",
        -20000 :    "HYPRErrorCoreHMACValidationFailed"]
}

After creating it, use it as follows:

HYPRUserAgent.sharedInstance().registerUser(withName: nil, action: "<Your policy name goes here>", completion: { (error) in
      if (error != nil) {
        // Handle Error
        print(HYPRErrorCodeMapper().map(code: unwrappedError.code))
        if let unwrappedRootError = unwrappedError.rootError() as NSError? {
          print(HYPRErrorCodeMapper().map(code: unwrappedRootError.code))
        }
      } else {
        // Handle Success
      }
    })

It will pick the error code and match it to the same value in the current language localizable.strings file.