forked from MapComplete/MapComplete
Ignore search terms in generate translations
This commit is contained in:
parent
d3817eba85
commit
819f813853
1 changed files with 5 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ import ScriptUtils from "./ScriptUtils"
|
||||||
import Script from "./Script"
|
import Script from "./Script"
|
||||||
|
|
||||||
const knownLanguages = ["en", "nl", "de", "fr", "es", "gl", "ca"]
|
const knownLanguages = ["en", "nl", "de", "fr", "es", "gl", "ca"]
|
||||||
|
const ignoreTerms = ["searchTerms"]
|
||||||
class TranslationPart {
|
class TranslationPart {
|
||||||
contents: Map<string, TranslationPart | string> = new Map<string, TranslationPart | string>()
|
contents: Map<string, TranslationPart | string> = new Map<string, TranslationPart | string>()
|
||||||
|
|
||||||
|
|
@ -49,6 +49,7 @@ class TranslationPart {
|
||||||
if (!translations.hasOwnProperty(translationsKey)) {
|
if (!translations.hasOwnProperty(translationsKey)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
const v = translations[translationsKey]
|
const v = translations[translationsKey]
|
||||||
if (typeof v != "string") {
|
if (typeof v != "string") {
|
||||||
console.error(
|
console.error(
|
||||||
|
|
@ -106,6 +107,9 @@ class TranslationPart {
|
||||||
if (!object.hasOwnProperty(key)) {
|
if (!object.hasOwnProperty(key)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if (ignoreTerms.indexOf(key) >= 0) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if (dontTranslateKeys?.indexOf(key) >= 0) {
|
if (dontTranslateKeys?.indexOf(key) >= 0) {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue