ResourcesTranslationsProvider

public class ResourcesTranslationsProvider : TranslationsProvider

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Initializes the instance with the given language.

    Declaration

    Swift

    public init(languageCode: String? = nil)

    Parameters

    languageCode

    The language code in ISO 639-1 format, concatenting region code. For example: “pt_BR”, “EN_GB”

Public

  • Returns a localized string from a localization table (Localizable.strings).

    Declaration

    Swift

    public func translation(forKey key: String) -> String

    Parameters

    key

    The key for a string in the translation table.

    Return Value

    Returns a localized version of the string designated by the specified key. The method returns empty string if key not found in the table.