Skip to content

Commit

Permalink
add translations
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Dec 12, 2024
1 parent a94382d commit 5289a9c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import android.content.Context
import android.content.Intent
import android.os.Build
import androidx.core.app.NotificationCompat
import com.owncloud.android.R
import com.owncloud.android.ui.notifications.NotificationUtils
import kotlinx.coroutines.delay

Expand All @@ -37,7 +38,7 @@ class SyncWorkerNotificationManager(private val context: Context) {

addAction(
android.R.drawable.ic_menu_close_clear_cancel,
"Cancel",
context.getString(R.string.common_cancel),
getCancelPendingIntent()
)
}
Expand All @@ -64,7 +65,8 @@ class SyncWorkerNotificationManager(private val context: Context) {
}

fun showStartNotification() {
val notification = getNotification("Sync Operation Started", progress = 0)
val notification =
getNotification(context.getString(R.string.sync_worker_start_notification_title), progress = 0)
notificationManager.notify(notificationId, notification)
}

Expand All @@ -88,12 +90,20 @@ class SyncWorkerNotificationManager(private val context: Context) {
}

private fun showSuccessNotification() {
val notification = getNotification("Download Complete", "File downloaded successfully")
val notification = getNotification(
context.getString(R.string.sync_worker_success_notification_title),
context.getString(R.string.sync_worker_success_notification_description)
)

notificationManager.notify(notificationId, notification)
}

private fun showErrorNotification() {
val notification = getNotification("Download Failed", "Error downloading file")
val notification = getNotification(
context.getString(R.string.sync_worker_error_notification_title),
context.getString(R.string.sync_worker_error_notification_description)
)

notificationManager.notify(notificationId, notification)
}

Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@
<string name="upload_notification_manager_start_text">%1$d / %2$d - %3$s</string>
<string name="upload_notification_manager_upload_in_progress_text" translatable="false">%1$d%%</string>

<string name="sync_worker_start_notification_title">Sync Operation Started</string>

<string name="sync_worker_success_notification_title">Download Complete</string>
<string name="sync_worker_success_notification_description">Folder successfully synchronized</string>

<string name="sync_worker_error_notification_title">Download Failed</string>
<string name="sync_worker_error_notification_description">An error occurred during folder synchronization</string>

<string name="uploader_upload_in_progress_ticker">Uploading…</string>
<string name="uploader_upload_in_progress_content">%1$d%% Uploading %2$s</string>
<string name="uploader_upload_succeeded_content_single">%1$s uploaded</string>
Expand Down

0 comments on commit 5289a9c

Please sign in to comment.