diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt
index f86f08289..d1fb8bff3 100644
--- a/commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt
+++ b/commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt
@@ -3,7 +3,7 @@ package com.simplemobiletools.commons.asynctasks
import android.os.AsyncTask
import android.support.v4.provider.DocumentFile
import android.support.v4.util.Pair
-import android.util.Log
+import com.simplemobiletools.commons.R
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.*
import java.io.*
@@ -37,7 +37,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal
copy(file, curFile)
} catch (e: Exception) {
- Log.e(TAG, "copy $e")
+ activity.toast(e.localizedMessage)
return false
}
}
@@ -65,7 +65,8 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal
val document = activity.getFastDocument(destination) ?: return
document.createDirectory(destination.name)
} else if (!destination.mkdirs()) {
- throw IOException("Could not create dir ${destination.absolutePath}")
+ val error = String.format(activity.getString(R.string.could_not_create_folder), destination.absolutePath)
+ throw IOException(error)
}
}
@@ -94,7 +95,8 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal
val directory = destination.parentFile
if (!directory.exists() && !directory.mkdirs()) {
- throw IOException("Could not create dir ${directory.absolutePath}")
+ val error = String.format(activity.getString(R.string.could_not_create_folder), directory.absolutePath)
+ throw IOException(error)
}
var inputStream: InputStream? = null
@@ -106,7 +108,8 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal
}
if (mDocument == null) {
- throw IOException("Could not create destination document ${destination.parent}")
+ val error = String.format(activity.getString(R.string.could_not_create_file), destination.parent)
+ throw IOException(error)
}
val newDocument = mDocument!!.createFile(source.getMimeType(), destination.name)
diff --git a/commons/src/main/res/values-ca/strings.xml b/commons/src/main/res/values-ca/strings.xml
index 44fad3eca..79f3d10c4 100644
--- a/commons/src/main/res/values-ca/strings.xml
+++ b/commons/src/main/res/values-ca/strings.xml
@@ -45,6 +45,8 @@
Some files could not be copied
No files selected
Saving…
+ Could not create folder %s
+ Could not create file %s
Create new
diff --git a/commons/src/main/res/values-cs/strings.xml b/commons/src/main/res/values-cs/strings.xml
index cac5856ae..f4184b6f9 100644
--- a/commons/src/main/res/values-cs/strings.xml
+++ b/commons/src/main/res/values-cs/strings.xml
@@ -45,6 +45,8 @@
Některé soubory nemohly být zkopírovány
Žádné soubory vybrány
Ukládám…
+ Could not create folder %s
+ Could not create file %s
Nový
diff --git a/commons/src/main/res/values-de/strings.xml b/commons/src/main/res/values-de/strings.xml
index 10974d124..88768bee8 100644
--- a/commons/src/main/res/values-de/strings.xml
+++ b/commons/src/main/res/values-de/strings.xml
@@ -45,6 +45,8 @@
Einige Dateien konnten nicht kopiert werden
Keine Dateien ausgewählt
Speichere…
+ Could not create folder %s
+ Could not create file %s
Neuer Ordner
diff --git a/commons/src/main/res/values-es/strings.xml b/commons/src/main/res/values-es/strings.xml
index ca0ccb2e5..ed639b884 100644
--- a/commons/src/main/res/values-es/strings.xml
+++ b/commons/src/main/res/values-es/strings.xml
@@ -45,6 +45,8 @@
Algunos archivos no se pudieron copiar
No hay archivos seleccionados
Guardando…
+ Could not create folder %s
+ Could not create file %s
Crear nueva
diff --git a/commons/src/main/res/values-fr/strings.xml b/commons/src/main/res/values-fr/strings.xml
index b9298e316..bff08c12e 100644
--- a/commons/src/main/res/values-fr/strings.xml
+++ b/commons/src/main/res/values-fr/strings.xml
@@ -45,6 +45,8 @@
Certains fichiers n\'ont pu être copiés
Aucun fichier sélectionné
Saving…
+ Could not create folder %s
+ Could not create file %s
Créer nouveau
diff --git a/commons/src/main/res/values-hi-rIN/strings.xml b/commons/src/main/res/values-hi-rIN/strings.xml
index 05a535d24..07d8a8f26 100644
--- a/commons/src/main/res/values-hi-rIN/strings.xml
+++ b/commons/src/main/res/values-hi-rIN/strings.xml
@@ -45,6 +45,8 @@
Some files could not be copied
No files selected
Saving…
+ Could not create folder %s
+ Could not create file %s
Create new
diff --git a/commons/src/main/res/values-hu/strings.xml b/commons/src/main/res/values-hu/strings.xml
index e70064f39..a093dda77 100644
--- a/commons/src/main/res/values-hu/strings.xml
+++ b/commons/src/main/res/values-hu/strings.xml
@@ -45,6 +45,8 @@
Some files could not be copied
No files selected
Saving…
+ Could not create folder %s
+ Could not create file %s
Create new
diff --git a/commons/src/main/res/values-it/strings.xml b/commons/src/main/res/values-it/strings.xml
index 744621440..97c401552 100644
--- a/commons/src/main/res/values-it/strings.xml
+++ b/commons/src/main/res/values-it/strings.xml
@@ -45,6 +45,8 @@
Alcuni file non possono essere copiati
Nessun file selezionato
Salvataggio…
+ Could not create folder %s
+ Could not create file %s
Crea nuovo
diff --git a/commons/src/main/res/values-ja/strings.xml b/commons/src/main/res/values-ja/strings.xml
index 44b71d5e7..2063828eb 100644
--- a/commons/src/main/res/values-ja/strings.xml
+++ b/commons/src/main/res/values-ja/strings.xml
@@ -45,6 +45,8 @@
一部のファイルがコピーできませんでした
No files selected
Saving…
+ Could not create folder %s
+ Could not create file %s
Create new
diff --git a/commons/src/main/res/values-ko-rKR/strings.xml b/commons/src/main/res/values-ko-rKR/strings.xml
index e8d456f7d..ea868aec7 100644
--- a/commons/src/main/res/values-ko-rKR/strings.xml
+++ b/commons/src/main/res/values-ko-rKR/strings.xml
@@ -45,6 +45,8 @@
일부 파일을 복사 할 수 없음
파일이 선택되지 않음
저장중…
+ Could not create folder %s
+ Could not create file %s
새로 만들기
diff --git a/commons/src/main/res/values-lt/strings.xml b/commons/src/main/res/values-lt/strings.xml
index 94bdc28b3..7f030fbab 100644
--- a/commons/src/main/res/values-lt/strings.xml
+++ b/commons/src/main/res/values-lt/strings.xml
@@ -45,6 +45,8 @@
Kai kurie failai negali bûti kopijuojami
Nepasirinkti failai
Iðsaugoma…
+ Could not create folder %s
+ Could not create file %s
Kurti naujà
diff --git a/commons/src/main/res/values-pl/strings.xml b/commons/src/main/res/values-pl/strings.xml
index 6070ed5b7..ae540e3da 100644
--- a/commons/src/main/res/values-pl/strings.xml
+++ b/commons/src/main/res/values-pl/strings.xml
@@ -45,6 +45,8 @@
Niektóre pliki nie mogą być skopiowane
Nie wybrano żadnych plików
Zapsisuję…
+ Could not create folder %s
+ Could not create file %s
Utwórz nowy
diff --git a/commons/src/main/res/values-pt-rBR/strings.xml b/commons/src/main/res/values-pt-rBR/strings.xml
index 82bdee681..bddff33fd 100644
--- a/commons/src/main/res/values-pt-rBR/strings.xml
+++ b/commons/src/main/res/values-pt-rBR/strings.xml
@@ -45,6 +45,8 @@
Alguns arquivos não foram copiados
Nenhum arquivo selecionado
Salvando…
+ Could not create folder %s
+ Could not create file %s
Criar
diff --git a/commons/src/main/res/values-pt/strings.xml b/commons/src/main/res/values-pt/strings.xml
index 257267d73..1860884b2 100644
--- a/commons/src/main/res/values-pt/strings.xml
+++ b/commons/src/main/res/values-pt/strings.xml
@@ -45,6 +45,8 @@
Alguns ficheiros não foram copiados
Nenhum ficheiro selecionado
A guardar…
+ Could not create folder %s
+ Could not create file %s
Criar
diff --git a/commons/src/main/res/values-ru/strings.xml b/commons/src/main/res/values-ru/strings.xml
index 3c8f59277..7eef0f226 100644
--- a/commons/src/main/res/values-ru/strings.xml
+++ b/commons/src/main/res/values-ru/strings.xml
@@ -45,6 +45,8 @@
Некоторые файлы не могут быть скопированы
Файлы не выбраны
Saving…
+ Could not create folder %s
+ Could not create file %s
Создать
diff --git a/commons/src/main/res/values-sk/strings.xml b/commons/src/main/res/values-sk/strings.xml
index cb85b2c19..4bd7cc940 100644
--- a/commons/src/main/res/values-sk/strings.xml
+++ b/commons/src/main/res/values-sk/strings.xml
@@ -45,6 +45,8 @@
Nepodarilo sa skopírovať niektoré súbory
Niesú označené žiadne súbory
Ukladanie…
+ Nepodarilo sa vytvoriť priečinok %s
+ Nepodarilo sa vytvoriť súbor %s
Vytvoriť nový
diff --git a/commons/src/main/res/values-sv/strings.xml b/commons/src/main/res/values-sv/strings.xml
index aac4c3c4f..232fb4ef3 100644
--- a/commons/src/main/res/values-sv/strings.xml
+++ b/commons/src/main/res/values-sv/strings.xml
@@ -45,6 +45,8 @@
Några filer gick inte att kopiera
Inga filer markerade
Sparar…
+ Could not create folder %s
+ Could not create file %s
Skapa ny
diff --git a/commons/src/main/res/values-tr/strings.xml b/commons/src/main/res/values-tr/strings.xml
index 1507085a8..57db6b846 100644
--- a/commons/src/main/res/values-tr/strings.xml
+++ b/commons/src/main/res/values-tr/strings.xml
@@ -45,6 +45,8 @@
Bazı dosyalar kopyalanamadı
No files selected
Saving…
+ Could not create folder %s
+ Could not create file %s
Create new
diff --git a/commons/src/main/res/values-zh-rCN/strings.xml b/commons/src/main/res/values-zh-rCN/strings.xml
index 727b40487..94395b9a0 100644
--- a/commons/src/main/res/values-zh-rCN/strings.xml
+++ b/commons/src/main/res/values-zh-rCN/strings.xml
@@ -45,6 +45,8 @@
无法复制相同文件
未选择文件
正在保存…
+ Could not create folder %s
+ Could not create file %s
新建
diff --git a/commons/src/main/res/values-zh-rTW/strings.xml b/commons/src/main/res/values-zh-rTW/strings.xml
index b3a966b7f..3f0292c1d 100644
--- a/commons/src/main/res/values-zh-rTW/strings.xml
+++ b/commons/src/main/res/values-zh-rTW/strings.xml
@@ -45,6 +45,8 @@
部分檔案無法被複製
未選擇檔案
儲存中…
+ Could not create folder %s
+ Could not create file %s
新增
diff --git a/commons/src/main/res/values/strings.xml b/commons/src/main/res/values/strings.xml
index 44fad3eca..79f3d10c4 100644
--- a/commons/src/main/res/values/strings.xml
+++ b/commons/src/main/res/values/strings.xml
@@ -45,6 +45,8 @@
Some files could not be copied
No files selected
Saving…
+ Could not create folder %s
+ Could not create file %s
Create new