Classes
The following classes are available globally.
-
Class that holds the configuration of the
See morepushTranslations()
method that controls various aspect of the push to CDS.Declaration
Swift
public final class TXPushConfiguration : NSObject
-
Cache provider that loads translations from disk
See moreDeclaration
Swift
public final class TXDiskCacheProvider : NSObject, TXCacheProvider
-
Decorator class responsible for storing any updates of the translations to a file url specified in the constructor.
See moreDeclaration
Swift
public final class TXFileOutputCacheDecorator : TXDecoratorCache
-
Class that makes the internal cache read-only so that no update operations are allowed.
See moreDeclaration
Swift
public final class TXReadonlyCacheDecorator : TXDecoratorCache
-
Composite class that accepts a number of cache providers and an internal cache. The providers are then used to update the internal class in the order they are added in the providers list.
Example usage:
See morelet cache = TXProviderBasedCache( providers: [ TXDiskCacheProvider(fileURL: firstFileURL), TXDiskCacheProvider(fileURL: secondFileURL) ], internalCache: TXMemoryCache() )
Declaration
Swift
public final class TXProviderBasedCache : TXDecoratorCache
-
Class responsible for updating the passed internalCache using a certain update policy defined in the
See moreTXCacheUpdatePolicy
enum. This is done by filtering any translations that are passed via theupdate(translations:)
call using an update policy that checks both the passed translations and the internal cache state to decide whether a translation should update the internal cache or not.Declaration
Swift
public final class TXStringUpdateFilterCache : TXDecoratorCache
-
The standard cache that the TXNative SDK is initialized with, if no other cache is provided.
The cache gets initialized using the decorators implemented in the Caches.swift file of the SDK so that it reads from any existing translation files either from the app bundle or the app sandbox. The cache is also responsible for creating or updating the sandbox file with new translations when they will become available and it offers a memory cache for retrieving such translations so that they can be displayed in the UI.
See moreDeclaration
Swift
public final class TXStandardCache : NSObject
-
A static class that is the main point of entry for all the functionality of Transifex Native throughout the SDK.
See moreDeclaration
Swift
public final class TXNative : NSObject
-
Class that returns the active language code that can be used for localization, based on the current user’s language preferences and the locales that the application supports. The class falls back to “en” if the language code cannot be found.
See moreDeclaration
Swift
public final class TXPreferredLocaleProvider : NSObject
extension TXPreferredLocaleProvider : TXCurrentLocaleProvider
-
Keeps track of the locale-related information for the application, such as supported locales, source and current locale.
See moreDeclaration
Swift
public final class TXLocaleState : NSObject
-
Class responsible for control logging in the SDK, allowing external log handlers to be updated by SDK clients via the
TXLogHandler
protocol.By default, TXLogger is initialized with a TXStandardLogHandler instance set to log only warning and error log messages.
See moreDeclaration
Swift
public final class TXLogger : NSObject
-
Helper log handler that accepts a minimum allowed log level.
If the SDK tries to log a level lower that the one passed in the initialization, then the message is not logged.
See moreDeclaration
-
Utility class that allows SDK clients to leverage the logic used for pluralization rules.
See moreDeclaration
Swift
public final class PluralUtils
-
Returns the source string when the translation string is missing.
See moreDeclaration
Swift
public final class TXSourceStringPolicy : NSObject, TXMissingPolicy
-
Returns a string that looks like the source string but contains accented characters.
Example:
See morePseudoTranslationPolicy().get("The quick brown fox")
Returns:Ťȟê ʠüıċǩ ƀȓøẁñ ƒøẋ
Declaration
Swift
public final class TXPseudoTranslationPolicy : NSObject, TXMissingPolicy
-
Wraps the returned string with a custom format.
Example:
See moreWrappedStringPolicy(">>", "<<").get("Click here")
Returns:>>Click here<<
Declaration
Swift
public final class TXWrappedStringPolicy : NSObject, TXMissingPolicy
-
Combines multiple policies to create a complex result.
The result of each policy if fed to the next as source.
See moreDeclaration
Swift
public final class TXCompositePolicy : NSObject, TXMissingPolicy
-
An error policy that simply returns the string that is going to be rendered in the UI instead of the translation.
See moreDeclaration
Swift
public final class TXRenderedSourceErrorPolicy : TXErrorPolicy
-
Publicly exposed class that holds all the information for the translation units that will be pushed to CDS.
This class mirrors the internal SourceString struct and offers a flat structure of the required and optional properties of the struct while also being able to be used both by Swift and Objective-C applications.
See moreDeclaration
Swift
public final class TXSourceString : NSObject