Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<string name="recovery_network_outdated">La aplicación está desactualizada y ya no puede comunicarse con el servidor. Actualízala en Google Play Store.</string>
<string name="recovery_app_manager">Ir al administrador de aplicaciones</string>
<string name="recovery_retry">Reintentar recuperación</string>
<string name="recovery_unable_to_claim_opportunity">No se puede reclamar la oportunidad, comunícate con un administrador.</string>
<string name="notification_channel_errors_title">Errores</string>
<string name="notification_channel_errors_description">Notificaciones para mensajes de error cuando algo sucede, por ejemplo, al instalar una aplicación de CommCare o al sincronizar formularios con el servidor</string>
<string name="notification_channel_user_session_title">Sesión de usuario</string>
Expand Down
1 change: 1 addition & 0 deletions app/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ License.
<string name="recovery_forms_send_error">Erreur lors de l\'envoi des formulaires</string>
<string name="recovery_forms_state_unavailable">Les formulaires ne sont pas disponibles. Vérifiez que l\'espace de stockage de votre téléphone est disponible.</string>
<string name="recovery_network_unavailable">Aucune connexion réseau. Veuillez vérifier votre connexion Internet et réessayer.</string>
<string name="recovery_unable_to_claim_opportunity">Impossible de réclamer l\'opportunité, veuillez contacter un administrateur.</string>
<string name="recovery_network_outdated">L\'application est obsolète et ne peut plus communiquer avec le serveur. Veuillez la mettre à jour sur le Google Play Store.</string>
<string name="recovery_app_manager">Accéder au gestionnaire d\'applications</string>
<string name="recovery_retry">Réessayer la récupération</string>
Expand Down
1 change: 1 addition & 0 deletions app/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ License.
<string name="recovery_forms_send_failure">फॉर्म जमा करते समय त्रुटियां हुईं।</string>
<string name="recovery_forms_send_parital_success">फॉर्म भेजते समय त्रुटियां हुईं। केवल %s भेजे गए थे। कृपया बाद में पुनः प्रयास करें।</string>
<string name="recovery_forms_send_network_error">खराब नेटवर्क के कारण फॉर्म भेजने में विफल रहा</string>
<string name="recovery_unable_to_claim_opportunity">अवसर का दावा करने में असमर्थ, कृपया एक व्यवस्थापक से संपर्क करें।</string>
<string name="recovery_forms_send_error">फॉर्म भेजते समय त्रुटि</string>
<string name="recovery_forms_state_unavailable">फॉर्म उपलब्ध नहीं हैं। जांचें कि आपके फ़ोन का संग्रहण स्थान उपलब्ध है।</string>
<string name="recovery_network_unavailable">कोई नेटवर्क कनेक्शन नहीं। कृपया अपना इंटरनेट कनेक्शन जांचें और पुनः प्रयास करें।</string>
Expand Down
1 change: 1 addition & 0 deletions app/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
<string name="recovery_forms_send_error">Erro ao enviar formulários</string>
<string name="recovery_forms_state_unavailable">Os formulários não estão disponíveis. Verifique se o armazenamento do seu telefone está disponível</string>
<string name="recovery_network_unavailable">Sem conexão de rede. Verifique sua internet e tente novamente.</string>
<string name="recovery_unable_to_claim_opportunity">Não é possível reivindicar a oportunidade, entre em contato com um administrador.</string>
<string name="recovery_network_outdated">O aplicativo está desatualizado e não consegue mais se comunicar com o servidor. Atualize o aplicativo na Google Play Store.</string>
<string name="recovery_app_manager">Vá para o Gerenciador de aplicativos</string>
<string name="recovery_retry">Tentar novamente a recuperação</string>
Expand Down
1 change: 1 addition & 0 deletions app/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<string name="recovery_forms_send_error">Hitilafu wakati wa kutuma fomu</string>
<string name="recovery_forms_state_unavailable">Fomu hazipatikani. Hakikisha hifadhi ya simu yako inapatikana</string>
<string name="recovery_network_unavailable">Hakuna muunganisho wa mtandao. Tafadhali angalia intaneti yako na ujaribu tena.</string>
<string name="recovery_unable_to_claim_opportunity">Imeshindwa kudai fursa, tafadhali wasiliana na msimamizi.</string>
<string name="recovery_network_outdated">Programu imepitwa na wakati na haiwezi tena kuwasiliana na seva. Tafadhali sasisha programu kwenye Google Play Store.</string>
<string name="recovery_app_manager">Nenda kwa Kidhibiti Programu</string>
<string name="recovery_retry">Jaribu Urejeshaji tena</string>
Expand Down
1 change: 1 addition & 0 deletions app/res/values-ti/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
<string name="recovery_forms_send_error">ቅጥዕታት ኣብ ምልኣክ ስሕተት ኣሎ</string>
<string name="recovery_forms_state_unavailable">ቅጥዕታት የለዉን:: ናይ ስልክካ ሰቶሬጅ ቦታ ከምዘለዎ ኣረጋግፅ</string>
<string name="recovery_network_unavailable">ናይ ኔትወርክ ምትእስሳር የለን::በይዝኦም ኢንተርኔቶም ኣረጋጊፆም እንደገና ይፈትኑ</string>
<string name="recovery_unable_to_claim_opportunity">ነቲ ዕድል ክትጥቀሙሉ ኣይከኣልኩምን፣ በይዝኦም ምስ ኣካያዲ ስራሕ ተራኸቡ።</string>
<string name="recovery_network_outdated">እቲ ኣፕሊኬሽን ግዜኡ ዝሓለፎ ሰለዝኮነ ድሕሪ ሕጂ ምስቲ ሰርቨር ክራኸብ ኣይክእልን እዩ። በይዝኦም ኣብ Google Play Store ብምእታውነቲ ኣፕሊኬሽን የዘምንዎ።</string>
<string name="recovery_app_manager">ናብ ኣፕሊኬሽን ማናጀር ኪድ</string>
<string name="recovery_retry">ንናይ</string>
Expand Down
1 change: 1 addition & 0 deletions app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
<string name="recovery_network_server_error">There was an error processing your request.</string>
<string name="recovery_network_cooldown">Too many request attempts, try again after an hour.</string>
<string name="recovery_network_unknown">Something went wrong, please try again.</string>
<string name="recovery_unable_to_claim_opportunity">Unable to claim the opportunity, please contact an administrator.</string>
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify string usage and translation coverage

