Package com.transifex.txnative
Class CDSHandlerAndroid
java.lang.Object
com.transifex.common.CDSHandler
com.transifex.txnative.CDSHandlerAndroid
A class that extends
CDSHandler
by adding a method that can fetch translations
asynchronously.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.transifex.common.CDSHandler
CDSHandler.FetchCallback
-
Field Summary
Fields inherited from class com.transifex.common.CDSHandler
CDS_HOST
-
Constructor Summary
ConstructorDescriptionCDSHandlerAndroid
(String[] localeCodes, String token, String secret, String csdHost) Creates a CDSHandler instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
fetchTranslationsAsync
(String localeCode, Set<String> tags, com.transifex.txnative.CDSHandlerAndroid.FetchTranslationsCallback callback) Fetch translations from CDS.Methods inherited from class com.transifex.common.CDSHandler
fetchTranslations, fetchTranslations, pushSourceStrings
-
Constructor Details
-
CDSHandlerAndroid
public CDSHandlerAndroid(@Nullable String[] localeCodes, @NonNull String token, @Nullable String secret, @NonNull String csdHost) Creates a CDSHandler instance.- Parameters:
localeCodes
- An array of locale codes that can be downloaded from CDS. The source locale can also be included.token
- The API token to use for connecting to the CDS.secret
- The API secret to use for connecting to the CDS.csdHost
- The host of the Content Delivery Service.
-
-
Method Details
-
fetchTranslationsAsync
public void fetchTranslationsAsync(@Nullable String localeCode, @Nullable Set<String> tags, @NonNull com.transifex.txnative.CDSHandlerAndroid.FetchTranslationsCallback callback) Fetch translations from CDS.The method is asynchronous. The callback is called on a background thread.
- Parameters:
localeCode
- An optional locale to fetch translations from; if set tonull
, it will fetch translations for the locale codes provided in the constructor.tags
- An optional set of tags. If defined, only strings that have all of the given tags will be fetched.callback
- A callback function to call when the operation is complete.
-