From 62925a89ba333eb654ac67bb5084788e466050f0 Mon Sep 17 00:00:00 2001 From: Arno Deceuninck Date: Thu, 15 Jul 2021 11:13:00 +0200 Subject: [PATCH] Text in translation file + refactor --- {UI => Logic/FeatureSource}/GeoJsonExport.ts | 4 ++-- UI/BigComponents/LayerSelection.ts | 4 ++-- langs/en.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) rename {UI => Logic/FeatureSource}/GeoJsonExport.ts (93%) diff --git a/UI/GeoJsonExport.ts b/Logic/FeatureSource/GeoJsonExport.ts similarity index 93% rename from UI/GeoJsonExport.ts rename to Logic/FeatureSource/GeoJsonExport.ts index d3e5dc5d68..541e103730 100644 --- a/UI/GeoJsonExport.ts +++ b/Logic/FeatureSource/GeoJsonExport.ts @@ -1,5 +1,5 @@ -import FeaturePipeline from "../Logic/FeatureSource/FeaturePipeline"; -import {Utils} from "../Utils"; +import FeaturePipeline from "./FeaturePipeline"; +import {Utils} from "../../Utils"; /** * Exports given featurePipeline as a geojson FeatureLists (downloads as a json) diff --git a/UI/BigComponents/LayerSelection.ts b/UI/BigComponents/LayerSelection.ts index 900be93489..c48b361633 100644 --- a/UI/BigComponents/LayerSelection.ts +++ b/UI/BigComponents/LayerSelection.ts @@ -8,7 +8,7 @@ import LayerConfig from "../../Customizations/JSON/LayerConfig"; import BaseUIElement from "../BaseUIElement"; import {Translation} from "../i18n/Translation"; import {SubtleButton} from "../Base/SubtleButton"; -import {exportAsGeoJson} from "../GeoJsonExport"; +import {exportAsGeoJson} from "../../Logic/FeatureSource/GeoJsonExport"; /** * Shows the panel with all layers and a toggle for each of them @@ -76,7 +76,7 @@ export default class LayerSelection extends Combine { ); } - const downloadButton = new SubtleButton("./assets/svg/floppy.svg", "Download visible data as geojson") + const downloadButton = new SubtleButton("./assets/svg/floppy.svg", Translations.t.general.layerSelection.downloadGeojson.Clone()) downloadButton.onClick(() => exportAsGeoJson(State.state.featurePipeline)) checkboxes.push(downloadButton) diff --git a/langs/en.json b/langs/en.json index 7f327653c5..b604850f8f 100644 --- a/langs/en.json +++ b/langs/en.json @@ -147,7 +147,8 @@ "loginOnlyNeededToEdit": "if you want to edit the map", "layerSelection": { "zoomInToSeeThisLayer": "Zoom in to see this layer", - "title": "Select layers" + "title": "Select layers", + "downloadGeojson": "Download layer features as geojson" }, "weekdays": { "abbreviations": {