From 44b9e1b77cae6d235fff11d0d090573fa9882fdd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Jan 2023 15:08:32 +0200 Subject: [PATCH] Generating qm files. --- qbs/imports/VToolApp.qbs | 55 +++++++++++++++++++++++++++++++++++++++ qbs/modules/tenv/tenv.qbs | 14 +++++++++- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/qbs/imports/VToolApp.qbs b/qbs/imports/VToolApp.qbs index ba3a1f84b..bb035a140 100644 --- a/qbs/imports/VToolApp.qbs +++ b/qbs/imports/VToolApp.qbs @@ -35,4 +35,59 @@ VApp { product.targetName) + ' %F', 'X-Application-Version': product.version, }) + + Group { + name: "Translations" + prefix: FileInfo.joinPaths(project.sourceDirectory, "share", "translations", FileInfo.pathSeparator()) + files: { + var files = []; + + var locales = [ + "uk_UA", + "de_DE", + "cs_CZ", + "he_IL", + "fr_FR", + "it_IT", + "nl_NL", + "id_ID", + "es_ES", + "fi_FI", + "en_US", + "en_CA", + "en_IN", + "ro_RO", + "zh_CN", + "pt_BR", + "el_GR", + "pl_PL" + ]; + + for (var i = 0; i < locales.length; i++) { + files.push("valentina_" + locales[i] + ".ts"); + } + + var pmSystems = [ + "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", + "p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27", "p28", "p29", + "p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39", "p40", "p41", "p42", "p43", + "p44", "p45", "p46", "p47", "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p998" + ] + + for (var i = 0; i < pmSystems.length; i++) { + files.push("measurements_" + pmSystems[i] + ".ts"); + for (var j = 0; j < locales.length; j++) { + files.push("measurements_" + pmSystems[i] + "_" + locales[j] + ".ts"); + } + } + + return files; + } + } + + Group { + fileTagsFilter: "qm" + qbs.install: true + qbs.installDir: buildconfig.installDataPath + FileInfo.pathSeparator() + "translations" + } } diff --git a/qbs/modules/tenv/tenv.qbs b/qbs/modules/tenv/tenv.qbs index c585e4bdd..c8e1b7c3b 100644 --- a/qbs/modules/tenv/tenv.qbs +++ b/qbs/modules/tenv/tenv.qbs @@ -12,7 +12,7 @@ Module { multiplex: true // alwaysRun: true condition: enableTestEnvironment - inputs: ["pdftops_dist_macx", "pdftops_dist_win", "openssl_dist", "multisize_tables", "label_templates"] + inputs: ["pdftops_dist_macx", "pdftops_dist_win", "openssl_dist", "multisize_tables", "label_templates", "qm"] outputFileTags: ["tenv.deps"] outputArtifacts: { var artifactNames = (inputs["pdftops_dist_macx"] || []).map(function(file){ @@ -35,6 +35,10 @@ Module { return FileInfo.joinPaths(product.buildDirectory, "labels",file.fileName); })); + artifactNames = artifactNames.concat((inputs["qm"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "translations", file.fileName); + })); + var artifacts = artifactNames.map(function(art){ var a = { filePath: art, @@ -69,6 +73,10 @@ Module { return artifact.filePath; })); + sources = sources.concat((inputs["qm"] || []).map(function(artifact) { + return artifact.filePath; + })); + cmd.sources = sources; var destination = (inputs["pdftops_dist_macx"] || []).map(function(artifact) { @@ -91,6 +99,10 @@ Module { return FileInfo.joinPaths(product.buildDirectory, "labels", artifact.fileName); })); + destination = destination.concat((inputs["qm"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, "translations", artifact.fileName); + })); + cmd.destination = destination; cmd.sourceCode = function() { for (var i in sources) {