Ensure all targeted locales include this key and that the code references the resource (not a hardcoded string).


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Resource entries for recovery_unable_to_claim_opportunity:"
rg -n 'name="recovery_unable_to_claim_opportunity"' app/res -C1 -g '!**/build/**'

echo
echo "Java/Kotlin references to the string:"
rg -nP '\bR\.string\.recovery_unable_to_claim_opportunity\b' app/src -C2 -g '!**/build/**'

echo
echo "Calls to showSnackBarForDismiss (should use the resource string):"
rg -nP '\bshowSnackBarForDismiss\s*\(' app/src -C2 -g '!**/build/**'

Length of output: 6212


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Checking translation coverage for 'recovery_unable_to_claim_opportunity':"
for dir in app/res/values*; do
  if [ -f "$dir/strings.xml" ]; then
    if grep -q 'name="recovery_unable_to_claim_opportunity"' "$dir/strings.xml"; then
      echo "$dir: present"
    else
      echo "$dir: MISSING'
    fi
  fi
done

Length of output: 299


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Translation coverage for 'recovery_unable_to_claim_opportunity':"
for dir in app/res/values*; do
  xml="$dir/strings.xml"
  if [ -f "$xml" ]; then
    if grep -q 'name="recovery_unable_to_claim_opportunity"' "$xml"; then
      echo "${dir##*/}: present"
    else
      echo "${dir##*/}: MISSING"
    fi
  fi
done

Length of output: 4868


Missing translations in Lithuanian and Norwegian

All code references use the resource (no hard-coded strings), and the key is present in the default and most locale folders. However, the following locale-specific strings.xml files are missing the recovery_unable_to_claim_opportunity entry:

  • app/res/values-lt/strings.xml: MISSING
  • app/res/values-no/strings.xml: MISSING

Please add the localized string for these languages (or confirm they aren’t targeted).

🤖 Prompt for AI Agents
In app/res/values/strings.xml around line 233 the key
recovery_unable_to_claim_opportunity exists in default strings but is missing
from locale files; add the same string resource key to
app/res/values-lt/strings.xml and app/res/values-no/strings.xml with appropriate
Lithuanian and Norwegian translations respectively (or state in a PR note that
those locales aren’t targeted), ensuring correct XML syntax, proper escaping,
and placement inside the <resources> block matching project formatting.

<string name="recovery_app_manager">Go to App Manager</string>
<string name="recovery_retry">Retry Recovery</string>
<string name="notification_channel_errors_title">Errors</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.commcare.fragments.connect;

import static org.commcare.utils.ViewUtils.showSnackBarWithDismissAction;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand All @@ -17,17 +18,13 @@
import org.commcare.android.database.connect.models.ConnectJobRecord;
import org.commcare.android.database.connect.models.ConnectPaymentUnitRecord;
import org.commcare.android.database.connect.models.ConnectUserRecord;
import org.commcare.android.database.global.models.ApplicationRecord;
import org.commcare.connect.database.ConnectJobUtils;
import org.commcare.connect.database.ConnectUserDatabaseUtil;
import org.commcare.connect.network.connect.ConnectApiHandler;
import org.commcare.connect.network.connectId.PersonalIdApiErrorHandler;
import org.commcare.dalvik.R;
import org.commcare.dalvik.databinding.FragmentConnectDeliveryDetailsBinding;
import org.commcare.google.services.analytics.FirebaseAnalyticsUtil;
import org.commcare.utils.MultipleAppsUtil;

import java.io.InputStream;

public class ConnectDeliveryDetailsFragment extends ConnectJobFragment {

Expand Down Expand Up @@ -108,7 +105,13 @@ public void onSuccess(Boolean data) {

@Override
public void onFailure(@NonNull PersonalIdOrConnectApiErrorCodes errorCode, @Nullable Throwable t) {
Toast.makeText(requireContext(), PersonalIdApiErrorHandler.handle(requireActivity(), errorCode, t), Toast.LENGTH_LONG).show();
String message;
if (errorCode == PersonalIdOrConnectApiErrorCodes.BAD_REQUEST_ERROR) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: We could use the if only to choose the string into a variable, then have a single line calling showSnackBarWithDismissAction (to reduce duplicated code).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@OrangeAndGreen updated it

message = getString(R.string.recovery_unable_to_claim_opportunity);
} else {
message = PersonalIdApiErrorHandler.handle(requireActivity(), errorCode, t);
}
showSnackBarWithDismissAction(binding.getRoot(), message);
FirebaseAnalyticsUtil.reportCccApiClaimJob(false);
}
}.claimJob(requireContext(), user, job.getJobId());
Expand Down
7 changes: 7 additions & 0 deletions app/src/org/commcare/utils/ViewUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import com.google.android.material.snackbar.Snackbar;

import org.commcare.dalvik.R;

public class ViewUtils {
/**
* Displays a SnackBar with the given message and an "OK" button.
Expand All @@ -18,4 +20,9 @@ public static void showSnackBarWithOk(View view, String message, View.OnClickLis
.setAction("OK", okClickListener)
.show();
}
public static void showSnackBarWithDismissAction(View view, String message) {
Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_INDEFINITE);
snackbar.setAction(view.getContext().getString(R.string.ok),v -> snackbar.dismiss());
snackbar.show();
}
}
Loading