ru.pocketbyte.locolaser.mobile.resource.IosPlistResources.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resource-mobile Show documentation
Show all versions of resource-mobile Show documentation
Implementation of platform for LocoLaser tool to work with Android and iOS platforms.
package ru.pocketbyte.locolaser.mobile.resource
import ru.pocketbyte.locolaser.mobile.resource.file.IosPlistResourceFile
import ru.pocketbyte.locolaser.resource.file.ResourceFile
import ru.pocketbyte.locolaser.resource.formatting.FormattingType
import ru.pocketbyte.locolaser.resource.formatting.JavaFormattingType
import ru.pocketbyte.locolaser.summary.FileSummary
import java.io.File
class IosPlistResources(
resourcesDir: File,
name: String,
filter: ((key: String) -> Boolean)?
) : AbsIosStringsResources(resourcesDir, name, filter) {
override val formattingType: FormattingType = JavaFormattingType
override fun getResourceFiles(locales: Set?): Array? {
val localesArray = locales?.toTypedArray() ?: return null
return Array(locales.size) { i ->
IosPlistResourceFile(getFileForLocale(localesArray[i]), localesArray[i])
}
}
override fun summaryForLocale(locale: String): FileSummary {
return FileSummary(getFileForLocale(locale))
}
}