fucking crowdin

This commit is contained in:
Maciej Pawłowski 2024-10-21 22:09:43 +02:00
parent 2211b35513
commit 1dca64f916

View file

@ -253,7 +253,7 @@ tasks.sourcesJar.dependsOn runDatagen
jar { jar {
exclude "**/*.psd" exclude "**/*.psd"
from file('src/main/generated') from file('src/main/generated')
from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.json"} : null} from { fileTree('build/translations').matching{exclude "**/en_US.json"} }
// A bit of a hack to allow the generated sources when they already exist // A bit of a hack to allow the generated sources when they already exist
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@ -279,15 +279,15 @@ tasks.register('crowdinExport') {
def translationsUrl = "https://crowdin.com/backend/download/project/techreborn.zip" def translationsUrl = "https://crowdin.com/backend/download/project/techreborn.zip"
def translationsZip = file("build/translations.zip") def translationsZip = file("build/translations.zip")
tasks.register('crowdin') { // tasks.register('crowdin') {
dependsOn crowdinExport // dependsOn crowdinExport
description "Downloads translations from CrowdIn" // description "Downloads translations from CrowdIn"
outputs.file translationsZip // outputs.file translationsZip
doLast { // doLast {
translationsZip.bytes = new URL(translationsUrl).bytes // translationsZip.bytes = new URL(translationsUrl).bytes
} // }
} // }
tasks.register('cleanCrowdin', Delete) { tasks.register('cleanCrowdin', Delete) {
description "Delete old translations" description "Delete old translations"
@ -296,7 +296,7 @@ tasks.register('cleanCrowdin', Delete) {
clean.dependsOn cleanCrowdin clean.dependsOn cleanCrowdin
tasks.register('renameCrowdin', Copy) { tasks.register('renameCrowdin', Copy) {
dependsOn crowdin // dependsOn crowdin
description "Renames the translation files to be all lower case" description "Renames the translation files to be all lower case"
from zipTree(translationsZip) from zipTree(translationsZip)
into file('build/translations') into file('build/translations')