From 5e220ccead765857dbe1dd6e58f2781fa53bf3de Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 10 Oct 2020 14:09:12 +0200 Subject: [PATCH] Fix widths --- Customizations/Layout.ts | 7 +-- State.ts | 3 +- UI/i18n/Translation.ts | 1 - UI/i18n/Translations.ts | 1 + assets/themes/ghostbikes/logo.svg | 81 ++++++++++--------------------- assets/themes/shops/shops.json | 2 +- 6 files changed, 33 insertions(+), 62 deletions(-) diff --git a/Customizations/Layout.ts b/Customizations/Layout.ts index 4eccb29..378a0d5 100644 --- a/Customizations/Layout.ts +++ b/Customizations/Layout.ts @@ -3,6 +3,7 @@ import {UIElement} from "../UI/UIElement"; import Translations from "../UI/i18n/Translations"; import Combine from "../UI/Base/Combine"; import State from "../State"; +import Translation from "../UI/i18n/Translation"; /** * A layout is a collection of settings of the global view (thus: welcome text, title, selection of layers). @@ -50,12 +51,12 @@ export class Layout { constructor( id: string, supportedLanguages: string[], - title: UIElement | string, + title: Translation | string, layers: (LayerDefinition | string)[], startzoom: number, startLat: number, startLon: number, - welcomeMessage: UIElement | string, + welcomeMessage: Translation | string, gettingStartedPlzLogin: UIElement | string = new Combine([ Translations.t.general.getStartedLogin .SetClass("soft") @@ -66,7 +67,7 @@ export class Layout { welcomeTail: UIElement | string = "", ) { this.supportedLanguages = supportedLanguages; - this.title = Translations.W(title) + this.title = Translations.WT(title) this.startLon = startLon; this.startLat = startLat; this.startzoom = startzoom; diff --git a/State.ts b/State.ts index 66250a8..c7ef864 100644 --- a/State.ts +++ b/State.ts @@ -200,7 +200,6 @@ export default class State { ); - this.installedThemes = this.osmConnection.preferencesHandler.preferences.map<{ layout: Layout, definition: string }[]>(allPreferences => { const installedThemes: { layout: Layout, definition: string }[] = []; if (allPreferences === undefined) { @@ -209,7 +208,7 @@ export default class State { for (const allPreferencesKey in allPreferences) { const themename = allPreferencesKey.match(/^mapcomplete-installed-theme-(.*)-combined-length$/); if (themename && themename[1] !== "") { - const customLayout = State.state.osmConnection.GetLongPreference("installed-theme-" + themename[1]); + const customLayout = self.osmConnection.GetLongPreference("installed-theme-" + themename[1]); if(customLayout.data === undefined){ console.log("No data defined for ", themename[1]); continue; diff --git a/UI/i18n/Translation.ts b/UI/i18n/Translation.ts index 7fce447..5c6011c 100644 --- a/UI/i18n/Translation.ts +++ b/UI/i18n/Translation.ts @@ -48,7 +48,6 @@ export default class Translation extends UIElement { for (const knownSpecial of knownSpecials) { - const combined = []; const matched = template.match(`(.*){${knownSpecial.funcName}\\((.*)\\)}(.*)`); if (matched === null) { continue; diff --git a/UI/i18n/Translations.ts b/UI/i18n/Translations.ts index db386ae..d589ce0 100644 --- a/UI/i18n/Translations.ts +++ b/UI/i18n/Translations.ts @@ -975,6 +975,7 @@ export default class Translations { if (s instanceof Translation) { return s; } + console.error("Trying to Translation.WT, but got ",s) throw "??? Not a valid translation" } diff --git a/assets/themes/ghostbikes/logo.svg b/assets/themes/ghostbikes/logo.svg index 6751efa..cbb8515 100644 --- a/assets/themes/ghostbikes/logo.svg +++ b/assets/themes/ghostbikes/logo.svg @@ -5,36 +5,12 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - id="svg69" - version="1.1" - fill="none" - viewBox="0 0 98 122" - height="122" width="122" - sodipodi:docname="logo.svg" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> - + height="122" + viewBox="0 0 98 122" + fill="none" + version="1.1" + id="svg69"> image/svg+xml - + + transform="translate(0,3.1016949)" + id="layer3"> + d="m 53.0445,112.094 c -1.7831,3.887 -7.3059,3.887 -9.089,0 L 13.2124,45.085 C 11.6928,41.7729 14.1129,38 17.7569,38 h 61.4862 c 3.644,0 6.0641,3.7729 4.5445,7.085 z" + style="fill:#171615" /> + cy="49" + cx="49" + style="fill:#171615" /> + id="path10" + style="stroke:#ffffff;stroke-width:2" /> + id="path12" + style="stroke:#ffffff" /> + id="path14" + style="stroke:#ffffff;stroke-width:2" /> + r="11" + cy="63" + cx="66" /> + d="M 56.4468,12.3002 H 49.8793 V 6.79007 C 49.8793,6.35374 49.5103,6 49.0552,6 H 47.2158 C 46.7606,6 46.3916,6.35374 46.3916,6.79007 V 12.3002 H 39.8242 C 39.369,12.3002 39,12.654 39,13.0903 v 1.7633 c 0,0.4364 0.369,0.7901 0.8242,0.7901 h 6.5674 v 16.5662 c 0,0.4364 0.369,0.7901 0.8242,0.7901 h 1.8394 c 0.4551,0 0.8241,-0.3537 0.8241,-0.7901 V 15.6437 h 6.5675 c 0.4552,0 0.8242,-0.3537 0.8242,-0.7901 v -1.7633 c 0,-0.4363 -0.369,-0.7901 -0.8242,-0.7901 z" /> diff --git a/assets/themes/shops/shops.json b/assets/themes/shops/shops.json index 1e4bf18..0f6efcf 100644 --- a/assets/themes/shops/shops.json +++ b/assets/themes/shops/shops.json @@ -65,7 +65,7 @@ "tagRenderings": [ { "render": { - "en": "This shop sellse {shop}" + "en": "This shop sells {shop}" }, "question": { "en": "What does this shop sell?"