From 389f52f42c6a931c1c4934f169f78bc31ddc50a3 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 14 Nov 2024 00:55:51 +0100 Subject: [PATCH] Chore: move from weblate server, see #2255 --- CONTRIBUTING.md | 2 +- Docs/LanguagePicker.md | 2 +- Docs/Reasonings/2023 in Review.md | 2 +- .../2024-01-15 TranslationCompleteness.svg | 62 +++++++++---------- README.md | 4 +- package.json | 3 - scripts/generateTranslations.ts | 3 +- src/Models/Constants.ts | 1 + src/UI/Base/LinkToWeblate.ts | 7 ++- src/UI/BigComponents/MenuDrawer.svelte | 2 +- 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14fa619a6..97c6f4c4c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Hi! Thanks for checking out how to contribute to MapComplete! There are multiple ways to contribute: - Translating MapComplete to your own language can be done - on [the Weblate website](https://hosted.weblate.org/projects/mapcomplete/) + on [the Weblate website](https://translate.mapcomplete.org/projects/mapcomplete/) - If you encounter a bug, the [issue tracker](https://github.com/pietervdvn/MapComplete/issues) is the place to be - A good start to contribute is to create a single map layer showing features which interest you. Read more about [making your own theme](/Docs/Making_Your_Own_Theme.md). - Feel free to hop in [our chat channel on matrix](https://app.element.io/#/room/#MapComplete:matrix.org) diff --git a/Docs/LanguagePicker.md b/Docs/LanguagePicker.md index aaf1e1f3d..fcc609c58 100644 --- a/Docs/LanguagePicker.md +++ b/Docs/LanguagePicker.md @@ -3,7 +3,7 @@ (Originally published as diary-entry) -In my [little OpenStreetMap-editor](https://mapcomplete.org) translations are provided by contributors on [hosted weblate](https://hosted.weblate.org/projects/mapcomplete/), where thousands of text snippets have been translated already in the past year - which is awesome. +In my [little OpenStreetMap-editor](https://mapcomplete.org) translations are provided by contributors on [hosted weblate](https://translate.mapcomplete.org/projects/mapcomplete/), where thousands of text snippets have been translated already in the past year - which is awesome. However, the language picker was a bit dry: it used to have codes for every language, e.g. `nl`, `en`, `ja`, 'pt_BR', 'zh_Hant'... Quite boring and not really user-friendly - but easy to implement. diff --git a/Docs/Reasonings/2023 in Review.md b/Docs/Reasonings/2023 in Review.md index 7ada1d686..9e14209ca 100644 --- a/Docs/Reasonings/2023 in Review.md +++ b/Docs/Reasonings/2023 in Review.md @@ -273,7 +273,7 @@ it is not a surprise that Dutch is over-represented. Catalan is also slightly overrepresented, but that is because a proud catalan took the time to translate it to catalan early on and uses it frequently. -If you want to see MapComplete in _your_ language, head over to [Weblate](https://hosted.weblate.org/projects/mapcomplete/), create an account +If you want to see MapComplete in _your_ language, head over to [Weblate](https://translate.mapcomplete.org/projects/mapcomplete/), create an account and start translating! There is, in settings, also an option to enable 'translation mode' in MapComplete. Many pieces of text in the interface will gain a small 'translate'-button which you can click to immediately translate or correct that piece of text. diff --git a/Docs/Reasonings/2023_in_review/2024-01-15 TranslationCompleteness.svg b/Docs/Reasonings/2023_in_review/2024-01-15 TranslationCompleteness.svg index aaa2effb1..6dbfa362f 100644 --- a/Docs/Reasonings/2023_in_review/2024-01-15 TranslationCompleteness.svg +++ b/Docs/Reasonings/2023_in_review/2024-01-15 TranslationCompleteness.svg @@ -106,156 +106,156 @@ - + Basque - + Catalan - + Chinese (Min Nan) (nan) - + Chinese (Simplified) - + Chinese (Traditional) - + Czech - + Danish - + Dutch - + English - + Esperanto - + Filipino - + Finnish - + French - + Galician - + German - + Hebrew - + Hungarian - + Indonesian - + Italian - + Japanese - + Norwegian Bokmål - + Polish - + Portuguese - + Portuguese (Brazil) - + Punjabi (Pakistan) - + Russian - + Slovenian - + Spanish - + Swedish - + Tamazight (Standard Moroccan) - \ No newline at end of file + diff --git a/README.md b/README.md index 06e11ee14..ba0f3a35c 100644 --- a/README.md +++ b/README.md @@ -126,14 +126,14 @@ own change and are using it, I would like to know about it. Drop me a line, give ## Translating MapComplete The core strings and builtin themes of MapComplete are translated -on [Hosted Weblate](https://hosted.weblate.org/projects/mapcomplete/core/). You can easily make an account and start +on [Weblate](https://translate.mapcomplete.org/projects/mapcomplete/core/). You can easily make an account and start translating in their web-environment - no installation required. You can even jump to the right translation string directly from MapComplete: ![](./Docs/Misc/HowToTranslate.gif) -[![Translation status](https://hosted.weblate.org/widgets/mapcomplete/-/multi-blue.svg)](https://hosted.weblate.org/engage/mapcomplete/) +[![Translation status](https://translate.mapcomplete.org/widgets/mapcomplete/-/multi-blue.svg)](https://translate.mapcomplete.org/engage/mapcomplete/) ## Architecture diff --git a/package.json b/package.json index e194db7bd..10531c5cf 100644 --- a/package.json +++ b/package.json @@ -114,9 +114,6 @@ "download:editor-layer-index": "vite-node scripts/downloadEli.ts", "download:stats": "vite-node scripts/GenerateSeries.ts", "download:images": "vite-node scripts/generateImageAnalysis.ts -- ~/data/imgur-image-backup/", - "weblate:add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git && git remote add weblate-hosted-core https://hosted.weblate.org/git/mapcomplete/core/ && git remote add weblate-hosted-layers https://hosted.weblate.org/git/mapcomplete/layers/", - "weblate:merge": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations", - "weblate:merge-heavy": "git fetch weblate-hosted-layers; git fetch weblate-hosted-core; git merge weblate-hosted-layers/master weblate-hosted-core/master ", "lint": "npm run lint:prettier && npm run lint:eslint && npm run lint:themes", "lint:eslint": "eslint ./src", "lint:prettier": "prettier --check '**/*.ts' '**/*.svelte'", diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index b9c08b51e..4918eddd4 100644 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -3,6 +3,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs" import { Utils } from "../src/Utils" import ScriptUtils from "./ScriptUtils" import Script from "./Script" +import Constants from "../src/Models/Constants" const knownLanguages = ["en", "nl", "de", "fr", "es", "gl", "ca"] const ignoreTerms = ["searchTerms"] @@ -262,7 +263,7 @@ class TranslationPart { lang = weblatepart weblatepart = "core" } - const fixLink = `Fix it on https://hosted.weblate.org/translate/mapcomplete/${weblatepart}/${lang}/?offset=1&q=context%3A%3D%22${encodeURIComponent( + const fixLink = `Fix it on ${Constants.weblate}translate/mapcomplete/${weblatepart}/${lang}/?offset=1&q=context%3A%3D%22${encodeURIComponent( path.join(".") )}%22` let subparts: string[] = value.match(/{[^}]*}/g) diff --git a/src/Models/Constants.ts b/src/Models/Constants.ts index 04c69f44f..3f6f5c943 100644 --- a/src/Models/Constants.ts +++ b/src/Models/Constants.ts @@ -137,6 +137,7 @@ export default class Constants { public static osmAuthConfig: AuthConfig = Constants.config.oauth_credentials public static nominatimEndpoint: string = Constants.config.nominatimEndpoint public static photonEndpoint: string = Constants.config.photonEndpoint + public static weblate: string = "https://translate.mapcomplete.org/" public static linkedDataProxy: string = Constants.config["jsonld-proxy"] /** diff --git a/src/UI/Base/LinkToWeblate.ts b/src/UI/Base/LinkToWeblate.ts index 2765f61db..f1d5fa2ac 100644 --- a/src/UI/Base/LinkToWeblate.ts +++ b/src/UI/Base/LinkToWeblate.ts @@ -3,6 +3,7 @@ import Locale from "../i18n/Locale" import Link from "./Link" import SvelteUIElement from "./SvelteUIElement" import Translate from "../../assets/svg/Translate.svelte" +import Constants from "../../Models/Constants" /** * The little 'translate'-icon next to every icon + some static helper functions @@ -48,7 +49,7 @@ export default class LinkToWeblate extends VariableUiElement { /** * Creates the url to Hosted weblate * - * LinkToWeblate.hrefToWeblate("nl", "category:some.context") // => "https://hosted.weblate.org/translate/mapcomplete/category/nl/?offset=1&q=context%3A%3D%22some.context%22" + * LinkToWeblate.hrefToWeblate("nl", "category:some.context") // => "https://translate.mapcomplete.org/translate/mapcomplete/category/nl/?offset=1&q=context%3A%3D%22some.context%22" */ public static hrefToWeblate(language: string, contextKey: string): string { if (contextKey === undefined || contextKey.indexOf(":") < 0) { @@ -57,7 +58,7 @@ export default class LinkToWeblate extends VariableUiElement { const [category, ...rest] = contextKey.split(":") const key = rest.join(":") - const baseUrl = "https://hosted.weblate.org/translate/mapcomplete/" + const baseUrl = Constants.weblate+"translate/mapcomplete/" return baseUrl + category + "/" + language + "/?offset=1&q=context%3A%3D%22" + key + "%22" } @@ -66,7 +67,7 @@ export default class LinkToWeblate extends VariableUiElement { category: "core" | "themes" | "layers" | "shared-questions" | "glossary" | string, searchKey: string ): string { - const baseUrl = "https://hosted.weblate.org/zen/mapcomplete/" + const baseUrl = Constants.weblate + "zen/mapcomplete/" // ?offset=1&q=+state%3A%3Ctranslated+context%3Acampersite&sort_by=-priority%2Cposition&checksum= return ( baseUrl + diff --git a/src/UI/BigComponents/MenuDrawer.svelte b/src/UI/BigComponents/MenuDrawer.svelte index b11cd1289..c5a282da9 100644 --- a/src/UI/BigComponents/MenuDrawer.svelte +++ b/src/UI/BigComponents/MenuDrawer.svelte @@ -276,7 +276,7 @@ - +