Chore: move from weblate server, see #2255

This commit is contained in:
Pieter Vander Vennet 2024-11-14 00:55:51 +01:00
parent 447264632f
commit 389f52f42c
10 changed files with 44 additions and 44 deletions

View file

@ -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)

View file

@ -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.

View file

@ -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.

View file

@ -106,156 +106,156 @@
<g id="layer1">
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/eu/" xlink:title="Basque">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/eu/" xlink:title="Basque">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="20" transform="rotate(-90)" id="text20">Basque</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect20" height="3" width="6" rx="2" y="156" x="14"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/ca/" xlink:title="Catalan">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/ca/" xlink:title="Catalan">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="35" transform="rotate(-90)" id="text35">Catalan</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect35" height="126" width="6" rx="2" y="33" x="29"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/nan/" xlink:title="Chinese (Min Nan) (nan)">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/nan/" xlink:title="Chinese (Min Nan) (nan)">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="50" transform="rotate(-90)" id="text50">Chinese (Min Nan) (nan)</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect50" height="0" width="6" rx="2" y="159" x="44"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/zh_Hans/" xlink:title="Chinese (Simplified)">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/zh_Hans/" xlink:title="Chinese (Simplified)">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="65" transform="rotate(-90)" id="text65">Chinese (Simplified)</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect65" height="7" width="6" rx="2" y="152" x="59"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/zh_Hant/" xlink:title="Chinese (Traditional)">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/zh_Hant/" xlink:title="Chinese (Traditional)">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="80" transform="rotate(-90)" id="text80">Chinese (Traditional)</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect80" height="81" width="6" rx="2" y="78" x="74"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/cs/" xlink:title="Czech">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/cs/" xlink:title="Czech">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="95" transform="rotate(-90)" id="text95">Czech</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect95" height="124" width="6" rx="2" y="35" x="89"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/da/" xlink:title="Danish">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/da/" xlink:title="Danish">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="110" transform="rotate(-90)" id="text110">Danish</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect110" height="93" width="6" rx="2" y="66" x="104"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/nl/" xlink:title="Dutch">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/nl/" xlink:title="Dutch">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="125" transform="rotate(-90)" id="text125">Dutch</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect125" height="126" width="6" rx="2" y="33" x="119"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/en/" xlink:title="English">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/en/" xlink:title="English">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="140" transform="rotate(-90)" id="text140">English</text>
<rect style="fill:#2eccaa;fill-opacity:1;stroke:none" id="rect140" height="150" width="6" rx="2" y="10" x="134"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/eo/" xlink:title="Esperanto">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/eo/" xlink:title="Esperanto">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="155" transform="rotate(-90)" id="text155">Esperanto</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect155" height="13" width="6" rx="2" y="146" x="149"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/fil/" xlink:title="Filipino">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/fil/" xlink:title="Filipino">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="170" transform="rotate(-90)" id="text170">Filipino</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect170" height="7" width="6" rx="2" y="152" x="164"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/fi/" xlink:title="Finnish">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/fi/" xlink:title="Finnish">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="185" transform="rotate(-90)" id="text185">Finnish</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect185" height="57" width="6" rx="2" y="102" x="179"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/fr/" xlink:title="French">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/fr/" xlink:title="French">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="200" transform="rotate(-90)" id="text200">French</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect200" height="82" width="6" rx="2" y="77" x="194"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/gl/" xlink:title="Galician">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/gl/" xlink:title="Galician">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="215" transform="rotate(-90)" id="text215">Galician</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect215" height="24" width="6" rx="2" y="135" x="209"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/de/" xlink:title="German">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/de/" xlink:title="German">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="230" transform="rotate(-90)" id="text230">German</text>
<rect style="fill:#2eccaa;fill-opacity:1;stroke:none" id="rect230" height="149" width="6" rx="2" y="10" x="224"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/he/" xlink:title="Hebrew">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/he/" xlink:title="Hebrew">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="245" transform="rotate(-90)" id="text245">Hebrew</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect245" height="3" width="6" rx="2" y="156" x="239"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/hu/" xlink:title="Hungarian">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/hu/" xlink:title="Hungarian">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="260" transform="rotate(-90)" id="text260">Hungarian</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect260" height="58" width="6" rx="2" y="101" x="254"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/id/" xlink:title="Indonesian">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/id/" xlink:title="Indonesian">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="275" transform="rotate(-90)" id="text275">Indonesian</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect275" height="31" width="6" rx="2" y="128" x="269"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/it/" xlink:title="Italian">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/it/" xlink:title="Italian">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="290" transform="rotate(-90)" id="text290">Italian</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect290" height="66" width="6" rx="2" y="94" x="284"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/ja/" xlink:title="Japanese">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/ja/" xlink:title="Japanese">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="305" transform="rotate(-90)" id="text305">Japanese</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect305" height="25" width="6" rx="2" y="134" x="299"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/nb_NO/" xlink:title="Norwegian Bokmål">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/nb_NO/" xlink:title="Norwegian Bokmål">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="320" transform="rotate(-90)" id="text320">Norwegian Bokmål</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect320" height="74" width="6" rx="2" y="85" x="314"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/pl/" xlink:title="Polish">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/pl/" xlink:title="Polish">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="335" transform="rotate(-90)" id="text335">Polish</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect335" height="124" width="6" rx="2" y="35" x="329"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/pt/" xlink:title="Portuguese">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/pt/" xlink:title="Portuguese">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="350" transform="rotate(-90)" id="text350">Portuguese</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect350" height="68" width="6" rx="2" y="91" x="344"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/pt_BR/" xlink:title="Portuguese (Brazil)">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/pt_BR/" xlink:title="Portuguese (Brazil)">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="365" transform="rotate(-90)" id="text365">Portuguese (Brazil)</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect365" height="27" width="6" rx="2" y="132" x="359"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/pa_PK/" xlink:title="Punjabi (Pakistan)">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/pa_PK/" xlink:title="Punjabi (Pakistan)">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="380" transform="rotate(-90)" id="text380">Punjabi (Pakistan)</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect380" height="17" width="6" rx="2" y="142" x="374"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/ru/" xlink:title="Russian">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/ru/" xlink:title="Russian">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="395" transform="rotate(-90)" id="text395">Russian</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect395" height="32" width="6" rx="2" y="127" x="389"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/sl/" xlink:title="Slovenian">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/sl/" xlink:title="Slovenian">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="410" transform="rotate(-90)" id="text410">Slovenian</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect410" height="8" width="6" rx="2" y="151" x="404"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/es/" xlink:title="Spanish">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/es/" xlink:title="Spanish">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="425" transform="rotate(-90)" id="text425">Spanish</text>
<rect style="fill:#38f;fill-opacity:1;stroke:none" id="rect425" height="91" width="6" rx="2" y="68" x="419"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/sv/" xlink:title="Swedish">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/sv/" xlink:title="Swedish">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="440" transform="rotate(-90)" id="text440">Swedish</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect440" height="11" width="6" rx="2" y="148" x="434"/>
</a>
<a xlink:href="https://hosted.weblate.org/projects/mapcomplete/core/-/zgh/" xlink:title="Tamazight (Standard Moroccan)">
<a xlink:href="https://translate.mapcomplete.org/projects/mapcomplete/core/-/zgh/" xlink:title="Tamazight (Standard Moroccan)">
<text xml:space="preserve" style="font-style:normal;font-weight:normal;font-size:11px;font-family:'Source Sans 3',sans-serif;fill:#808080;text-anchor:end;" x="-170" y="455" transform="rotate(-90)" id="text455">Tamazight (Standard Moroccan)</text>
<rect style="fill:#f6664c;fill-opacity:1;stroke:none" id="rect455" height="1" width="6" rx="2" y="158" x="449"/>
</a>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -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

View file

@ -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'",

View file

@ -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)

View file

@ -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"]
/**

View file

@ -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 +

View file

@ -276,7 +276,7 @@
<EnvelopeOpen class="h-6 w-6" />
<Tr t={Translations.t.general.attribution.emailCreators} />
</a>
<a class="flex" href="https://hosted.weblate.org/projects/mapcomplete/" target="_blank">
<a class="flex" href={`${Constants.weblate}projects/mapcomplete/`} target="_blank">
<TranslateIcon class="h-6 w-6" />
<Tr t={Translations.t.translations.activateButton} />
</a>