File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
backend/data/src/main/kotlin/io/tolgee/service/dataImport Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -323,13 +323,19 @@ class CoreImportFilesProcessor(
323323 }
324324
325325 private fun FileProcessorContext.processTranslations () {
326- this .translations.forEach { entry ->
327- val keyEntity = getOrCreateKey(entry.key)
328- entry.value.forEach { newTranslation ->
329- processTranslation(newTranslation, keyEntity)
326+ val translationsByKeys = translations.mapKeys { (keyName, _) ->
327+ getOrCreateKey(keyName).apply {
328+ shouldBeImported = shouldImportKey(name)
330329 }
331- keyEntity.shouldBeImported = shouldImportKey(keyEntity.name)
332330 }
331+
332+ translationsByKeys.forEach { (key, translations) ->
333+ translations.forEach {
334+ it.key = key
335+ processTranslation(it)
336+ }
337+ }
338+
333339 if (saveData) {
334340 importDataManager.saveAllStoredTranslations()
335341 }
@@ -344,9 +350,7 @@ class CoreImportFilesProcessor(
344350
345351 private fun FileProcessorContext.processTranslation (
346352 newTranslation : ImportTranslation ,
347- keyEntity : ImportKey ,
348353 ) {
349- newTranslation.key = keyEntity
350354 val (isCollision, fileCollisions) = checkForInFileCollisions(newTranslation)
351355 if (isCollision) {
352356 fileEntity.addIssues(fileCollisions)
You can’t perform that action at this time.
0 commit comments