Migrate to multiplatform string resources (#10147)

* Migrate to multiplatform string resources

* Move plurals translations into separate files

* Fix lint check on generated files
This commit is contained in:
arkon
2023-11-18 13:54:56 -05:00
committed by GitHub
parent c39ae21f4a
commit 46e734fc8e
340 changed files with 5741 additions and 6292 deletions
@@ -10,14 +10,15 @@ import android.provider.MediaStore
import androidx.annotation.RequiresApi
import androidx.core.content.contentValuesOf
import androidx.core.net.toUri
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.storage.DiskUtil
import eu.kanade.tachiyomi.util.storage.cacheImageDir
import eu.kanade.tachiyomi.util.storage.getUriCompat
import logcat.LogPriority
import okio.IOException
import tachiyomi.core.i18n.localize
import tachiyomi.core.util.system.ImageUtil
import tachiyomi.core.util.system.logcat
import tachiyomi.i18n.MR
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.File
@@ -70,7 +71,7 @@ class ImageSaver(
val imageLocation = (image.location as Location.Pictures).relativePath
val relativePath = listOf(
Environment.DIRECTORY_PICTURES,
context.getString(R.string.app_name),
context.localize(MR.strings.app_name),
imageLocation,
).joinToString(File.separator)
@@ -85,7 +86,7 @@ class ImageSaver(
context.contentResolver.insert(
pictureDir,
contentValues,
) ?: throw IOException(context.getString(R.string.error_saving_picture))
) ?: throw IOException(context.localize(MR.strings.error_saving_picture))
}
try {
@@ -96,7 +97,7 @@ class ImageSaver(
}
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
throw IOException(context.getString(R.string.error_saving_picture))
throw IOException(context.localize(MR.strings.error_saving_picture))
}
DiskUtil.scanMedia(context, picture)
@@ -184,7 +185,7 @@ sealed interface Location {
is Pictures -> {
val file = File(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
context.getString(R.string.app_name),
context.localize(MR.strings.app_name),
)
if (relativePath.isNotEmpty()) {
return File(