Skip to content

Commit

Permalink
Move download and audio strings to allow reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed Jan 30, 2024
1 parent 3b4c4b3 commit 4beef8f
Show file tree
Hide file tree
Showing 125 changed files with 192 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void makeProgressDialog() {
(dialog, which) -> cancelDownload());
}

mProgressDialog.setTitle(R.string.downloading_title);
mProgressDialog.setTitle(com.quran.mobile.common.download.R.string.downloading);
mProgressDialog.setMessage(mContext.getString(
R.string.downloading_message));
}
Expand All @@ -195,7 +195,7 @@ private void updateDownloadProgress(int progress,
mProgressDialog.show();
}
if (progress == -1) {
int titleId = R.string.downloading_title;
int titleId = com.quran.mobile.common.download.R.string.downloading;
mProgressDialog.setIndeterminate(true);
mProgressDialog.setMessage(mContext.getString(titleId));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public Intent notifyProgress(NotificationDetails details,
}

showNotification(details.title,
appContext.getString(R.string.downloading_title),
appContext.getString(com.quran.mobile.common.download.R.string.downloading),
DOWNLOADING_NOTIFICATION, true, max, progress, isIndeterminate, !isForeground);

final DownloadInfo downloadInfo =
Expand Down Expand Up @@ -317,7 +317,7 @@ public Intent notifyError(int errorCode, boolean isFatal, String filename, Notif
}

public void notifyDownloadStarting(){
String title = appContext.getString(R.string.downloading_title);
String title = appContext.getString(com.quran.mobile.common.download.R.string.downloading);
notificationManager.cancel(DOWNLOADING_ERROR_NOTIFICATION);

lastMaximum = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ private void downloadRequiredFiles() {

if (downloadType != QuranDownloadService.DOWNLOAD_TYPE_AUDIO) {
// if audio is playing, just show a status notification
ToastCompat.makeText(this, R.string.downloading_title,
ToastCompat.makeText(this, com.quran.mobile.common.download.R.string.downloading,
Toast.LENGTH_SHORT).show();
}
}
Expand Down Expand Up @@ -1838,7 +1838,7 @@ private void showProgressDialog() {
if (progressDialog == null) {
progressDialog = new ProgressDialog(this);
progressDialog.setIndeterminate(true);
progressDialog.setMessage(getString(R.string.index_loading));
progressDialog.setMessage(getString(com.quran.mobile.common.ui.core.R.string.loading));
progressDialog.show();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AyahPlaybackFragment : AyahActionFragment() {
for (i in 1..MAX_REPEATS) {
values[i - 1] = numberFormat.format(i.toLong())
}
values[MAX_REPEATS] = getString(R.string.infinity)
values[MAX_REPEATS] = getString(com.quran.mobile.common.ui.core.R.string.infinity)
if (isArabicNames) {
listOf(repeatVersePicker, repeatRangePicker, playbackSpeedPicker).forEach {
it.formatter = NumberPicker.Formatter { value: Int -> arFormat(value) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void setSpeed(float speed) {

public void setProgress(int progress) {
if (hasErrorText) {
progressText.setText(R.string.downloading_title);
progressText.setText(com.quran.mobile.common.download.R.string.downloading);
hasErrorText = false;
}

Expand Down Expand Up @@ -329,7 +329,7 @@ private void addDownloadOver3gPrompt() {
mPromptText.setGravity(Gravity.CENTER_VERTICAL);
mPromptText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
textFontSize);
mPromptText.setText(R.string.download_non_wifi_prompt);
mPromptText.setText(com.quran.mobile.common.download.R.string.download_non_wifi_prompt);
LayoutParams params = new LayoutParams(0,
LayoutParams.MATCH_PARENT);
params.weight = 1;
Expand All @@ -341,7 +341,8 @@ private void showProgress(int mode) {

removeAllViews();

final int text = mode == DOWNLOADING_MODE ? R.string.downloading_title : R.string.index_loading;
final int text = mode == DOWNLOADING_MODE ?
com.quran.mobile.common.download.R.string.downloading : com.quran.mobile.common.ui.core.R.string.loading;
if (isRtl) {
addDownloadProgress(text);
addSeparator();
Expand Down Expand Up @@ -544,7 +545,7 @@ private void updatePlaybackSpeed() {
private void updateRepeatButtonText() {
final String str;
if (currentRepeat == -1) {
str = context.getString(R.string.infinity);
str = context.getString(com.quran.mobile.common.ui.core.R.string.infinity);
} else if (currentRepeat == 0) {
str = "";
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/quran_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal|center_vertical"
android:text="@string/index_loading"
android:text="@string/loading"
android:visibility="gone" />
</LinearLayout>
4 changes: 0 additions & 4 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@
<string name="sura_ayah_notification_str">سُورَةُ %1$s، آية %2$d</string>
<string name="sura_ayah_sharing_str">سُورَةُ %1$s: %2$d</string>

<string name="index_loading">جاري التحميل…</string>

<string name="canceling">جاري إلغاء اﻷمر…</string>
<string name="juz2_description">الجزء %1$s</string>
<string name="manzil_description">منزل %1$s</string>
Expand All @@ -180,8 +178,6 @@
<string name="download_cancel">إلغاء</string>
<string name="download_extra_data">لدعم الترجمة و المشاركة يجب تحميل بعض
الملفات .. حمل الأن؟</string>
<string name="download_non_wifi_prompt">أنت لست على واي فاي. تحميل البيانات على أية حال؟</string>

<!-- translation database stuff -->
<string name="remove_dlg_title">امسح التفسير/الترجمة؟</string>
<string name="remove_dlg_msg">هل ترغب في حذف %1$s؟</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-az/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@
<string name="sura_ayah_notification_str">Sure %1$s, âyet %2$d</string>
<string name="sura_ayah_sharing_str">Sure %1$s: %2$d</string>

<string name="index_loading">Yükleniyor&#8230;</string>

<string name="update_available">Güncelleme var</string>
<string name="translation_updates_available">Meâller için güncelleme mevcut. Meâl indirme sayfasını şimdi gözetmek istermisiniz?</string>
<string name="translation_dialog_later">Sonra</string>
Expand Down Expand Up @@ -220,8 +218,6 @@
<string name="download_error_invalid_download_retry">Bozuk dosya, tekrar deneniyor</string>
<string name="download_error_network_retry">İnternet bağlantısı hatası, kurtarılmaya çalışılıyor</string>
<string name="notification_download_canceled">İndirme iptal edildi</string>
<string name="download_non_wifi_prompt">Kablosuz bağlantı mevctu değil. Yine de indirmek istiyor musunuz?</string>

<!-- downloading dialogs -->
<string name="process_progress"> %1$d / %2$d dosya işleniyor</string>
<string name="download_retry">Tekrar dene</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-bs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@
<string name="sura_ayah_notification_str">Sura %1$s, %2$d. ajet</string>
<string name="sura_ayah_sharing_str">Sura %1$s: %2$d</string>

<string name="index_loading">Učitavam…</string>

<string name="canceling">Prekidam&#8230;</string>
<string name="juz2_description">Džuz %1$s</string>
<string name="page_description">Stranica %1$s, Džuz %2$s</string>
Expand All @@ -236,8 +234,6 @@
<string name="download_error_invalid_download_retry">Greška kod datoteke, pokušavam da je ponovo preuzmem</string>
<string name="download_error_network_retry">Problemi sa mrežom, pokušavam da nastavim&#8230;</string>
<string name="notification_download_canceled">Preuzimanje otkazano</string>
<string name="download_non_wifi_prompt">Wi-Fi vam nije uključen. Ipak preuzeti datoteke?</string>

<!-- downloading dialogs -->
<string name="process_progress">Procesiranje datoteke %1$d / %2$d</string>
<string name="download_retry">Ponovi</string>
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@
<string name="sura_ayah_notification_str">Sure %1$s, Vers %2$d</string>
<string name="sura_ayah_sharing_str">Sure %1$s: %2$d</string>

<string name="index_loading">Lade&#8230;</string>

<string name="canceling">Abbrechen&#8230;</string>
<string name="juz2_description">Juz\' %1$s</string>
<string name="page_description">Seite %1$s, Juz\' %2$s</string>
Expand Down Expand Up @@ -243,9 +241,6 @@
<string name="download_error_network_retry">Netzwerk-Fehler, es wird versucht eine Verbindung
aufzubauen&#8230;</string>
<string name="notification_download_canceled">Download abgebrochen</string>
<string name="download_non_wifi_prompt">Sie sind nicht mit einem W-LAN verbunden. Möchten Sie die
Dateien trotzdem herunterladen?
</string>

<!-- downloading dialogs -->
<string name="process_progress">Datei wird verarbeitet %1$d / %2$d</string>
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
<string name="quran_sura_title">Capítulo %1$s</string>
<string name="sura_ayah_notification_str">Capítulo %1$s, Versículo %2$d</string>
<string name="sura_ayah_sharing_str">Capítulo %1$s: %2$d</string>
<string name="index_loading">Cargando…</string>
<string name="canceling">Cancelando…</string>
<string name="juz2_description">Yuz %1$s</string>
<string name="page_description">Página %1$s, Yuz %2$s</string>
Expand All @@ -133,7 +132,6 @@
<string name="download_error_invalid_download_retry">Archivos dañados, tratando de volver a descargar</string>
<string name="download_error_network_retry">Error de la red, intentando reanudar…</string>
<string name="notification_download_canceled">Descarga cancelada</string>
<string name="download_non_wifi_prompt">No estás conectado a una red WiFi. ¿Descargar los datos de todos modos?</string>
<!--downloading dialogs-->
<string name="process_progress">Procesando archivo %1$d / %2$d</string>
<string name="download_retry">Reintente</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@
<string name="sura_ayah_notification_str">سوره %1$s، آیه %2$d</string>
<string name="sura_ayah_sharing_str">سوره %1$s: %2$d</string>

<string name="index_loading">بارگذاری…</string>

<string name="canceling">در حال لغو</string>
<string name="page_description">صفحه %1$s، جزء %2$s</string>
<string name="highlighting_database">فایل‌های موردنیاز</string>
Expand All @@ -137,8 +135,6 @@
<string name="download_error_invalid_download_retry">فایل خراب است. دوباره بارگذاری نمایید</string>
<string name="download_error_network_retry">خطای شبکه، تلاش مجدد…</string>
<string name="notification_download_canceled">بارگذاری لغو شد</string>
<string name="download_non_wifi_prompt">شبکه بی‌سیم قطع است. بارگذاری انجام شود؟</string>

<!-- downloading dialogs -->
<string name="process_progress">در حال پردازش %1$d / %2$d</string>
<string name="download_retry">تلاش دوباره</string>
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
<string name="quran_sura_title">Sourate %1$s</string>
<string name="sura_ayah_notification_str">Sourate %1$s, Aya %2$d</string>
<string name="sura_ayah_sharing_str">Sourate %1$s: %2$d</string>
<string name="index_loading">Chargement…</string>
<string name="canceling">Annulation…</string>
<string name="juz2_description">Juz\' %1$s</string>
<string name="page_description">Page %1$s, Juz\' %2$s</string>
Expand All @@ -200,8 +199,6 @@
<string name="download_error_invalid_download_retry">Fichier corrompu, nouvelle tentative de téléchargement</string>
<string name="download_error_network_retry">Erreur réseau, tentative de reprise…</string>
<string name="notification_download_canceled">Téléchargement annulé</string>
<string name="download_non_wifi_prompt">Vous n\'êtes pas en wifi. Télécharger les données malgré tout ?</string>

<!-- downloading dialogs -->
<string name="process_progress">Traitement du fichier %1$d / %2$d</string>
<string name="download_retry">Réessayer</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@
<string name="sura_ayah_notification_str">Sura %1$s, %2$d. ajet</string>
<string name="sura_ayah_sharing_str">Sura %1$s: %2$d</string>

<string name="index_loading">Učitavam…</string>

<string name="canceling">Prekidam&#8230;</string>
<string name="juz2_description">Džuz %1$s</string>
<string name="page_description">Stranica %1$s, Džuz %2$s</string>
Expand All @@ -236,8 +234,6 @@
<string name="download_error_invalid_download_retry">Greška kod datoteke, pokušavam da je ponovo preuzmem</string>
<string name="download_error_network_retry">Problemi sa mrežom, pokušavam da nastavim&#8230;</string>
<string name="notification_download_canceled">Preuzimanje otkazano</string>
<string name="download_non_wifi_prompt">Wi-Fi vam nije uključen. Ipak preuzeti datoteke?</string>

<!-- downloading dialogs -->
<string name="process_progress">Procesiranje datoteke %1$d / %2$d</string>
<string name="download_retry">Ponovi</string>
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,11 @@
<string name="sura_ayah_notification_str">%1$s szúra, %2$d. ája</string>
<string name="sura_ayah_sharing_str">%1$s szúra: %2$d</string>

<string name="index_loading">Betöltés&#8230;</string>

<string name="canceling">Megszakítás&#8230;</string>
<string name="juz2_description">%1$s. dzsuz</string>
<string name="page_description">%1$s. oldal, %2$s. dzsuz</string>
<string name="highlighting_database">Szükséges fájlok</string>
<string name="timing_database">Szükséges fájlok</string>
<string name="infinity">&#8734;</string>

<!-- download statuses and errors -->
<string name="sdcard_error">Nem található SD-kártya. Kérem, csatlakoztassa és próbálja újra.</string>
Expand All @@ -176,8 +173,6 @@
<string name="download_error_invalid_download_retry">Sérült fájl, kísérlet ismételt letöltésre</string>
<string name="download_error_network_retry">Hálózati hiba, kísérlet a folytatásra&#8230;</string>
<string name="notification_download_canceled">Letöltés megszakítva</string>
<string name="download_non_wifi_prompt">Nem használ Wi-Fi-t. Mindenképpen letölti az adatokat?</string>

<!-- downloading dialogs -->
<string name="process_progress">Fájl feldolgozása %1$d / %2$d</string>
<string name="download_retry">Ismét</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@
<string name="sura_ayah_notification_str">Surat %1$s, Ayat %2$d</string>
<string name="sura_ayah_sharing_str">Surat %1$s: %2$d</string>

<string name="index_loading">Memuat&#8230;</string>

<string name="canceling">Membatalkan&#8230;</string>
<string name="juz2_description">Juz\' %1$s</string>
<string name="page_description">Halaman %1$s, Juz\' %2$s</string>
Expand All @@ -225,8 +223,6 @@
<string name="download_error_invalid_download_retry">Berkas cacat, mencoba mengunduh ulang</string>
<string name="download_error_network_retry">Jaringan bermasalah, mencoba mengulangi&#8230;</string>
<string name="notification_download_canceled">Pengunduhan dibatalkan</string>
<string name="download_non_wifi_prompt">Anda tidak tersambung ke Wi-Fi. Tetap unduh datanya?</string>

<!-- downloading dialogs -->
<string name="process_progress">Memproses berkas %1$d / %2$d</string>
<string name="download_retry">Coba Lagi</string>
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<string name="quran_sura_title">Sura %1$s</string>
<string name="sura_ayah_notification_str">Sura %1$s, Ayah %2$d</string>
<string name="sura_ayah_sharing_str">Sura %1$s: %2$d</string>
<string name="index_loading">Caricamento&#8230;</string>
<string name="canceling">Cancellazione di&#8230;</string>
<string name="juz2_description">Ğuz\' %1$s</string>
<string name="page_description">Pagina %1$s, Ğuz\' %2$s</string>
Expand Down Expand Up @@ -165,7 +164,6 @@
<string name="download_error_invalid_download">Il file scaricato era corrotto</string>
<string name="download_error_invalid_download_retry">File corrotto, tentativo di riscaricamento</string>
<string name="download_error_network_retry">Errore di rete, cercando di riprendere&#8230;</string>
<string name="download_non_wifi_prompt">Non sei su Wi-Fi. Scaricare dati in ogni caso?</string>
<string name="download_processing">Elaborazione Scarica&#8230;</string>
<string name="translation_updates_available">È disponibile un aggiornamento per alcune delle tue traduzioni. Visita la schermata delle traduzioni ora?</string>
<string name="please_grant_permissions">Si prega di concedere il permesso nelle impostazioni dell\'applicazione</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-kk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@
<string name="sura_ayah_notification_str">%1$s сүресі, %2$d-аят</string>
<string name="sura_ayah_sharing_str">%1$s сүресі: %2$d</string>

<string name="index_loading">Жүктеу…</string>

<string name="canceling">Болдырмау&#8230;</string>
<string name="juz2_description">%1$s-пара</string>
<string name="page_description">%1$s-бет, %2$s-пара</string>
Expand All @@ -228,8 +226,6 @@
<string name="download_error_invalid_download_retry">Файл бүлінген; қайта жүктелуде&#8230;</string>
<string name="download_error_network_retry">Байланыс қателігі; қайта қосылуда&#8230;</string>
<string name="notification_download_canceled">Жүктелу тоқтатылды</string>
<string name="download_non_wifi_prompt">Wi-Fi қосылмаған. Бәрібір жүктелсін бе?</string>

<!-- downloading dialogs -->
<string name="process_progress">%1$d/%2$d жүктелді</string>
<string name="download_retry">Қайталау</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-ku/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@
<string name="sura_ayah_notification_str">سورەتی %1$s, ئایەتی %2$d</string>
<string name="sura_ayah_sharing_str">سورەتی %1$s: %2$d</string>

<string name="index_loading">چاوەڕوانبە…</string>

<string name="canceling">هەڵوەشاندنەوە&#8230;</string>
<string name="juz2_description">جوزئی %1$s</string>
<string name="page_description">پەڕەی %1$s, جوزئی %2$s</string>
Expand All @@ -154,8 +152,6 @@
<string name="download_error_invalid_download_retry">فایل تێکچووە، هەوڵدان بۆ داگرتنەوە.</string>
<string name="download_error_network_retry">هەڵە هەیە لە تۆڕدا، هەوڵدان بۆ بەردەوامبون&#8230;</string>
<string name="notification_download_canceled">داگرتن هەڵوەشێنرایەوە</string>
<string name="download_non_wifi_prompt">تۆ لەسەر تۆڕی بێتەل نیت WiFi. داگرتن بەهەرحاڵ؟</string>

<!-- downloading dialogs -->
<string name="process_progress">ئەنجامدان %1$d / %2$d</string>
<string name="download_retry">ھەوڵدانەوە</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-ms/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@
<string name="sura_ayah_notification_str">Surah %1$s, Ayat %2$d</string>
<string name="sura_ayah_sharing_str">Surah %1$s: %2$d</string>

<string name="index_loading">Memuat…</string>

<string name="canceling">Membatalkan&#8230;</string>
<string name="juz2_description">Juz\' %1$s</string>
<string name="page_description">Halaman %1$s, Juz\' %2$s</string>
Expand All @@ -197,8 +195,6 @@
<string name="download_error_invalid_download_retry">Fail dimuat turun tidak lengkap, mencuba untuk muat turun semula</string>
<string name="download_error_network_retry">Ralat jaringan, mencuba semula&#8230;</string>
<string name="notification_download_canceled">Muat turun dibatalkan</string>
<string name="download_non_wifi_prompt">Anda tidak berada pada jaringan wifi. Teruskan juga muat turun data?</string>

<!-- downloading dialogs -->
<string name="process_progress">Memproses fail %1$d / %2$d</string>
<string name="download_retry">Cuba semula</string>
Expand Down
Loading

0 comments on commit 4beef8f

Please sign in to comment.