build: Enforce complete translations in CI checks#140
Conversation
Configured the `MissingTranslation` lint rule as a `fatal` error in the `app/build.gradle.kts`. This change hooks into the existing `lint` job in the `.github/workflows/check.yml` workflow. Any Pull Request that adds or removes strings without updating all corresponding language translations (`de`, `fr`, `zh`) will now automatically fail the CI build. Co-authored-by: Moustachauve <2206577+Moustachauve@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the project's continuous integration process by introducing a stricter check for internationalization. By elevating the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to enforce complete translations by making the MissingTranslation lint check fatal. While this is a good goal, the current implementation will likely break the build on the main branch due to existing untranslated strings. I've suggested using a lint baseline to apply this rule only to new changes, preventing disruption while still achieving the intended enforcement for future pull requests.
| lint { | ||
| fatal += "MissingTranslation" | ||
| } |
There was a problem hiding this comment.
This change will make the build fail immediately on your main branch because there are existing missing translations. For example, app/src/main/res/values/strings.xml contains a TODO for widget texts that are likely not translated yet.
To enforce this rule only for new changes, you should use a lint baseline. This will ignore existing issues and only report new ones. The project already uses this approach for detekt.
You can add the baseline to your lint configuration. After that, run ./gradlew :app:lint to generate the lint-baseline.xml file and commit it to your repository.
lint {
fatal += "MissingTranslation"
baseline = file("lint-baseline.xml")
}
Description
This Pull Request modifies the project's build configuration to enforce complete internationalization coverage on all pull requests.
By marking the Android Lint rule
MissingTranslationas afatalerror, any PR that adds a new string resource but fails to provide equivalent translations for all supported languages will now cause the existing GitHub Actions check to fail. This directly addresses the goal of notifying users when they need to provide all language translations.Changes
app/build.gradle.kts: Addedlint { fatal += "MissingTranslation" }to theandroidblock.Testing
./gradlew lintDebugon a codebase with a missing translation properly fails the build with a descriptive error.PR created automatically by Jules for task 6991151126945993938 started by @Moustachauve