Tolgee is a powerful localization platform that simplifies the translation process for your applications. This SDK provides integration for Kotlin-based projects, with a primary focus on Android.
Currently, Android is fully supported, but any Kotlin-based codebase can in theory use this library.
- Over-the-air updates: Update your translations without releasing a new app version
- Multiple format support:
- Sprintf (Android SDK) formatting
- ICU (Tolgee Native Flat JSON) formatting
- Compose integration: Full integration with Jetpack Compose and Compose Multiplatform
- Compiler plugin: Automatically transform existing code to use Tolgee without manual changes
- Kotlin Multiplatform: Designed with multiplatform support in mind
The SDK is split into multiple modules, each serving a specific purpose:
- Core: Base library for fetching translations from CDN and querying them
- Compose: Extension for using the library with Jetpack Compose or Compose Multiplatform
- Gradle Plugin: Gradle plugin for integrating and configuring the compiler plugin
- If you are using traditional Android Views, use the Core module
- If you are using Jetpack Compose or Compose Multiplatform, use the Compose module
- If you want to automatically transform existing code to use Tolgee, add the Gradle Plugin
Note
For managing static translations (used as fallback), check out tolgee-cli. It provides tools for updating and syncing your static translation files.
In each demo project you can find an example of .tolgeerc
configuration file.
Using Version Catalog is highly recommended to keep your versions aligned.
# gradle/libs.versions.toml
[libraries]
tolgee = { group = "io.tolgee.mobile-kotlin-sdk", name = "core", version.ref = "tolgee" }
// build.gradle.kts
dependencies {
implementation(libs.tolgee)
}
# gradle/libs.versions.toml
[libraries]
tolgee = { group = "io.tolgee.mobile-kotlin-sdk", name = "compose", version.ref = "tolgee" }
// build.gradle.kts
dependencies {
implementation(libs.tolgee)
}
# gradle/libs.versions.toml
[plugins]
tolgee = { id = "io.tolgee.mobile-kotlin-sdk", version.ref = "tolgee" }
// build.gradle.kts
plugins {
alias(libs.plugins.tolgee)
}
For detailed usage instructions, please refer to the module-specific documentation:
- Core Module Documentation—For traditional Android and base functionality
- Compose Module Documentation—For Jetpack Compose and Compose Multiplatform
- Gradle Plugin Documentation—For compiler plugin configuration
Here's a quick example of initializing Tolgee in an Android application:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Tolgee.init {
contentDelivery {
url = "https://cdn.tolg.ee/your-cdn-url-prefix"
storage = TolgeeStorageProviderAndroid(this@MyApplication, BuildConfig.VERSION_CODE)
}
}
}
}
For complete examples of how to use the Tolgee SDK, check out the demo projects:
- Example Android—Traditional Android Views example
- Example Jetpack—Jetpack Compose example
- Multiplatform Compose—Compose Multiplatform example
Contributions are welcome! Please feel free to submit a Pull Request. Check out guidelines.md for some information about the project internals and information about the workflow.
This project is licensed under the Apache License 2.0—see the LICENSE file for details.
Let us know what you think! #FeedbackWanted ❤️
🧀