Builder

Provides a builder pattern for constructing a Config instance with customizable properties. Supports fluent method chaining to set various parameters such as API keys, URLs, project ID, locale, network configuration, and CDN settings.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var availableLocales: List<Locale>?

A list of available locales. If specified, the app won't try to fetch a manifest from the server. Instead, it will use the provided list of locales. Can be used to save on network requests.

Link copied to clipboard

Represents the content delivery network (CDN) configuration associated with the builder.

Link copied to clipboard
var defaultLanguage: Locale?

The default language to use as a final fallback when the requested locale and its base language are not available. This ensures that users with unsupported languages receive translations from the CDN (in the default language) instead of falling back to native bundled translations.

Link copied to clipboard
var locale: Locale?

Represents the locale used for translations or language-specific configurations. This variable holds a Locale object that defines the language and region settings for the associated configuration or operation.

Link copied to clipboard

Represents the network configuration used within the Builder. This property defines the HTTP client and coroutine context used for executing network operations. Can be customized directly by setting a Network instance or using a builder lambda function.

Functions

Link copied to clipboard
fun availableLocales(vararg locales: Locale): Tolgee.Config.Builder

Sets the available locales configuration for the builder and returns the instance for further customization.

Link copied to clipboard

Sets the available locales configuration for the builder and returns the instance for further customization.

Link copied to clipboard

Builds and returns a new instance of the Config class using the provided builder properties.

Link copied to clipboard

Sets the CDN configuration for the Builder instance.

Configures the CDN settings for the builder.

Configures the content delivery settings for the Builder instance.

Link copied to clipboard

Sets the default language to use as a final fallback when the requested locale is not available.

Link copied to clipboard
fun locale(locale: Locale): Tolgee.Config.Builder

Sets the locale configuration for the builder and returns the instance for further customization.

Sets the locale for the configuration using the provided locale string.

Link copied to clipboard

Sets the locale configuration for the builder and returns the instance for further customization.

Link copied to clipboard

Configures the network settings for the builder.

Configures the network settings for the builder using the provided configuration block.