https://github.com/doist/android-translations-check
Android translations check Gradle plugin
https://github.com/doist/android-translations-check
Last synced: about 1 year ago
JSON representation
Android translations check Gradle plugin
- Host: GitHub
- URL: https://github.com/doist/android-translations-check
- Owner: Doist
- License: mit
- Created: 2020-12-02T09:57:41.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-06-23T09:24:41.000Z (about 1 year ago)
- Last Synced: 2025-06-23T10:29:25.071Z (about 1 year ago)
- Language: Kotlin
- Size: 80.1 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Translations Check Gradle Plugin
This Gradle plugin checks Android project translation strings.
In Android project strings included in alternative resources (i.e. `/src/main/res/values-pl/`) must
match default strings located in `/src/main/res/values/`. If the number of arguments or number of
entries in string-array is not the same, your app will likely crash.
This plugin checks if all translation strings match original ones. It will check strings included
in:
- `...>`
- `...>`
- `...>`
## How to use it 👣
Include (but don't apply) the plugin and specify the version in your root `build.gradle.kts` file:
```
plugins {
id("com.doist.gradle.android-translations-check") version "" apply false
}
```
And include the plugin in all `build.gradle.kts` modules with strings:
```
plugins {
id("com.doist.gradle.android-translations-check")
}
```
This plugin adds the `checkAndroidTranslations` Gradle task, so to check all translation strings,
run:
```
./gradlew checkAndroidTranslations
```
## Configuration ⚙️
The plugin runs without any configurations but in case you use any custom library for string
formatting like [Phrase](https://github.com/square/phrase) you can customize arguments regex. To do
this, include the following in your module `build.gradle.kts` file:
```
checkAndroidTranslationsConfig {
argumentRegex.set("""(?:%(?:[1-9]\$)?[sd%])|(?:\{[a-z_]+})""")
}
```
## Contributing 🤝
Feel free to open an issue or submit a pull request for any bugs/improvements.
## Acknowledgements 🙏
This plugin is based on [kotlin-gradle-plugin-template 🐘](https://github.com/cortinico/kotlin-gradle-plugin-template)