SCPLocaleConfig

Objective-C


@interface SCPLocaleConfig : NSObject <NSCopying>

Swift

class LocaleConfig : NSObject, NSCopying

Configures localization of API error messages returned through SCPApiError.message.

API errors surfaced through NSError‘s SCPErrorKeyStripeAPIError will have their SCPApiError.message translated to the resolved locale.

For smart readers, reader software version 2.43 or later is required for localization.

Note: The scope of localization may expand in future SDK releases. For example, NSError.localizedDescription and other SDK-originated strings may also be localized. Integrations should avoid relying on error message content for application logic. Use error codes such as SCPError and SCPApiError.code instead.

  • Localizes API error messages to the cardholder’s preferred language when available, falling back to the device locale otherwise. If either locale is not supported by Stripe’s localization infrastructure, error messages will fall back to English (en-US).

    During a transaction, if the card provides a language preference and the connected reader supports extracting it, that language is used. Card language preference extraction is supported on smart readers (contact transactions, v2.43+) and Tap to Pay on iPhone. Mobile readers (Bluetooth/USB) always fall back to the device locale.

    Use this option when you want error messages to automatically follow the device locale, or in customer-facing scenarios where the cardholder needs to understand the card decline error message.

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) SCPLocaleConfig *_Nonnull cardLanguagePreferenceIfAvailable;

    Swift

    class var cardLanguagePreferenceIfAvailable: LocaleConfig { get }
  • Unavailable

    Unavailable. Use cardLanguagePreferenceIfAvailable or SCPHardcodedLocaleConfigBuilder to create a locale config.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Unavailable

    Unavailable. Use cardLanguagePreferenceIfAvailable or SCPHardcodedLocaleConfigBuilder to create a locale config.

    Declaration

    Objective-C

    + (nonnull instancetype)new;