An android gradle plugin for automating localization. It will automatically generate all strings.xml files for your desired languages.
Include the plugin in app level gradle
plugins {
...
...
// for kotlin
id("io.github.farimarwat.lokalenow") version "1.9"
//for groovy
id "io.github.farimarwat.lokalenow" version "1.9"
}
Also make sure that gradlePluginPortal() in included in settings.gradle.kts
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
Outside of the android{} block use this:
android{
...
...
}
// for kotlin
lokalenow{
languages = listOf("fr","ru","ar") //target languages codes
activate = true /// Enable automatic translation
}
// for groovy
lokalenow{
languages = ["fr","ru","ar"] //target languages codes
acivate = true // Enable automatic translation
}
When you will build, It will automatically generate strings.xml file according to requested languages.
Use "translatable=false" for excluding any translation
<string name="details" translatable="false">This will not be translated</string>
This gradle plugin is developed based upon google translate api. It may some time not work due to frequent requests.
Kindly perform these steps:
- Build>Clean Project
- Build>Rebuild Project
- Progress added
There is need to handle symbols while translation. If you want to improve the conversion process then feel free to contribute.
1.9
- Fixed %s format, newline and tab tag issue
- Bugs, after applying the plugin, red lines under each android{} configuration, fixed
- Other minor changes
1.4
- Fixed encoding issues
- Old file delete issue
1.3 Modified by RufenKhokhar
1.2 Minor bugs fixed
1.1 strings.xml path issue fixed for mac
1.0 Initial commit
If you want to support me then buy me a cup of tea: Buy