From 8541fdf64d6acfd40250e0b7d6bb05db996d31ee Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 5 Apr 2023 14:50:06 +0200 Subject: [PATCH] Add strings to localazy and import them --- .../libraries/push/impl/UnifiedPushHelper.kt | 10 +-- .../impl/src/main/res/values/localazy.xml | 48 ++++++++++++++ .../impl/src/main/res/values/temporary.xml | 64 ------------------- .../src/main/res/values/localazy.xml | 1 + tools/localazy/config.json | 7 ++ 5 files changed, 61 insertions(+), 69 deletions(-) create mode 100644 libraries/push/impl/src/main/res/values/localazy.xml delete mode 100644 libraries/push/impl/src/main/res/values/temporary.xml diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/UnifiedPushHelper.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/UnifiedPushHelper.kt index adabca5b18..12ed3f1993 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/UnifiedPushHelper.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/UnifiedPushHelper.kt @@ -44,9 +44,9 @@ class UnifiedPushHelper @Inject constructor( ) { val internalDistributorName = stringProvider.getString( if (fcmHelper.isFirebaseAvailable()) { - R.string.push_distributor_firebase + R.string.push_distributor_firebase_android } else { - R.string.push_distributor_background_sync + R.string.push_distributor_background_sync_android } ) @@ -60,7 +60,7 @@ class UnifiedPushHelper @Inject constructor( } MaterialAlertDialogBuilder(context) - .setTitle(stringProvider.getString(R.string.push_choose_distributor_dialog_title)) + .setTitle(stringProvider.getString(R.string.push_choose_distributor_dialog_title_android)) .setItems(distributorsName.toTypedArray()) { _, which -> val distributor = distributors[which] onDistributorSelected(distributor) @@ -133,8 +133,8 @@ class UnifiedPushHelper @Inject constructor( fun getCurrentDistributorName(): String { return when { - isEmbeddedDistributor() -> stringProvider.getString(R.string.push_distributor_firebase) - isBackgroundSync() -> stringProvider.getString(R.string.push_distributor_background_sync) + isEmbeddedDistributor() -> stringProvider.getString(R.string.push_distributor_firebase_android) + isBackgroundSync() -> stringProvider.getString(R.string.push_distributor_background_sync_android) else -> context.getApplicationLabel(UnifiedPush.getDistributor(context)) } } diff --git a/libraries/push/impl/src/main/res/values/localazy.xml b/libraries/push/impl/src/main/res/values/localazy.xml new file mode 100644 index 0000000000..3a11adb5d3 --- /dev/null +++ b/libraries/push/impl/src/main/res/values/localazy.xml @@ -0,0 +1,48 @@ + + + "Call" + "Listening for events" + "Noisy notifications" + "Silent notifications" + "** Failed to send - please open room" + "Join" + "Reject" + "New Messages" + "Mark as read" + "Quick reply" + "Me" + "You are viewing the notification! Click me!" + "%1$s: %2$s" + "%1$s: %2$s %3$s" + "%1$s and %2$s" + "%1$s in %2$s" + "%1$s in %2$s and %3$s" + + "%1$s: %2$d message" + "%1$s: %2$d messages" + + + "%d notification" + "%d notifications" + + + "%d invitation" + "%d invitations" + + + "%d new message" + "%d new messages" + + + "%d unread notified message" + "%d unread notified messages" + + + "%d room" + "%d rooms" + + "Choose how to receive notifications" + "Background synchronization" + "Google Services" + "No valid Google Play Services found. Notifications may not work properly." + \ No newline at end of file diff --git a/libraries/push/impl/src/main/res/values/temporary.xml b/libraries/push/impl/src/main/res/values/temporary.xml deleted file mode 100644 index e0833bd2dc..0000000000 --- a/libraries/push/impl/src/main/res/values/temporary.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - No valid Google Play Services found. Notifications may not work properly. - Choose how to receive notifications - Google Services - Background synchronization - - Listening for events - Noisy notifications - Silent notifications - Call - Me - New Messages - Mark as read - Quick reply - Join - Reject - You are viewing the notification! Click me! - %1$s: %2$s - %1$s: %2$s %3$s - ** Failed to send - please open room - %1$s in %2$s and %3$s" - %1$s and %2$s" - %1$s in %2$s" - - %d new message - %d new messages - - - %d unread notified message - %d unread notified messages - - - %d room - %d rooms - - - %d invitation - %d invitations - - - %1$s: %2$d message - %1$s: %2$d messages - - - %d notification - %d notifications - - diff --git a/libraries/ui-strings/src/main/res/values/localazy.xml b/libraries/ui-strings/src/main/res/values/localazy.xml index 28cef98c60..c37935d35b 100644 --- a/libraries/ui-strings/src/main/res/values/localazy.xml +++ b/libraries/ui-strings/src/main/res/values/localazy.xml @@ -38,6 +38,7 @@ "Save" "Search" "Send" + "Send message" "Share" "Share link" "Skip" diff --git a/tools/localazy/config.json b/tools/localazy/config.json index 155a42836a..59c6bd6911 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -43,6 +43,13 @@ "rich_text_editor_.*" ] }, + { + "name": ":libraries:push:impl", + "includeRegex": [ + "push_.*", + "notification_.*" + ] + }, { "name": ":features:login:impl", "includeRegex": [