Class CDSHandlerAndroid

java.lang.Object
com.transifex.common.CDSHandler
com.transifex.txnative.CDSHandlerAndroid

public class CDSHandlerAndroid extends CDSHandler
A class that extends CDSHandler by adding a method that can fetch translations asynchronously.
See Also:
  • 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 to null, 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.