71 lines
2.8 KiB
Typst
71 lines
2.8 KiB
Typst
// Localization Helper
|
|
#let translate(key) = {
|
|
context {
|
|
let lang = text.lang
|
|
let en = (
|
|
"servers.title": "Servers",
|
|
"servers.desc": "This section lists the available servers used to access the API.",
|
|
"servers.caption": "Server List",
|
|
"servers.table.addr": "Address",
|
|
"servers.table.desc": "Description",
|
|
"schemas.title": "Schemas",
|
|
"schemas.desc": "This section defines the data structures sent and received by the API.",
|
|
"schemas.caption": "Schema",
|
|
"schemas.property": "Property",
|
|
"schemas.type": "Type",
|
|
"schemas.desc-ex": "Description/Example",
|
|
"endpoints.title": "Endpoints",
|
|
"endpoints.desc": "This section describes the available commands (endpoints) that can be sent to the API.",
|
|
"endpoints.endpoint": "Endpoint",
|
|
"endpoints.method": "HTTP Method",
|
|
"endpoints.summary": "Summary",
|
|
"endpoints.description": "Description",
|
|
"endpoints.parameters": "Parameters:",
|
|
"endpoints.request-body": "Request Body:",
|
|
"endpoints.responses": "Responses:",
|
|
"endpoints.uses-schema": "Uses schema ",
|
|
"endpoints.array-of": "Array of ",
|
|
"endpoints.type-prefix": "Type",
|
|
"endpoints.caption": "Endpoint",
|
|
"common.example": "Example",
|
|
"common.any": "any",
|
|
)
|
|
let de = (
|
|
"servers.title": "Server",
|
|
"servers.desc": "In diesem Abschnitt werden die verfügbaren Server aufgelistet, über die die API erreicht werden kann.",
|
|
"servers.caption": "Serverliste",
|
|
"servers.table.addr": "Adresse",
|
|
"servers.table.desc": "Beschreibung",
|
|
"schemas.title": "Datenschemata",
|
|
"schemas.desc": "Hier sind die Datenstrukturen definiert, die von der API gesendet und empfangen werden.",
|
|
"schemas.caption": "Schema",
|
|
"schemas.property": "Eigenschaft",
|
|
"schemas.type": "Typ",
|
|
"schemas.desc-ex": "Beschreibung/Beispiel",
|
|
"endpoints.title": "Endpunkte",
|
|
"endpoints.desc": "In diesem Abschnitt werden die verfügbaren Befehle (Endpunkte) beschrieben, die an die API gesendet werden können.",
|
|
"endpoints.endpoint": "Endpunkt",
|
|
"endpoints.method": "HTTP-Methode",
|
|
"endpoints.summary": "Zusammenfassung",
|
|
"endpoints.description": "Beschreibung",
|
|
"endpoints.parameters": [Parameter: \ (Name, Ort, Typ, \ Beschreibung)],
|
|
"endpoints.request-body": "Anfrage-Daten:",
|
|
"endpoints.responses": [Antworten: \ (Statuscode, Daten) ],
|
|
"endpoints.uses-schema": "Verwendet Schema ",
|
|
"endpoints.array-of": "Liste von ",
|
|
"endpoints.type-prefix": "Typ",
|
|
"endpoints.caption": "Endpunkt",
|
|
"common.example": "Beispiel",
|
|
"common.any": "beliebig",
|
|
)
|
|
|
|
let dict = if lang == "de" { de } else { en }
|
|
let val = dict.at(key, default: key)
|
|
|
|
if val != none {
|
|
val
|
|
}
|
|
}
|
|
}
|
|
|