Add matrix-bot translations

This commit is contained in:
Pieter Vander Vennet 2022-06-05 03:41:53 +02:00
parent af4ed4af80
commit 59ec7221a7
9 changed files with 110 additions and 18 deletions

View file

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

View file

@ -1,6 +1,5 @@
import {InputElement} from "./InputElement";
import {UIEventSource} from "../../Logic/UIEventSource";
import doc = Mocha.reporters.doc;
export default class Slider extends InputElement<number> {

View file

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

View file

@ -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<T> extends Translation {
return Utils.SubstituteKeys(template, text, lang);
}, context)
}
}