Add option to ignore weblate

This commit is contained in:
Pieter Vander Vennet 2021-05-31 12:51:29 +02:00
parent 69f4b96949
commit 03d87023e0

View file

@ -181,7 +181,7 @@ function compileTranslationsFromWeblate() {
} }
// Get all the strings out of the layers // Get all the strings out of the layers; writes them onto the weblate paths
function generateTranslationsObjectFrom(objects: { path: string, parsed: { id: string } }[], target: string) { function generateTranslationsObjectFrom(objects: { path: string, parsed: { id: string } }[], target: string) {
const tr = new TranslationPart(); const tr = new TranslationPart();
@ -275,7 +275,7 @@ function loadTranslationFilesFrom(target: string): Map<string, any> {
} }
/** /**
* Load the translations back into the layers * Load the translations from the weblate files back into the layers
*/ */
function mergeLayerTranslations() { function mergeLayerTranslations() {
@ -306,11 +306,17 @@ function mergeThemeTranslations() {
} }
mergeLayerTranslations(); const themeOverwritesWeblate = process.argv[0] === "--ignore-weblate"
mergeThemeTranslations();
if(!themeOverwritesWeblate) {
mergeLayerTranslations();
mergeThemeTranslations();
}
generateTranslationsObjectFrom(ScriptUtils.getLayerFiles(), "layers") generateTranslationsObjectFrom(ScriptUtils.getLayerFiles(), "layers")
generateTranslationsObjectFrom(ScriptUtils.getThemeFiles(), "themes") generateTranslationsObjectFrom(ScriptUtils.getThemeFiles(), "themes")
if(!themeOverwritesWeblate) {
compileTranslationsFromWeblate(); // Generates the core translations
compileTranslationsFromWeblate();
}
genTranslations() genTranslations()