mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-10 16:39:35 +00:00
fix internal dictionaty file names
resulted in assets dicts being extracted on every app start
This commit is contained in:
parent
deec4d1f98
commit
7da068145f
2 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ object DictionaryFactory {
|
|||
checkAndAddDictionaryToListNewType(it, dictList, locale)
|
||||
}
|
||||
nonExtracted.forEach { filename ->
|
||||
val type = filename.substringBefore(".")
|
||||
val type = filename.substringBefore("_")
|
||||
if (dictList.any { it.mDictType == type }) return@forEach
|
||||
val extractedFile = DictionaryInfoUtils.extractAssetsDictionary(filename, locale, context)
|
||||
checkAndAddDictionaryToListNewType(extractedFile, dictList, locale)
|
||||
|
|
|
@ -136,7 +136,7 @@ object DictionaryInfoUtils {
|
|||
}
|
||||
|
||||
fun extractAssetsDictionary(dictionaryFileName: String, locale: Locale, context: Context): File {
|
||||
val targetFile = File(getCacheDirectoryForLocale(locale, context), "$dictionaryFileName.dict")
|
||||
val targetFile = File(getCacheDirectoryForLocale(locale, context), "${dictionaryFileName.substringBefore("_")}.dict")
|
||||
FileUtils.copyStreamToNewFile(
|
||||
context.assets.open(ASSETS_DICTIONARY_FOLDER + File.separator + dictionaryFileName),
|
||||
targetFile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue