Эх сурвалжийг харах

Move strings to strings.xml

Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
ZetaTom 2 жил өмнө
parent
commit
bc16cebfa1

+ 3 - 3
app/src/main/java/com/nextcloud/client/editimage/EditImageActivity.kt

@@ -97,12 +97,12 @@ class EditImageActivity :
 
     override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
         if (!result.isSuccessful) {
-            DisplayUtils.showSnackMessage(this, "Unable to edit image.")
+            DisplayUtils.showSnackMessage(this, getString(R.string.image_editor_unable_to_edit_image))
             return
         }
         val resultUri = result.getUriFilePath(this, false)
         val newFileName = file.fileName.substring(0, file.fileName.lastIndexOf('.')) +
-            " edited" +
+            " " + getString(R.string.image_editor_file_edited_suffix) +
             resultUri?.substring(resultUri.lastIndexOf('.'))
 
         FilesUploadHelper().uploadNewFiles(
@@ -120,7 +120,7 @@ class EditImageActivity :
 
     override fun onSetImageUriComplete(view: CropImageView, uri: Uri, error: Exception?) {
         if (error != null) {
-            DisplayUtils.showSnackMessage(this, "Unable to edit image.")
+            DisplayUtils.showSnackMessage(this, getString(R.string.image_editor_unable_to_edit_image))
             return
         }
         view.visibility = View.VISIBLE

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -1086,4 +1086,6 @@
     <string name="image_editor_rotate_ccw">Rotate anti-clockwise</string>
     <string name="image_editor_flip_horizontal">Flip horizontally</string>
     <string name="image_editor_flip_vertical">Flip vertically</string>
+    <string name="image_editor_unable_to_edit_image">Unable to edit image.</string>
+    <string name="image_editor_file_edited_suffix">edited</string>
 </resources>