Browse Source

Add strings to localazy and import them

test/jme/compound-poc
Benoit Marty 1 year ago committed by Benoit Marty
parent
commit
8541fdf64d
  1. 10
      libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/UnifiedPushHelper.kt
  2. 48
      libraries/push/impl/src/main/res/values/localazy.xml
  3. 64
      libraries/push/impl/src/main/res/values/temporary.xml
  4. 1
      libraries/ui-strings/src/main/res/values/localazy.xml
  5. 7
      tools/localazy/config.json

10
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( val internalDistributorName = stringProvider.getString(
if (fcmHelper.isFirebaseAvailable()) { if (fcmHelper.isFirebaseAvailable()) {
R.string.push_distributor_firebase R.string.push_distributor_firebase_android
} else { } else {
R.string.push_distributor_background_sync R.string.push_distributor_background_sync_android
} }
) )
@ -60,7 +60,7 @@ class UnifiedPushHelper @Inject constructor(
} }
MaterialAlertDialogBuilder(context) 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 -> .setItems(distributorsName.toTypedArray()) { _, which ->
val distributor = distributors[which] val distributor = distributors[which]
onDistributorSelected(distributor) onDistributorSelected(distributor)
@ -133,8 +133,8 @@ class UnifiedPushHelper @Inject constructor(
fun getCurrentDistributorName(): String { fun getCurrentDistributorName(): String {
return when { return when {
isEmbeddedDistributor() -> stringProvider.getString(R.string.push_distributor_firebase) isEmbeddedDistributor() -> stringProvider.getString(R.string.push_distributor_firebase_android)
isBackgroundSync() -> stringProvider.getString(R.string.push_distributor_background_sync) isBackgroundSync() -> stringProvider.getString(R.string.push_distributor_background_sync_android)
else -> context.getApplicationLabel(UnifiedPush.getDistributor(context)) else -> context.getApplicationLabel(UnifiedPush.getDistributor(context))
} }
} }

48
libraries/push/impl/src/main/res/values/localazy.xml

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="notification_channel_call">"Call"</string>
<string name="notification_channel_listening_for_events">"Listening for events"</string>
<string name="notification_channel_noisy">"Noisy notifications"</string>
<string name="notification_channel_silent">"Silent notifications"</string>
<string name="notification_inline_reply_failed">"** Failed to send - please open room"</string>
<string name="notification_invitation_action_join">"Join"</string>
<string name="notification_invitation_action_reject">"Reject"</string>
<string name="notification_new_messages">"New Messages"</string>
<string name="notification_room_action_mark_as_read">"Mark as read"</string>
<string name="notification_room_action_quick_reply">"Quick reply"</string>
<string name="notification_sender_me">"Me"</string>
<string name="notification_test_push_notification_content">"You are viewing the notification! Click me!"</string>
<string name="notification_ticker_text_dm">"%1$s: %2$s"</string>
<string name="notification_ticker_text_group">"%1$s: %2$s %3$s"</string>
<string name="notification_unread_notified_messages_and_invitation">"%1$s and %2$s"</string>
<string name="notification_unread_notified_messages_in_room">"%1$s in %2$s"</string>
<string name="notification_unread_notified_messages_in_room_and_invitation">"%1$s in %2$s and %3$s"</string>
<plurals name="notification_compat_summary_line_for_room">
<item quantity="one">"%1$s: %2$d message"</item>
<item quantity="other">"%1$s: %2$d messages"</item>
</plurals>
<plurals name="notification_compat_summary_title">
<item quantity="one">"%d notification"</item>
<item quantity="other">"%d notifications"</item>
</plurals>
<plurals name="notification_invitations">
<item quantity="one">"%d invitation"</item>
<item quantity="other">"%d invitations"</item>
</plurals>
<plurals name="notification_new_messages_for_room">
<item quantity="one">"%d new message"</item>
<item quantity="other">"%d new messages"</item>
</plurals>
<plurals name="notification_unread_notified_messages">
<item quantity="one">"%d unread notified message"</item>
<item quantity="other">"%d unread notified messages"</item>
</plurals>
<plurals name="notification_unread_notified_messages_in_room_rooms">
<item quantity="one">"%d room"</item>
<item quantity="other">"%d rooms"</item>
</plurals>
<string name="push_choose_distributor_dialog_title_android">"Choose how to receive notifications"</string>
<string name="push_distributor_background_sync_android">"Background synchronization"</string>
<string name="push_distributor_firebase_android">"Google Services"</string>
<string name="push_no_valid_google_play_services_apk_android">"No valid Google Play Services found. Notifications may not work properly."</string>
</resources>

64
libraries/push/impl/src/main/res/values/temporary.xml

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2023 New Vector Ltd
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="push_no_valid_google_play_services_apk_android">No valid Google Play Services found. Notifications may not work properly.</string>
<string name="push_choose_distributor_dialog_title">Choose how to receive notifications</string>
<string name="push_distributor_firebase">Google Services</string>
<string name="push_distributor_background_sync">Background synchronization</string>
<string name="notification_channel_listening_for_events">Listening for events</string>
<string name="notification_channel_noisy">Noisy notifications</string>
<string name="notification_channel_silent">Silent notifications</string>
<string name="notification_channel_call">Call</string>
<string name="notification_sender_me">Me</string>
<string name="notification_new_messages">New Messages</string>
<string name="notification_room_action_mark_as_read">Mark as read</string>
<string name="notification_room_action_quick_reply">Quick reply</string>
<string name="notification_invitation_action_join">Join</string>
<string name="notification_invitation_action_reject">Reject</string>
<string name="notification_test_push_notification_content">You are viewing the notification! Click me!</string>
<string name="notification_ticker_text_dm">%1$s: %2$s</string>
<string name="notification_ticker_text_group">%1$s: %2$s %3$s</string>
<string name="notification_inline_reply_failed">** Failed to send - please open room</string>
<string name="notification_unread_notified_messages_in_room_and_invitation">%1$s in %2$s and %3$s"</string>
<string name="notification_unread_notified_messages_and_invitation">%1$s and %2$s"</string>
<string name="notification_unread_notified_messages_in_room">%1$s in %2$s"</string>
<plurals name="notification_new_messages_for_room">
<item quantity="one">%d new message</item>
<item quantity="other">%d new messages</item>
</plurals>
<plurals name="notification_unread_notified_messages">
<item quantity="one">%d unread notified message</item>
<item quantity="other">%d unread notified messages</item>
</plurals>
<plurals name="notification_unread_notified_messages_in_room_rooms">
<item quantity="one">%d room</item>
<item quantity="other">%d rooms</item>
</plurals>
<plurals name="notification_invitations">
<item quantity="one">%d invitation</item>
<item quantity="other">%d invitations</item>
</plurals>
<plurals name="notification_compat_summary_line_for_room">
<item quantity="one">%1$s: %2$d message</item>
<item quantity="other">%1$s: %2$d messages</item>
</plurals>
<plurals name="notification_compat_summary_title">
<item quantity="one">%d notification</item>
<item quantity="other">%d notifications</item>
</plurals>
</resources>

1
libraries/ui-strings/src/main/res/values/localazy.xml

@ -38,6 +38,7 @@
<string name="action_save">"Save"</string> <string name="action_save">"Save"</string>
<string name="action_search">"Search"</string> <string name="action_search">"Search"</string>
<string name="action_send">"Send"</string> <string name="action_send">"Send"</string>
<string name="action_send_message">"Send message"</string>
<string name="action_share">"Share"</string> <string name="action_share">"Share"</string>
<string name="action_share_link">"Share link"</string> <string name="action_share_link">"Share link"</string>
<string name="action_skip">"Skip"</string> <string name="action_skip">"Skip"</string>

7
tools/localazy/config.json

@ -43,6 +43,13 @@
"rich_text_editor_.*" "rich_text_editor_.*"
] ]
}, },
{
"name": ":libraries:push:impl",
"includeRegex": [
"push_.*",
"notification_.*"
]
},
{ {
"name": ":features:login:impl", "name": ":features:login:impl",
"includeRegex": [ "includeRegex": [

Loading…
Cancel
Save