forked from MapComplete/MapComplete
Add option to ignore weblate
This commit is contained in:
parent
69f4b96949
commit
03d87023e0
1 changed files with 12 additions and 6 deletions
|
@ -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()
|
Loading…
Add table
Add a link
Reference in a new issue