-
-
Notifications
You must be signed in to change notification settings - Fork 45
Adds back cc:translations and Cleanup #3521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Removed unused string resources that were not referenced in any code: - parse_coordinates_failure - location_provider_disabled - personakid_busy_message - your_score - connect_learn_try_again - login_connect_secondary_phone_message - connect_verify_pin_configured - connect_verify_configuration_failed - connect_learn_error_starting - connect_fetch_delivery_progress_error - connect_results_payment_confirm - connect_results_payment_confirm_undo - connect_results_payment_confirmed - connect_results_payment_not_confirmed - connect_payment_confirm_failed - connect_payment_acknowledge_notification_yes - connect_payment_acknowledge_notification_no - personalid_name_empty_error - personalid_photo_upload_failure - personalid_recovery_failed_title - personalid_recovery_lockout_title - personalid_recovery_failed_message - personalid_recovery_lockout_message - personalid_messaging_menu_title - connect_claim_job_error - commcarehq_worker - nav_drawer_work_history - user_name_placeholder Total: 174 lines removed across 7 files (values + 6 translations) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR refactors Personal ID-related string resources across the CommCare Android application by renaming legacy string keys from Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@app/docs/translations.md`:
- Around line 4-16: The doc has typos and a broken Markdown link: change
"mananged" to "managed", "2 distinct strings file" to "two distinct string
files" and "This file is a legacy way..." sentence for clarity; fix the broken
link that points to the mobile-deploy script/in-app translations (remove the
extra nested [url](...) and use a single proper Markdown link to the
mobile-deploy update_translations.py and the CommCare HQ translations doc), and
ensure references to android_translatable_strings.txt, strings.xml and the
cc:translatable attribute remain unchanged and clearly described.
In `@app/res/values-sw/strings.xml`:
- Around line 343-352: The resource keys for the PersonalId feature are
inconsistent: some strings use personalid_* (e.g., personalid_login,
personalid_link_app_title, personalid_link_app_message,
personalid_unlink_app_title, personalid_unlink_app_message, personalid_signup,
personalid_forget_user) while others use personaid_* (personaid_link_app_yes/no)
and PersonalIdManager.java expects personaid_*. Standardize to a single prefix
by renaming the personalid_* keys to personaid_* (e.g.,
personalid_link_app_title -> personaid_link_app_title, etc.) in strings.xml and
update any code references (or vice versa if you prefer the other convention) so
all keys referenced by PersonalIdManager.java match the strings.xml entries.
🧹 Nitpick comments (2)
app/src/org/commcare/connect/PersonalIdManager.java (1)
338-348: Standardizepersonaid_*resource naming.The
personaid_prefix looks like a typo vspersonalid_. Consider renaming for consistency across base + localized strings and all call sites.♻️ Suggested rename (requires resource updates)
- dialog.setPositiveButton(activity.getString(R.string.personaid_link_app_yes), (d, w) -> { + dialog.setPositiveButton(activity.getString(R.string.personalid_link_app_yes), (d, w) -> { activity.dismissAlertDialog(); unlockAndLinkConnect(activity, linkedApp, username, password, callback); }); - dialog.setNegativeButton(activity.getString(R.string.personaid_link_app_no), (d, w) -> { + dialog.setNegativeButton(activity.getString(R.string.personalid_link_app_no), (d, w) -> { activity.dismissAlertDialog(); ConnectAppDatabaseUtil.storeApp(activity, linkedApp); FirebaseAnalyticsUtil.reportPersonalIDLinking(linkedApp.getAppId(), FAILURE_USER_DENIED); callback.connectActivityComplete(false); });app/res/values/strings.xml (1)
462-468: Standardizepersonaid_*resource naming.The
personaid_prefix looks like a typo vspersonalid_. Consider renaming across base + localized strings and all call sites for consistency.♻️ Suggested rename (requires resource updates)
- <string name="personaid_link_app_yes">Yes</string> - <string name="personaid_link_app_no">No</string> + <string name="personalid_link_app_yes">Yes</string> + <string name="personalid_link_app_no">No</string>
| Strings in CommCare are mananged using 2 distinct strings file - | ||
|
|
||
| 1. [android_translatable_strings.txt](https://github.com/dimagi/commcare-android/blob/master/app/assets/locales/android_translatable_strings.txt) | ||
|
|
||
| This file is a legacy way to store the translatable strings for CommCare and should be avoided for any new strings. | ||
|
|
||
| 2. [Android strings.xml Resource](https://github.com/dimagi/commcare-android/blob/master/app/res/values/strings.xml) | ||
|
|
||
| This is where you should add any user-visible strings today using following guidelines - | ||
|
|
||
| - Do not add code only constants to this file which are not user visible | ||
| - Any strings which are used inside a CommCare HQ App sandbox (on screens that are behind user login) should be tagged with `cc:translatable="true"`. This tag is used inside the [mobile deploy](https://github.com/dimagi/mobile-deploy/blob/master/update_translations.py#L146) scripts to update the [in-app translations for CommCare HQ]([url](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/3161751555/Setting+Up+Translations+for+CommCare+Mobile+App?atlOrigin=eyJpIjoiNzNhY2NlY2JhZGZmNDlkMGE5MGYyMTMyNjZkMzhhNTIiLCJwIjoiYyJ9)) | ||
| - All other strings that are used outside the CommCare App sandbox should not define any `cc:translatable` value as it defaults to `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typos and the broken Markdown link.
Minor doc quality issue; the current link won’t render correctly, and there are a couple of typos.
✏️ Suggested edits
-Strings in CommCare are mananged using 2 distinct strings file -
+Strings in CommCare are managed using two distinct string files:
-This is where you should add any user-visible strings today using following guidelines -
+This is where you should add any user-visible strings today using the following guidelines:
-- Any strings which are used inside a CommCare HQ App sandbox (on screens that are behind user login) should be tagged with `cc:translatable="true"`. This tag is used inside the [mobile deploy](https://github.com/dimagi/mobile-deploy/blob/master/update_translations.py#L146) scripts to update the [in-app translations for CommCare HQ]([url](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/3161751555/Setting+Up+Translations+for+CommCare+Mobile+App?atlOrigin=eyJpIjoiNzNhY2NlY2JhZGZmNDlkMGE5MGYyMTMyNjZkMzhhNTIiLCJwIjoiYyJ9))
+- Any strings which are used inside a CommCare HQ App sandbox (on screens that are behind user login) should be tagged with `cc:translatable="true"`. This tag is used inside the [mobile deploy](https://github.com/dimagi/mobile-deploy/blob/master/update_translations.py#L146) scripts to update the [in-app translations for CommCare HQ](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/3161751555/Setting+Up+Translations+for+CommCare+Mobile+App?atlOrigin=eyJpIjoiNzNhY2NlY2JhZGZmNDlkMGE5MGYyMTMyNjZkMzhhNTIiLCJwIjoiYyJ9)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Strings in CommCare are mananged using 2 distinct strings file - | |
| 1. [android_translatable_strings.txt](https://github.com/dimagi/commcare-android/blob/master/app/assets/locales/android_translatable_strings.txt) | |
| This file is a legacy way to store the translatable strings for CommCare and should be avoided for any new strings. | |
| 2. [Android strings.xml Resource](https://github.com/dimagi/commcare-android/blob/master/app/res/values/strings.xml) | |
| This is where you should add any user-visible strings today using following guidelines - | |
| - Do not add code only constants to this file which are not user visible | |
| - Any strings which are used inside a CommCare HQ App sandbox (on screens that are behind user login) should be tagged with `cc:translatable="true"`. This tag is used inside the [mobile deploy](https://github.com/dimagi/mobile-deploy/blob/master/update_translations.py#L146) scripts to update the [in-app translations for CommCare HQ]([url](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/3161751555/Setting+Up+Translations+for+CommCare+Mobile+App?atlOrigin=eyJpIjoiNzNhY2NlY2JhZGZmNDlkMGE5MGYyMTMyNjZkMzhhNTIiLCJwIjoiYyJ9)) | |
| - All other strings that are used outside the CommCare App sandbox should not define any `cc:translatable` value as it defaults to `false` | |
| Strings in CommCare are managed using two distinct string files: | |
| 1. [android_translatable_strings.txt](https://github.com/dimagi/commcare-android/blob/master/app/assets/locales/android_translatable_strings.txt) | |
| This file is a legacy way to store the translatable strings for CommCare and should be avoided for any new strings. | |
| 2. [Android strings.xml Resource](https://github.com/dimagi/commcare-android/blob/master/app/res/values/strings.xml) | |
| This is where you should add any user-visible strings today using the following guidelines: | |
| - Do not add code only constants to this file which are not user visible | |
| - Any strings which are used inside a CommCare HQ App sandbox (on screens that are behind user login) should be tagged with `cc:translatable="true"`. This tag is used inside the [mobile deploy](https://github.com/dimagi/mobile-deploy/blob/master/update_translations.py#L146) scripts to update the [in-app translations for CommCare HQ](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/3161751555/Setting+Up+Translations+for+CommCare+Mobile+App?atlOrigin=eyJpIjoiNzNhY2NlY2JhZGZmNDlkMGE5MGYyMTMyNjZkMzhhNTIiLCJwIjoiYyJ9) | |
| - All other strings that are used outside the CommCare App sandbox should not define any `cc:translatable` value as it defaults to `false` |
🤖 Prompt for AI Agents
In `@app/docs/translations.md` around lines 4 - 16, The doc has typos and a broken
Markdown link: change "mananged" to "managed", "2 distinct strings file" to "two
distinct string files" and "This file is a legacy way..." sentence for clarity;
fix the broken link that points to the mobile-deploy script/in-app translations
(remove the extra nested [url](...) and use a single proper Markdown link to the
mobile-deploy update_translations.py and the CommCare HQ translations doc), and
ensure references to android_translatable_strings.txt, strings.xml and the
cc:translatable attribute remain unchanged and clearly described.
| <string name="personalid_login_with">Ingia kwa PersonalId</string> | ||
| <string name="personalid_link_app_title">Unganisha kwa PersonalId?</string> | ||
| <string name="personalid_link_app_message">Je, ungependa kuunganisha kuingia huku kwa akaunti yako ya PersonalId? Hutahitaji kuandika nenosiri lako katika siku zijazo.</string> | ||
| <string name="personalid_unlink_app_title">Je, ungependa kutenganisha PersonalId?</string> | ||
| <string name="personalid_unlink_app_message">Naona umeingia na nenosiri lako ingawa PersonalId ilisanidiwa kwa ajili ya kuingia kiotomatiki. Je, ungependa kutenganisha kuingia huku kutoka kwa PersonalId?</string> | ||
| <string name="personaid_link_app_yes">Ndiyo</string> | ||
| <string name="personaid_link_app_no">Hapana</string> | ||
| <string name="personalid_signup">Jisajili kwa PersonalId</string> | ||
| <string name="personalid_forget_user">Sahau mtumiaji wa PersonalId</string> | ||
| <string name="connect_refresh_opportunities">Onyesha Fursa</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check which key prefix is actually referenced across the repo
echo "=== Searching for personaid_link_app_ ==="
rg -n --fixed-strings 'personaid_link_app_'
echo ""
echo "=== Searching for personalid_link_app_ ==="
rg -n --fixed-strings 'personalid_link_app_'Repository: dimagi/commcare-android
Length of output: 4469
Standardize personaid_* vs personalid_* key naming.
Lines 348–349 use personaid_link_app_yes/no while lines 344–345 define personalid_link_app_title/message and the Java code references both patterns inconsistently. The personaid_* keys are actively used in PersonalIdManager.java, so they're intentional—but the inconsistent naming convention across the same logical feature set creates maintenance confusion. Standardize to one prefix throughout all related keys for clarity.
🤖 Prompt for AI Agents
In `@app/res/values-sw/strings.xml` around lines 343 - 352, The resource keys for
the PersonalId feature are inconsistent: some strings use personalid_* (e.g.,
personalid_login, personalid_link_app_title, personalid_link_app_message,
personalid_unlink_app_title, personalid_unlink_app_message, personalid_signup,
personalid_forget_user) while others use personaid_* (personaid_link_app_yes/no)
and PersonalIdManager.java expects personaid_*. Standardize to a single prefix
by renaming the personalid_* keys to personaid_* (e.g.,
personalid_link_app_title -> personaid_link_app_title, etc.) in strings.xml and
update any code references (or vice versa if you prefer the other convention) so
all keys referenced by PersonalIdManager.java match the strings.xml entries.
Product Description
Sometime back we mistakenly removed the translations attribute in these commits -
I have added them back and also added a readme on why these are necessary, along with some unused strings cleanup.
Motivated by - https://dimagi.atlassian.net/browse/CCCT-2059
Review Commit By Commit
Safety Assurance
Verified manually that all string resources removed are indeed not used in the code.
Labels and Review