TXFileOutputCacheDecorator

public final class TXFileOutputCacheDecorator : TXDecoratorCache

Decorator class responsible for storing any updates of the translations to a file url specified in the constructor.

  • Initializes the decorator with a specific file url for storing the translations to the disk and an internal cache.

    Declaration

    Swift

    @objc
    public init(fileURL: URL?,
                internalCache: TXCache)

    Parameters

    fileURL

    The file url

    internalCache

    The internal cache

  • Encodes the provided translations to a JSON string and writes the string to a file using the fileURL property of the constructor.

    Declaration

    Swift

    public override func update(translations: TXTranslations)

    Parameters

    translations

    The provided translations