From 4a7969ef244c862429d56e74d90570d94a73b3e7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 1 Jan 2021 16:34:03 +0100 Subject: [PATCH] ClipboardUtils: localize clipboard notification snack Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt | 3 ++- ui/src/main/res/values/strings.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt b/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt index 51f6486f..b9d7e7e1 100644 --- a/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt +++ b/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt @@ -11,6 +11,7 @@ import android.widget.TextView import androidx.core.content.getSystemService import com.google.android.material.snackbar.Snackbar import com.google.android.material.textfield.TextInputEditText +import com.wireguard.android.R /** * Standalone utilities for interacting with the system clipboard. @@ -28,6 +29,6 @@ object ClipboardUtils { } val service = view.context.getSystemService() ?: return service.setPrimaryClip(ClipData.newPlainText(data.second, data.first)) - Snackbar.make(view, "${data.second} copied to clipboard", Snackbar.LENGTH_LONG).show() + Snackbar.make(view, view.context.getString(R.string.copied_to_clipboard, data.second), Snackbar.LENGTH_LONG).show() } } diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index 869cf7d9..d569ccfe 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -97,6 +97,7 @@ Cannot create output directory Cannot create local temporary directory Create Tunnel + %s copied to clipboard Currently using light (day) theme Currently using dark (night) theme Use dark theme