Skip to content

Conversation

@shubham1g5
Copy link
Contributor

@shubham1g5 shubham1g5 commented Jan 30, 2026

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

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

shubham1g5 and others added 4 commits January 30, 2026 13:59
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>
@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

This PR refactors Personal ID-related string resources across the CommCare Android application by renaming legacy string keys from connect_* and login_* prefixes to personalid_* prefixes for consistency. The changes include: adding a new translations documentation file; updating multiple language string resource files (Spanish, French, Hindi, Portuguese, Swahili, Tigrinya, and default) to replace old keys with new PersonalID-specific keys; adding translation metadata (cc:translatable="true") to strings in the main resource file; updating layout files to reference the renamed string keys; and updating Java code in activities and managers to use the new string resource identifiers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • Added hindi language translation to app #3228: Both PRs modify the same Hindi locale resource file and rename/restructure overlapping PersonalID-related string keys across translations.
  • -change from connect id to PersonalId #3157: Both PRs perform the same code-level renaming of PersonalID strings in resource files and update corresponding references in Java code and layouts.
  • Pm qa 7928 fix #3260: Both PRs modify the same UI string resources and update usages in the same Java classes (LoginActivity, CommCareSetupActivity, PersonalIdManager) to migrate from legacy to PersonalID-prefixed keys.

Suggested reviewers

  • avazirna
  • Jignesh-dimagi
  • conroy-ricketts
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Adds back cc:translations and Cleanup' accurately reflects the two main changes: restoring translation attributes and removing unused strings.
Description check ✅ Passed The description covers the main objective, motivation, and safety verification, though the template's QA Plan section is not fully addressed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch translations

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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: Standardize personaid_* resource naming.

The personaid_ prefix looks like a typo vs personalid_. 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: Standardize personaid_* resource naming.

The personaid_ prefix looks like a typo vs personalid_. 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>

Comment on lines +4 to +16
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`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

Comment on lines +343 to +352
<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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-integration-tests Skip android tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants