From 35b700c85d9c6b5f2704a3d0b6d011985bd979ef Mon Sep 17 00:00:00 2001 From: Qiutong Zeng Date: Thu, 17 Oct 2024 13:42:33 +1100 Subject: [PATCH] notification: localize email message prompt and add translations. This commit updates the email notification prompt to support localization and adds translations for multiple languages. The original hardcoded "Check your mail box" string has been replaced with a localized string from resources. ### Changes: - Added localized translations for "Check your mail box" in zh, zh-rhk, zh-rcn, zh-rtw, and ja. - Modified the `NotificationActivity` to fetch the string using `getString(R.string.check_your_mail_box)` to support localization. ### Problem: The existing code used hardcoded English text for the email notification prompt, which did not provide a localized experience for users in different regions. ### Solution: By adding localized strings and retrieving them dynamically from resources, the app now provides a better user experience for non-English speakers. This also ensures future ease of maintenance as the app scales to support more languages. This change improves the internationalization of the app and ensures consistency with the rest of the notification system. --- .../fr/free/nrw/commons/notification/NotificationActivity.java | 2 +- app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java b/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java index d0880e730..58eff7ec5 100644 --- a/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java @@ -149,7 +149,7 @@ public class NotificationActivity extends BaseActivity { } adapter = new NotificatinAdapter(item -> { if (item.getNotificationType() == NotificationType.EMAIL){ - ViewUtil.showLongSnackbar(binding.container, "Check your mail box"); + ViewUtil.showLongSnackbar(binding.container, getString(R.string.check_your_email_inbox)); } else { handleUrl(item.getLink()); } diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 6fb40d2ff..1a50e9799 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -679,6 +679,7 @@ 作者への感謝の送信エラー。 ログインが期限切れになりました。もう一度ログインしてください。 GPXファイルを開くことができるアプリケーションがありません + メールをご確認ください %d件の画像が選択されました diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 379cc42ae..3e2969df4 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -111,4 +111,5 @@ 没有说明 未知授权协议 刷新 + 请查看你的电子邮箱 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 23da2c286..ab203b841 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -215,4 +215,5 @@ 請盡可能描述媒體內容:拍攝於何處?是顯示什麼事物?有什麼脈絡?請描述對象或人物。透露出一些較不易猜測的訊息,例如是風景的話,可以是一天裡的時間。如果媒體顯示出了一些不尋常的事物,請說明不尋常原因。 學習如何編寫有用的描述 學習如何編寫有用的標題 + 請查看你的電子郵件信箱 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 0c09d229a..59dfdd57f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -805,4 +805,5 @@ 待處理 失敗 無法載入地點資料 + 請查看你的電子郵件信箱 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 7654cee2c..e66f40879 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -834,4 +834,5 @@ 待处理 失败 无法加载地点数据 + 请查看你的电子邮箱 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0c6be3129..101a5eb02 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -503,6 +503,7 @@ Upload your first media by tapping on the add button. You have no unread notifications You have no read notifications + Check your email inbox Share logs using View read View unread