✨ Get rid of twine replace with Sentiary#48
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis PR removes Twine-based localization (tasks, files, checks) and adds Sentiary: new plugin/convention, libs and properties, Sentiary export configuration for Android and iOS, updates scripts/docs, and adjusts generated resource files accordingly. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant DevCI as Dev/CI
participant Gradle as Gradle
participant Sentiary as Sentiary Plugin
participant MRGen as MR Generator
participant Android as Android/commonMain
participant Xcode as Xcode/iOS
DevCI->>Gradle: trigger build (assemble / bundle)
Gradle->>Sentiary: run sentiaryUpdateLocalizations
Sentiary->>Sentiary: fetch translations from Sentiary service
Sentiary->>Android: export (Format.Android) -> src/commonMain/moko-resources
Sentiary->>Xcode: export (Format.Apple) -> .lproj files in Xcode tree
Gradle->>MRGen: sentiaryUpdateLocalizations completes -> generate MR resources
MRGen->>Gradle: resources ready for packaging
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~23 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 completes the transition from Twine to Sentiary for managing all application strings and localizations. The change centralizes localization efforts on the Sentiary platform, which automatically fetches and generates translation files for both Android (Compose Resources) and iOS (Apple Strings) during the build process. This significantly simplifies the localization workflow, removes manual steps previously required for iOS builds, and ensures that the latest translations are always incorporated. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully replaces Twine with Sentiary for managing localizations. The overall implementation is good, with removal of old configurations and addition of new ones. However, there is a critical security issue: a Sentiary API key has been hardcoded in gradle.properties, which exposes it in version control. This key must be moved to a secure location. Additionally, there are a couple of minor maintainability improvements for the generated XML string files, such as ensuring they are sorted and end with a newline, which would make future reviews easier.
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
471-477:⚠️ Potential issue | 🟡 MinorRemove stale Twine references from Moko documentation section.
The README.md lines 471-477 reference
twine/errors.txtand thegenerateErrorsTwinegradle task, but the twine directory and all Twine infrastructure have been completely removed from the repository. Update this section to accurately document the current error message handling mechanism for Moko.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 471 - 477, Remove the stale Twine-specific references (twine/errors.txt and generateErrorsTwine) from the "Moko" README section and replace them with a brief description of the current workflow: state where error strings are now stored (the project’s moko-resources resource files used by moko-resources plugin), and explain that the moko-resources Gradle plugin generates the MR class (via the existing generateMRCommonMain task) which is used in common code to reference error messages; mention the MR symbol and the generateMRCommonMain task as the artifact consumers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@gradle.properties`:
- Around line 12-13: The file contains committed Sentiary secrets
(sentiary.projectId and sentiary.projectApiKey); remove these values from the
tracked gradle.properties, rotate the exposed API key immediately with Sentiary,
and replace the entries with non-secret placeholders (e.g.,
sentiary.projectId=REPLACE_ME and sentiary.projectApiKey=REPLACE_ME) or load
them from environment/config management instead; update your repo to stop
tracking secrets (git rm --cached or add gradle.properties to .gitignore) and
purge the sensitive value from history using git-filter-repo or BFG to fully
remove the leaked key.
In `@README.md`:
- Around line 463-465: Add a blank line immediately before the "#### Sentiary"
heading in README.md so the heading is separated from the preceding
paragraph/element (i.e., ensure there is an empty line above the line containing
"#### Sentiary"); this fixes the MD022 markdown linting issue and ensures proper
rendering of the Sentiary section.
In `@shared/base/build.gradle.kts`:
- Around line 47-58: The iOS resource outputDirectory configured inside
create("iOS") uses a duplicated path segment; update the
outputDirectory.set(...) call to point at the real iOS localization folder (e.g.
"ios/PresentationLayer/Resources/Localizable") instead of
"ios/PresentationLayer/Sources/PresentationLayer/Sources/PresentationLayer/Resources/Localizable";
keep the same create("iOS") block and folderNamingStrategy but simplify the path
to the correct existing directory or the intended target directory.
In `@shared/base/src/commonMain/moko-resources/cs/strings.xml`:
- Line 21: Update the Czech locale strings.xml entry for sample_feature_title so
it is translated to Czech instead of English; locate the <string
name="sample_feature_title"> element in the Czech resources (cs strings.xml) and
replace "Sample feature" with the proper Czech translation (e.g., "Ukázková
funkce") ensuring the XML string value is properly escaped if needed.
In `@shared/base/src/commonMain/moko-resources/sk/strings.xml`:
- Line 21: The string resource with name "sample_feature_title" is still
English; update its value in the Slovak localization by replacing "Sample
feature" with the correct Slovak translation (e.g., "Ukážková funkcia") in the
sk strings.xml entry so the UI is fully localized for the "sample_feature_title"
resource.
---
Outside diff comments:
In `@README.md`:
- Around line 471-477: Remove the stale Twine-specific references
(twine/errors.txt and generateErrorsTwine) from the "Moko" README section and
replace them with a brief description of the current workflow: state where error
strings are now stored (the project’s moko-resources resource files used by
moko-resources plugin), and explain that the moko-resources Gradle plugin
generates the MR class (via the existing generateMRCommonMain task) which is
used in common code to reference error messages; mention the MR symbol and the
generateMRCommonMain task as the artifact consumers.
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (16)
.github/workflows/an_pr_build.ymlREADME.mdbuild-logic/convention/build.gradle.ktsbuild-logic/convention/src/main/kotlin/config/TwineConfig.ktbuild-logic/convention/src/main/kotlin/plugin/AndroidApplicationConventionPlugin.ktbuild-logic/convention/src/main/kotlin/plugin/SentiaryConvention.ktbuild.gradle.ktsgradle.propertiesgradle/libs.versions.tomlios/scripts/generate-strings.shios/scripts/setup.shshared/base/build.gradle.ktsshared/base/src/commonMain/moko-resources/base/strings.xmlshared/base/src/commonMain/moko-resources/cs/strings.xmlshared/base/src/commonMain/moko-resources/sk/strings.xmltwine/strings.txt
💤 Files with no reviewable changes (6)
- ios/scripts/generate-strings.sh
- build-logic/convention/src/main/kotlin/plugin/AndroidApplicationConventionPlugin.kt
- ios/scripts/setup.sh
- build-logic/convention/src/main/kotlin/config/TwineConfig.kt
- twine/strings.txt
- .github/workflows/an_pr_build.yml
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ios/README.md (1)
63-79:⚠️ Potential issue | 🟠 MajorLocalization docs are inconsistent: Twine references remain after Sentiary migration.
The new Sentiary section conflicts with existing Twine instructions at Line 76-Line 78 (
twine/errors.txt,generateErrorsTwine). This leaves broken guidance in the same chapter.Suggested diff
### Moko - Error messages are shared via [Moko Resources](https://github.com/icerockdev/moko-resources), so that we can use the strings in the shared code and avoid duplicities when converting errors to string messages -- Error strings are stored in the `twine/errors.txt` file -- Script `generate-error-messages.sh` calls needed gradle tasks (`generateErrorsTwine` - and `generateMRCommonMain`) to generate `MR` class +- Error strings are sourced from Sentiary exports used by the build pipeline. +- Keep Moko generation instructions aligned with the current Sentiary-backed Gradle tasks.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ios/README.md` around lines 63 - 79, The README mixes old Twine instructions with the new Sentiary workflow causing confusion; remove or update the obsolete Twine references (twine/errors.txt, generateErrorsTwine, generateMRCommonMain, MR class) and either delete the generate-error-messages.sh section or replace it with the current Sentiary steps (how Sentiary exports Apple .strings and Compose resources and any Gradle plugin tasks), and ensure the README consistently documents only Sentiary usage and the correct script/Gradle task names.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ios/README.md`:
- Around line 63-64: Under the "## Localization" section update the Sentiary
heading from "#### Sentiary" to "### Sentiary" and insert a single blank line
immediately after that heading so the paragraph starting "All strings and
localizations..." is separated by an empty line, ensuring Markdown lint rules
are satisfied.
---
Outside diff comments:
In `@ios/README.md`:
- Around line 63-79: The README mixes old Twine instructions with the new
Sentiary workflow causing confusion; remove or update the obsolete Twine
references (twine/errors.txt, generateErrorsTwine, generateMRCommonMain, MR
class) and either delete the generate-error-messages.sh section or replace it
with the current Sentiary steps (how Sentiary exports Apple .strings and Compose
resources and any Gradle plugin tasks), and ensure the README consistently
documents only Sentiary usage and the correct script/Gradle task names.
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
ios/MateeStarter.xcodeproj/project.pbxprojios/README.mdios/scripts/rename.sh
💤 Files with no reviewable changes (2)
- ios/scripts/rename.sh
- ios/MateeStarter.xcodeproj/project.pbxproj
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ios/README.md`:
- Around line 65-70: The README still contains an outdated Moko subsection
referencing twine/errors.txt and the generateErrorsTwine task; update it to
reflect that all strings (including error strings) are now handled by Sentiary
or remove the Moko section entirely. Specifically, remove references to
generateErrorsTwine and twine/errors.txt (or replace them with a short note
explaining error strings are fetched via the Sentiary Gradle task), and mention
that generateMRcommonMain depends on sentiaryUpdateLocalizations so the Sentiary
flow provides Compose resources and Apple .strings; ensure the section mentions
Sentiary and the sentiaryUpdateLocalizations task by name to make the new flow
explicit.
In `@README.md`:
- Around line 465-470: Update the Sentiary section to stop claiming it manages
"All strings and localizations" and instead state it manages application UI
strings only; explicitly call out that error strings are handled separately via
the Twine/Moko pipeline (referencing twine/errors.txt and the Gradle task
generateErrorsTwine) and note that although generateMRCommonMain depends on
sentiaryUpdateLocalizations, Twine tasks remain active for error generation; add
a short sentence pointing readers to the Twine error file and the
generateErrorsTwine task for maintenance and where to find generated error
resources.
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
README.mdios/.gitignoreios/README.mdscripts/rename-project.shshared/base/src/commonMain/moko-resources/cs/strings.xmlshared/base/src/commonMain/moko-resources/sk/strings.xml
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
shared/base/build.gradle.kts (1)
47-50:⚠️ Potential issue | 🟠 MajorFix duplicated iOS output path segments in Sentiary export config.
At Line 49, the configured output path repeats
PresentationLayer/Sources/and is likely incorrect for the iOS resources destination.🛠️ Proposed fix
create("iOS") { format.set(Format.Apple) - outputDirectory.set(rootProject.layout.projectDirectory.dir("ios/PresentationLayer/Sources/PresentationLayer/Sources/PresentationLayer/Resources/Localizable")) + outputDirectory.set(rootProject.layout.projectDirectory.dir("ios/PresentationLayer/Resources/Localizable"))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shared/base/build.gradle.kts` around lines 47 - 50, The iOS export target created by create("iOS") has a duplicated segment in the outputDirectory.set(...) path; update the string passed to rootProject.layout.projectDirectory.dir(...) to remove the repeated "PresentationLayer/Sources/" so the path becomes "ios/PresentationLayer/Sources/PresentationLayer/Resources/Localizable" (leave the create("iOS") and format.set(Format.Apple) lines unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ios/README.md`:
- Around line 74-75: Remove the trailing whitespace at the end of the sentence
"Strings are shared via [Moko
Resources](https://github.com/icerockdev/moko-resources), so" in ios/README.md
(the line referenced in the diff) so the line no longer ends with extra spaces;
ensure the file contains no trailing spaces on that line to satisfy MD009.
---
Duplicate comments:
In `@shared/base/build.gradle.kts`:
- Around line 47-50: The iOS export target created by create("iOS") has a
duplicated segment in the outputDirectory.set(...) path; update the string
passed to rootProject.layout.projectDirectory.dir(...) to remove the repeated
"PresentationLayer/Sources/" so the path becomes
"ios/PresentationLayer/Sources/PresentationLayer/Resources/Localizable" (leave
the create("iOS") and format.set(Format.Apple) lines unchanged).
📝 Description
We decided to replace it with Sentiary.
💡 What’s new?
Removal of Twine:
The Twine dependency has been completely removed from the project.
iOS build optimization:
The pre-build action that manually downloaded localization strings has been removed.
Automation:
Localizations are now updated automatically as part of the standard project build process.
😶 What’s missing?
📚 References
Summary by CodeRabbit
New Features
Documentation
Chores