diff --git a/AllTranslationAssets.ts b/AllTranslationAssets.ts index ea5a0cf75..7d3bae079 100644 --- a/AllTranslationAssets.ts +++ b/AllTranslationAssets.ts @@ -22,7 +22,11 @@ export default class AllTranslationAssets { ready: new Translation( {"en":"Done!","ca":"Fet.","es":"Hecho.","nl":"Klaar!","fr":"Finis!","gl":"Feito!","de":"Erledigt!"} ), retrying: new Translation( {"en":"Loading data failed. Trying again... ({count})","ca":"La càrrega de dades ha fallat.Tornant-ho a intentar... ({count})","es":"La carga de datos ha fallado.Volviéndolo a probar... ({count})","gl":"A carga dos datos fallou. Tentándoo de novo... ({count})","fr":"Le chargement a échoué. Essayer à nouveau... ({count})","de":"Laden von Daten fehlgeschlagen. Erneuter Versuch... ({count})"} ), }, - general: { index: new Translation( {"#":"This text is shown above the theme buttons when no theme is loaded","en":"
MapComplete is an OpenStreetMap-viewer and editor, which shows you information about a specific theme.
Pick a theme below to get started.
","nl":"MapComplete is an OpenStreetMap-viewer and editor, which shows you information about a specific theme.
Pick a theme below to get started.
"} ), loginWithOpenStreetMap: new Translation( {"en":"Login with OpenStreetMap","ca":"Entra a OpenStreetMap","es":"Entra en OpenStreetMap","nl":"Aanmelden met OpenStreetMap","fr":"Se connecter avec OpenStreeMap","gl":"Inicia a sesión no OpenStreetMap","de":"Anmeldung mit OpenStreetMap"} ), welcomeBack: new Translation( {"en":"You are logged in, welcome back!","ca":"Has entrat, benvingut.","es":"Has entrado, bienvenido.","nl":"Je bent aangemeld. Welkom terug!","fr":"Vous êtes connecté. Bienvenue!","gl":"Iniciaches a sesión, benvido.","de":"Sie sind eingeloggt, willkommen zurück!"} ), loginToStart: new Translation( {"en":"Login to answer this question","ca":"Entra per contestar aquesta pregunta","es":"Entra para contestar esta pregunta","nl":"Meld je aan om deze vraag te beantwoorden","fr":"Connectez-vous pour répondre à cette question","gl":"Inicia a sesión para responder esta pregunta","de":"Anmelden, um diese Frage zu beantworten"} ), diff --git a/UI/BigComponents/IndexText.ts b/UI/BigComponents/IndexText.ts new file mode 100644 index 000000000..24348cc7b --- /dev/null +++ b/UI/BigComponents/IndexText.ts @@ -0,0 +1,28 @@ +import {UIElement} from "../UIElement"; +import Combine from "../Base/Combine"; +import Translations from "../i18n/Translations"; +import {FixedUiElement} from "../Base/FixedUiElement"; + +export default class IndexText extends Combine { + constructor() { + super([ + new FixedUiElement(``) + .AddClass("flex-none m-3"), + + new Combine([ + Translations.t.index.title + .AddClass("text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl block text-gray-800 xl:inline"), + + Translations.t.index.intro.AddClass( + "mt-3 text-base font-semibold text-gray-500 sm:mt-5 sm:text-lg sm:max-w-xl sm:mx-auto md:mt-5 md:text-xl lg:mx-0"), + + Translations.t.index.pickTheme.AddClass("mt-3 text-base text-green-600 sm:mt-5 sm:text-lg sm:max-w-xl sm:mx-auto md:mt-5 md:text-xl lg:mx-0") + + ]).AddClass("flex flex-col sm:text-center lg:text-left m-6 mt-8") + ]); + + + this.AddClass("flex flex-col sm:flex-row"); + } + +} \ No newline at end of file diff --git a/UI/BigComponents/MoreScreen.ts b/UI/BigComponents/MoreScreen.ts index dc11de4f7..8a9c4e04f 100644 --- a/UI/BigComponents/MoreScreen.ts +++ b/UI/BigComponents/MoreScreen.ts @@ -11,6 +11,7 @@ import Translations from "../i18n/Translations"; import * as personal from "../../assets/themes/personalLayout/personalLayout.json" import Constants from "../../Models/Constants"; import LanguagePicker from "../LanguagePicker"; +import IndexText from "./IndexText"; export default class MoreScreen extends UIElement { private readonly _onMainScreen: boolean; @@ -129,11 +130,11 @@ export default class MoreScreen extends UIElement { if(this._onMainScreen){ intro = new Combine([ - LanguagePicker.CreateLanguagePicker(Translations.t.general.index.SupportedLanguages()) + LanguagePicker.CreateLanguagePicker(Translations.t.index.title.SupportedLanguages()) .SetClass("absolute top-2 right-3 dropdown-ui-element-2226"), - // todo add logo above text - // new FixedUiElement(``), - Translations.t.general.index.SetClass("sm:text-center lg:text-left block m-6 mt-8") + new IndexText() + + ]) } diff --git a/UI/UIElement.ts b/UI/UIElement.ts index 947e616f3..d53172757 100644 --- a/UI/UIElement.ts +++ b/UI/UIElement.ts @@ -1,5 +1,4 @@ import {UIEventSource} from "../Logic/UIEventSource"; -import Constants from "../Models/Constants"; import {Utils} from "../Utils"; export abstract class UIElement extends UIEventSourceMapComplete is an OpenStreetMap-viewer and editor, which shows you information about a specific theme.
Pick a theme below to get started.
", - "nl": "MapComplete is an OpenStreetMap-viewer and editor, which shows you information about a specific theme.
Pick a theme below to get started.
" + + }, "loginWithOpenStreetMap": { diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index 590cd084e..55946aacd 100644 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -18,6 +18,12 @@ function transformTranslation(obj: any, depth = 1) { let values = "" for (const key in obj) { + if(key === "#"){ + continue; + } + if(key.match("^[a-zA-Z0-9_]*$") === null){ + throw "Invalid character in key: "+key + } values += (Utils.Times((_) => " ", depth)) + key + ": " + transformTranslation(obj[key], depth + 1) + ",\n" } return `{${values}}`;