register

abstract fun register(resourceLoader: ResourceLoader, languagesFolder: File): CompletableFuture<Void>

Registers a new language using resources.

Reads the language list from resources using ResourceLoader. The list should specify the available languages separated by '\n'. After reading the list, all languages from it will be read from resources as 'languages/?.toml' and saved to 'languagesFolder/?.toml'. Languages created or edited in the 'languagesFolder' will not be overwritten or deleted.

Default language is 'en_us'

Return

A CompletableFuture representing the completion of the registration process.

Parameters

resourceLoader

The resource loader for reading language resources.

languagesFolder

The folder where language files will be saved.


open fun register(crowdinProjectId: String, fileName: String?, resourceLoader: ResourceLoader, languagesFolder: File): CompletableFuture<Void?>

Registers a new language using crowdin.

This method works similarly to register, but it also uses crowdin as the default language source. Crowdin translations will be cached in 'languageFolder/.crowdin' for 3 days.

Return

A CompletableFuture representing the completion of the registration process.

Parameters

crowdinProjectId

The crowdin project ID for translations.

fileName

The name of the language file in crowdin (null for default).

resourceLoader

The resource loader for reading language resources.

languagesFolder

The folder where language files will be saved.


abstract fun register(url: URL, fileName: String?, resourceLoader: ResourceLoader, languagesFolder: File): CompletableFuture<Void?>

Registers a new language using crowdin.

This method works similarly to register, but it also uses crowdin as the default language source. Crowdin translations will be cached in 'languageFolder/.crowdin' for 3 days.

Return

A CompletableFuture representing the completion of the registration process.

Parameters

url

The crowdin project zip URL.

fileName

The name of the language file in crowdin (null for default).

resourceLoader

The resource loader for reading language resources.

languagesFolder

The folder where language files will be saved.