diff --git a/backend/data/src/main/kotlin/io/tolgee/service/export/ExportFilePathProvider.kt b/backend/data/src/main/kotlin/io/tolgee/service/export/ExportFilePathProvider.kt index 2154f615e9..85ee716f5a 100644 --- a/backend/data/src/main/kotlin/io/tolgee/service/export/ExportFilePathProvider.kt +++ b/backend/data/src/main/kotlin/io/tolgee/service/export/ExportFilePathProvider.kt @@ -107,7 +107,7 @@ class ExportFilePathProvider( ) .replacePlaceholder( ExportFilePathPlaceholder.SNAKE_LANGUAGE_TAG, - convertBCP47ToAndroidResourceFormat(getSnakeLanguageTag(languageTag)), + getSnakeLanguageTag(languageTag), ) } diff --git a/backend/data/src/test/kotlin/io/tolgee/unit/formats/json/out/JsonFileExporterTest.kt b/backend/data/src/test/kotlin/io/tolgee/unit/formats/json/out/JsonFileExporterTest.kt index 619093dfca..501582b243 100644 --- a/backend/data/src/test/kotlin/io/tolgee/unit/formats/json/out/JsonFileExporterTest.kt +++ b/backend/data/src/test/kotlin/io/tolgee/unit/formats/json/out/JsonFileExporterTest.kt @@ -193,7 +193,7 @@ class JsonFileExporterTest { translations = buildExportTranslationList { add( - languageTag = "cs", + languageTag = "cs-CZ", keyName = "item", text = "A", ) @@ -206,7 +206,53 @@ class JsonFileExporterTest { val files = exporter.produceFiles() - files["cs/hello.json"].assert.isNotNull() + files["cs-CZ/hello.json"].assert.isNotNull() + } + + @Test + fun `honors the provided fileStructureTemplate (snakeCase)`() { + val exporter = + getExporter( + translations = + buildExportTranslationList { + add( + languageTag = "cs-CZ", + keyName = "item", + text = "A", + ) + }.translations, + exportParams = + ExportParams().also { + it.fileStructureTemplate = "{snakeLanguageTag}/hello/{namespace}.{extension}" + }, + ) + + val files = exporter.produceFiles() + + files["cs_CZ/hello.json"].assert.isNotNull() + } + + @Test + fun `honors the provided fileStructureTemplate (androidLanguageTag)`() { + val exporter = + getExporter( + translations = + buildExportTranslationList { + add( + languageTag = "cs-CZ", + keyName = "item", + text = "A", + ) + }.translations, + exportParams = + ExportParams().also { + it.fileStructureTemplate = "{androidLanguageTag}/hello/{namespace}.{extension}" + }, + ) + + val files = exporter.produceFiles() + + files["cs-rCZ/hello.json"].assert.isNotNull() } private fun Map.getFileTextContent(fileName: String): String { diff --git a/e2e/cypress/e2e/translations/batchJobs.cy.ts b/e2e/cypress/e2e/translations/batchJobs.cy.ts index 883d8243ab..2ece77d678 100644 --- a/e2e/cypress/e2e/translations/batchJobs.cy.ts +++ b/e2e/cypress/e2e/translations/batchJobs.cy.ts @@ -171,6 +171,8 @@ function assertLanguagesSelected(languages: string[]) { .findDcy('translations-language-select-form-control') .click(); + cy.gcy('translations-language-select-item').should('be.visible'); + languages.forEach((language) => { cy.gcy('translations-language-select-item') .contains(language)