From ba5a2b855253691e8c196393ebb3898a223baff7 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 29 Aug 2021 23:41:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=87=AB=F0=9F=87=B7=20translates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mylloon/mobidl/MainActivity.kt | 22 +++++++++---------- app/src/main/res/values-fr-rFR/strings.xml | 7 ++++++ app/src/main/res/values/strings.xml | 11 ++++++++++ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt index fe1dbfb..55550af 100644 --- a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt +++ b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt @@ -140,9 +140,9 @@ class MainActivity : AppCompatActivity() { button = itemView?.findViewById(R.id.text_list_item) button?.setOnLongClickListener { val builder: android.app.AlertDialog.Builder = android.app.AlertDialog.Builder(instance) - builder.setTitle("Remove ${button?.text}?") - builder.setPositiveButton("Remove") { _, _ -> instance?.mainPage(button?.text.toString()) } - builder.setNeutralButton("Cancel") { dialog, _ -> dialog.cancel() } + builder.setTitle("${R.string.remove} ${button?.text} ?") + builder.setPositiveButton(R.string.remove) { _, _ -> instance?.mainPage(button?.text.toString()) } + builder.setNeutralButton(R.string.cancel) { dialog, _ -> dialog.cancel() } builder.show() true } @@ -181,19 +181,19 @@ class MainActivity : AppCompatActivity() { val addButton = findViewById(R.id.addButton) addButton.setOnClickListener { val builder: android.app.AlertDialog.Builder = android.app.AlertDialog.Builder(this) - builder.setTitle("App Name") + builder.setTitle(R.string.newAppDialogTitle) val input = EditText(this) input.inputType = InputType.TYPE_CLASS_TEXT builder.setView(input) - builder.setPositiveButton("Validate") { _, _ -> addApp(input.text.toString()) } - builder.setNeutralButton("Cancel") { dialog, _ -> dialog.cancel() } + builder.setPositiveButton(R.string.validate) { _, _ -> addApp(input.text.toString()) } + builder.setNeutralButton(R.string.cancel) { dialog, _ -> dialog.cancel() } builder.show() } // easter egg addButton.setOnLongClickListener { - Toast.makeText(this@MainActivity, "lâche frère", Toast.LENGTH_SHORT) + Toast.makeText(this@MainActivity, R.string.dropBro, Toast.LENGTH_SHORT) .show() true } @@ -216,7 +216,7 @@ class MainActivity : AppCompatActivity() { val credentialsButton = findViewById