diff --git a/UI/Base/LinkToWeblate.ts b/UI/Base/LinkToWeblate.ts index 1239409a2..4b2eb56f5 100644 --- a/UI/Base/LinkToWeblate.ts +++ b/UI/Base/LinkToWeblate.ts @@ -38,7 +38,7 @@ export default class LinkToWeblate extends VariableUiElement { return baseUrl + category + "/" + language + "/?offset=1&q=context%3A%3D%22" + key + "%22" } - public static hrefToWeblateZen(language: string, category: string, searchKey: string): string{ + public static hrefToWeblateZen(language: string, category: "core" | "themes" | "layers" | "shared-questions" | "glossary" | string, searchKey: string): string{ const baseUrl = "https://hosted.weblate.org/zen/mapcomplete/" // ?offset=1&q=+state%3A%3Ctranslated+context%3Acampersite&sort_by=-priority%2Cposition&checksum= return baseUrl + category + "/" + language + "?offset=1&q=+state%3A%3Ctranslated+context%3A"+encodeURIComponent(searchKey)+"&sort_by=-priority%2Cposition&checksum=" diff --git a/UI/Input/Slider.ts b/UI/Input/Slider.ts index c1411cf0f..68503e722 100644 --- a/UI/Input/Slider.ts +++ b/UI/Input/Slider.ts @@ -1,6 +1,5 @@ import {InputElement} from "./InputElement"; import {UIEventSource} from "../../Logic/UIEventSource"; -import doc = Mocha.reporters.doc; export default class Slider extends InputElement { diff --git a/UI/Popup/NearbyImages.ts b/UI/Popup/NearbyImages.ts index 7fbaa34e2..81aeec88b 100644 --- a/UI/Popup/NearbyImages.ts +++ b/UI/Popup/NearbyImages.ts @@ -15,8 +15,6 @@ import {SubtleButton} from "../Base/SubtleButton"; import {GeoOperations} from "../../Logic/GeoOperations"; import {ElementStorage} from "../../Logic/ElementStorage"; import Lazy from "../Base/Lazy"; -import {Utils} from "../../Utils"; -import beginningOfLine = Mocha.reporters.Base.cursor.beginningOfLine; export interface P4CPicture { pictureUrl: string, diff --git a/UI/i18n/Translation.ts b/UI/i18n/Translation.ts index fa4dc87b3..8d65e202b 100644 --- a/UI/i18n/Translation.ts +++ b/UI/i18n/Translation.ts @@ -49,6 +49,10 @@ export class Translation extends BaseUIElement { return this.textFor(Translation.forcedLanguage ?? Locale.language.data) } + public toString(){ + return this.txt; + } + static ExtractAllTranslationsFrom(object: any, context = ""): { context: string, tr: Translation }[] { const allTranslations: { context: string, tr: Translation }[] = [] for (const key in object) { @@ -286,4 +290,6 @@ export class TypedTranslation extends Translation { return Utils.SubstituteKeys(template, text, lang); }, context) } + + } \ No newline at end of file diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 0a04dea61..b070bae59 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -1,13 +1,21 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete" + "en": "Changes made with MapComplete", + "de": "Änderungen mit MapComplete", + "es": "Cambios hechos con MapComplete", + "nb_NO": "Endringer utført med MapComplete" }, "shortDescription": { - "en": "Shows changes made by MapComplete" + "en": "Shows changes made by MapComplete", + "de": "Zeigt Änderungen von MapComplete", + "es": "Muestra los cambios hechos por MapComplete", + "nb_NO": "Vis endringer utført med MapComplete" }, "description": { - "en": "This maps shows all the changes made with MapComplete" + "en": "This maps shows all the changes made with MapComplete", + "de": "Diese Karte zeigt alle Änderungen die mit MapComplete gemacht wurden", + "es": "Este mapa muestra todos los cambios hechos con MapComplete" }, "maintainer": "", "icon": "./assets/svg/logo.svg", @@ -22,7 +30,10 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers" + "en": "Changeset centers", + "de": "Schwerpunkte von Änderungssätzen", + "es": "Centros de conjuntos de cambios", + "nb_NO": "Endringssettsenter" }, "minzoom": 0, "source": { @@ -36,35 +47,47 @@ ], "title": { "render": { - "en": "Changeset for {theme}" + "en": "Changeset for {theme}", + "de": "Änderungen für {theme}", + "es": "Conjunto de cambios para {theme}", + "nb_NO": "Endringssett for {theme}" } }, "description": { - "en": "Shows all MapComplete changes" + "en": "Shows all MapComplete changes", + "de": "Zeigt alle MapComplete Änderungen", + "es": "Muestra todos los cambios de MapComplete" }, "tagRenderings": [ { "id": "render_id", "render": { - "en": "Changeset {id}" + "en": "Changeset {id}", + "de": "Änderung {id}", + "es": "Conjunto de cambios {id}", + "nb_NO": "Endringssett {id}" } }, { "id": "contributor", "render": { - "en": "Change made by {_last_edit:contributor}" + "en": "Change made by {_last_edit:contributor}", + "de": "Änderung wurde von {_last_edit:contributor} gemacht", + "es": "Cambio hecho por {_last_edit:contributor}" } }, { "id": "theme", "render": { - "en": "Change with theme {theme}" + "en": "Change with theme {theme}", + "de": "Änderung mit Thema {theme}" }, "mappings": [ { "if": "theme~http.*", "then": { - "en": "Change with unofficial theme {theme}" + "en": "Change with unofficial theme {theme}", + "de": "Änderung mit inoffiziellem Thema {theme}" } } ] @@ -332,7 +355,9 @@ } ], "question": { - "en": "Themename contains {search}" + "en": "Themename contains {search}", + "de": "Themenname enthält {search}", + "nb_NO": "Temanavn inneholder {search}" } } ] @@ -348,7 +373,9 @@ } ], "question": { - "en": "Made by contributor {search}" + "en": "Made by contributor {search}", + "de": "Erstellt von {search}", + "es": "Hecho por contributor/a {search}" } } ] @@ -364,7 +391,9 @@ } ], "question": { - "en": "Not made by contributor {search}" + "en": "Not made by contributor {search}", + "de": "Nicht erstellt von {search}", + "es": "No hecho por contributor/a {search}" } } ] @@ -379,7 +408,9 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here" + "en": "More statistics can be found here", + "de": "Weitere Statistiken finden Sie hier", + "es": "Se pueden encontrar más estadísticas aquí" } }, { diff --git a/langs/en.json b/langs/en.json index 6670119a2..3f5613ef0 100644 --- a/langs/en.json +++ b/langs/en.json @@ -447,6 +447,38 @@ "pickTheme": "Pick a theme below to get started.", "title": "Welcome to MapComplete" }, + "matrixbot": { + "commandFailed": "Sorry, something went wrong while running {cmd}", + "commandNotFound": "I didn't understand your request. Did you perhaps mean to type {0}, {1}, {2} or ${2}?

Type help to see an overview of all commands

", + "commands": { + "help": { + "argcmd": "The command you want more information about", + "askRights": "Ask {admins} to give you sufficient permissions", + "docs": "Prints info about supported commands", + "insufficientRights": "You currently don't have sufficient permissions to run this command.", + "p0": "Hi! I'm MapComplete-bot {bot_version} (built upon MapComplete {mc_version}).", + "p1": "Send a command to me and I'll answer with something useful: give me a command via a private message or put ! before the command in a public room.", + "priviligedComand": "Priviliged command", + "supported": "My supported commands are:" + }, + "language": { + "hasBeenSet": "Language has been set to {language}.", + "helpTranslating": "Help to translate my responses on Weblate." + }, + "welcome": { + "p0": "Hi! I'm MapComplete-bot. I'm a computer program which searches OpenStreetMap and which can give some information about MapComplete, which is a website and app that shows thematic maps. If information is missing, you can add it easily over there.", + "p1": "Send me info [searchterm] and I'll search OpenStreetMap for you. I'll show you the information on what I found.", + "p2": "Alternatively, use search [ojecttype] near [placename] or search [objecttype] in [placename] to search for more places. Supported object types are those that can be found in MapComplete. More categories will be added in the future - and if you are up to the challenge, you can create your thematic map and thus category too", + "p3": "There are a few more commands, send help to see all of them." + }, + "wiki": { + "docs": "Prints (a part of) the specified page from wiki.osm.org. In public rooms, it'll print the first paragraph; in a DM the entire page will be sent." + } + }, + "decryptionFailed": "Sorry, I couldn't decrypt your message. You can try to leave this channel and to connect again", + "noSufficientRights": "This command is only available to administrators or users who have this role", + "tooLongForPublic": "Sorry, this message is too long for a public room - send me a direct message instead" + }, "move": { "cancel": "Cancel move", "cannotBeMoved": "This feature cannot be moved.", diff --git a/langs/layers/en.json b/langs/layers/en.json index 648c08930..2c4308291 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -1095,6 +1095,9 @@ "0": { "then": "Sport gear shop {name}" }, + "1": { + "then": "Winkel" + }, "2": { "then": "Bicycle rental {name}" }, diff --git a/langs/nl.json b/langs/nl.json index 7328a8917..1e7f37c6d 100644 --- a/langs/nl.json +++ b/langs/nl.json @@ -444,6 +444,25 @@ "pickTheme": "Kies hieronder een thema om te beginnen.", "title": "Welkom bij MapComplete" }, + "matrixbot": { + "commandNotFound": "Sorry, ik heb je commando niet verstaan. Zou het kunnen dat je {0}, {1}, {2} of ${2} bedoelt?

Je kan ook help sturen om een overzicht van alle commando's te zien

", + "commands": { + "help": { + "argcmd": "The command you want more information about", + "docs": "Prints info about supported commands", + "p0": "Hallo! Ik ben MapComplete-bot {bot_version} (gebouwd met MapComplete {mc_version}).", + "p1": "Je kan me een commando sturen en dan zal ik dat commando opvolgen. Dit kan door me een privé-bericht te sturen. In een publieke ruimte zal ik antwoorden als een bericht begint met ! of een mention.", + "priviligedComand": "Commando waar je rechten voor nodig hebt", + "supported": "De commando's die ik ken zijn:" + }, + "language": { + "hasBeenSet": "De taal is ingesteld op {language}." + } + }, + "decryptionFailed": "Sorry, I couldn't decrypt your message. You can try to leave this channel and to connect again", + "noSufficientRights": "This command is only available to administrators or users who have this role", + "tooLongForPublic": "Sorry, this message is too long for a public room - send me a direct message instead" + }, "move": { "cancel": "Annuleer verplaatsing", "cannotBeMoved": "Dit object kan niet verplaatst worden.", diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index 8f51f0846..32553fe39 100644 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -315,6 +315,10 @@ function transformTranslation(obj: any, path: string[] = [], languageWhitelist : if(subParts !== null){ // convert '{to_substitute}' into 'to_substitute' const types = Utils.Dedup( subParts.map(tp => tp.substring(1, tp.length - 1))) + const invalid = types.filter(part => part.match(/^[a-z0-9A-Z_]+(\(.*\))?$/) == null) + if(invalid.length > 0){ + throw `At ${path.join(".")}: A subpart contains invalid characters: ${subParts.join(', ')}` + } expr = `return new TypedTranslation<{ ${types.join(", ")} }>(${JSON.stringify(value)}, "core:${path.join(".")}.${key}")` }