Colota - Android GPS Location tracker
refactor(i18n): move Request format into the catalog (#902)
Max Dietrich1c503a7d0b12
diff --git a/apps/mobile/src/i18n/locales/en.json b/apps/mobile/src/i18n/locales/en.jsonindex 71f585bc..57516cbc 100644--- a/apps/mobile/src/i18n/locales/en.json+++ b/apps/mobile/src/i18n/locales/en.json@@ -205,5 +205,52 @@"connection.test.notReachable": "Not reachable","connection.test.http": "HTTP {{status}}","connection.test.noResponse": "No response",- "common.unknownError": "Unknown error"+ "common.unknownError": "Unknown error",+ "template.dawarich.description": "OwnTracks-compatible format for Dawarich",+ "template.geopulse.description": "Native Colota format for GeoPulse",+ "template.overland.description": "Overland-compatible batch endpoint (GeoJSON Features)",+ "template.owntracks.description": "Standard OwnTracks HTTP format",+ "template.phonetrack.description": "Nextcloud PhoneTrack logging format",+ "template.reitti.description": "OwnTracks-compatible format for Reitti",+ "template.traccar.description": "Traccar OsmAnd protocol (HTTP GET)",+ "template.custom.description": "Your own field names, mapped by hand",+ "requestFormat.intro": "Customize field names sent to your server",+ "requestFormat.section.httpMethod": "HTTP method",+ "requestFormat.section.dawarichMode": "Dawarich mode",+ "requestFormat.section.fieldMappings": "Field mappings",+ "requestFormat.section.customFields": "Custom fields",+ "requestFormat.section.exampleRequest": "Example request",+ "requestFormat.section.examplePayload": "Example payload",+ "requestFormat.method.post.sub": "Sends the fields as a JSON body",+ "requestFormat.method.get.sub": "Sends the fields as URL query parameters",+ "requestFormat.field.lat": "Latitude coordinate",+ "requestFormat.field.lon": "Longitude coordinate",+ "requestFormat.field.acc": "GPS accuracy in meters",+ "requestFormat.field.alt": "Altitude in meters",+ "requestFormat.field.vel": "Speed in m/s",+ "requestFormat.field.batt": "Battery level percentage",+ "requestFormat.field.bs": "Battery charging status",+ "requestFormat.field.tst": "Timestamp",+ "requestFormat.field.bear": "Direction of travel (0-360°)",+ "requestFormat.dawarich.single": "Single point",+ "requestFormat.dawarich.single.sub": "Sends one request per location",+ "requestFormat.dawarich.batch": "Batch",+ "requestFormat.dawarich.batch.sub": "Sends queued locations in one request",+ "requestFormat.dawarich.batch.needsInterval": "Needs a sync interval above Instant",+ "requestFormat.dawarich.batch.needsPost": "Needs the POST method, not GET",+ "requestFormat.dawarich.endpoint": "Endpoint: {{url}}",+ "requestFormat.resetAll": "Reset all",+ "requestFormat.modified": "Modified",+ "requestFormat.resetField": "Reset {{key}} to the default",+ "requestFormat.custom.empty": "No custom fields. Add static key-value pairs to include in every payload.",+ "requestFormat.custom.keyLabel": "Custom field key",+ "requestFormat.custom.valueLabel": "Custom field value",+ "requestFormat.custom.keyPlaceholder": "Key",+ "requestFormat.custom.valuePlaceholder": "Value",+ "requestFormat.custom.remove": "Remove this custom field",+ "requestFormat.custom.add": "+ Add Field",+ "requestFormat.duplicates": "Duplicate field names: {{names}}. Resolve duplicates to save changes.",+ "requestFormat.copy": "Copy",+ "requestFormat.copied": "Copied!",+ "requestFormat.footer": "Changes apply to new location data immediately"}diff --git a/apps/mobile/src/screens/ApiSettingsScreen.tsx b/apps/mobile/src/screens/ApiSettingsScreen.tsxindex 9fd67a92..8dd63481 100644--- a/apps/mobile/src/screens/ApiSettingsScreen.tsx+++ b/apps/mobile/src/screens/ApiSettingsScreen.tsx@@ -43,25 +43,14 @@ import {} from "../utils/apiPayload"import { HIT_SLOP_LG, space, STATE_LAYER_ALPHA } from "../constants"import { radius } from "@colota/shared"+import { useTranslation } from "../i18n/useTranslation"+import type { TranslationKey } from "../i18n/options"type LocalCustomField = CustomField & { id: number }-/** Field descriptions for UI display */-const FIELD_DESCRIPTIONS: Record<keyof FieldMap, string> = {- lat: "Latitude coordinate",- lon: "Longitude coordinate",- acc: "GPS accuracy in meters",- alt: "Altitude in meters",- vel: "Speed in m/s",- batt: "Battery level percentage",- bs: "Battery charging status",- tst: "Timestamp",- bear: "Direction of travel (0-360°)"-}--const HTTP_METHOD_OPTIONS: { value: HttpMethod; label: string; sub: string }[] = [- { value: "POST", label: "POST", sub: "Sends the fields as a JSON body" },- { value: "GET", label: "GET", sub: "Sends the fields as URL query parameters" }+const HTTP_METHOD_OPTIONS: { value: HttpMethod; subKey: TranslationKey }[] = [+ { value: "POST", subKey: "requestFormat.method.post.sub" },+ { value: "GET", subKey: "requestFormat.method.get.sub" }]/**@@ -85,6 +74,7 @@ function getReferenceCustomFields(template: ApiTemplateName): CustomField[] {export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Request Format">) {const { settings, setSettings, restartTracking } = useTracking()const { colors } = useTheme()+ const { t } = useTranslation()const nextIdRef = useRef(0)const assignId = () => nextIdRef.current++@@ -101,7 +91,9 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Requesconst isGetMethod = localHttpMethod === "GET"const showDawarichChip = localTemplate === "dawarich"const batchDisabled = isInstantSync || isGetMethod- const batchDisabledReason = isInstantSync ? "Needs a sync interval above Instant" : "Needs the POST method, not GET"+ const batchDisabledReason = isInstantSync+ ? t("requestFormat.dawarich.batch.needsInterval")+ : t("requestFormat.dawarich.batch.needsPost")const copiedTimeout = useTimeout()const {saving,@@ -480,23 +472,19 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques<Container><ScrollView contentContainerStyle={styles.scrollContent} keyboardShouldPersistTaps="handled"><View style={styles.header}>- <Text style={[styles.subtitle, { color: colors.textSecondary }]}>- Customize field names sent to your server- </Text>+ <Text style={[styles.subtitle, { color: colors.textSecondary }]}>{t("requestFormat.intro")}</Text></View>{/* Template Selector */}<View style={styles.section}>- <SectionTitle>Backend template</SectionTitle>+ <SectionTitle>{t("screen.backendTemplate")}</SectionTitle><Card rows><ListItemtestID="nav-backend-template"- label={localTemplate === "custom" ? "Custom" : API_TEMPLATES[localTemplate].label}- sub={- localTemplate === "custom"- ? "Your own field names, mapped by hand"- : API_TEMPLATES[localTemplate].description- }+ label={localTemplate === "custom" ? t("common.custom") : API_TEMPLATES[localTemplate].label}+ sub={t(+ localTemplate === "custom" ? "template.custom.description" : API_TEMPLATES[localTemplate].descriptionKey+ )}onPress={() => navigation.navigate("Backend Template", { selected: localTemplate })}/></Card>@@ -506,14 +494,14 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques{/* Overland template is POST-only by spec; no need to expose the choice */}{localTemplate !== "overland" && (<View style={styles.section}>- <SectionTitle>HTTP method</SectionTitle>+ <SectionTitle>{t("requestFormat.section.httpMethod")}</SectionTitle><View accessibilityRole="radiogroup" style={styles.radioGroup}>- {HTTP_METHOD_OPTIONS.map(({ value, label, sub }) => (+ {HTTP_METHOD_OPTIONS.map(({ value, subKey }) => (<RadioRowkey={value}testID={`http-method-${value.toLowerCase()}`}- label={label}- sub={sub}+ label={value}+ sub={t(subKey)}selected={localHttpMethod === value}onPress={() => handleHttpMethodChange(value)}/>@@ -525,19 +513,19 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques{/* Dawarich Mode Selector (Dawarich template only) */}{showDawarichChip && (<View style={styles.section}>- <SectionTitle>Dawarich mode</SectionTitle>+ <SectionTitle>{t("requestFormat.section.dawarichMode")}</SectionTitle><View accessibilityRole="radiogroup" style={styles.radioGroup}><RadioRowtestID="dawarich-mode-single"- label="Single point"- sub="Sends one request per location"+ label={t("requestFormat.dawarich.single")}+ sub={t("requestFormat.dawarich.single.sub")}selected={localDawarichMode === "single"}onPress={() => handleDawarichModeChange("single")}/><RadioRowtestID="dawarich-mode-batch"- label="Batch"- sub={batchDisabled ? batchDisabledReason : "Sends queued locations in one request"}+ label={t("requestFormat.dawarich.batch")}+ sub={batchDisabled ? batchDisabledReason : t("requestFormat.dawarich.batch.sub")}disabled={batchDisabled}selected={localDawarichMode === "batch"}onPress={() => handleDawarichModeChange("batch")}@@ -545,8 +533,8 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques</View><Text style={[styles.templateHint, { color: colors.textSecondary }]}>{localDawarichMode === "batch"- ? `Endpoint: ${API_TEMPLATES.dawarich.batchEndpointExample}`- : `Endpoint: ${API_TEMPLATES.dawarich.endpointExample}`}+ ? t("requestFormat.dawarich.endpoint", { url: API_TEMPLATES.dawarich.batchEndpointExample })+ : t("requestFormat.dawarich.endpoint", { url: API_TEMPLATES.dawarich.endpointExample })}</Text></View>)}@@ -554,7 +542,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques{/* Field Mapping Section */}<View style={styles.fieldsSection}><View style={styles.sectionHeader}>- <SectionTitle>Field mappings</SectionTitle>+ <SectionTitle>{t("requestFormat.section.fieldMappings")}</SectionTitle>{hasModifications && (<PressableonPress={handleResetAll}@@ -563,7 +551,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Requesandroid_ripple={{ color: colors.primaryDark + STATE_LAYER_ALPHA, borderless: true }}style={styles.resetAllButton}>- <Text style={[styles.resetAllText, { color: colors.primaryDark }]}>Reset all</Text>+ <Text style={[styles.resetAllText, { color: colors.primaryDark }]}>{t("requestFormat.resetAll")}</Text></Pressable>)}</View>@@ -583,12 +571,14 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques<Text style={[styles.fieldLabel, { color: colors.text }]}>{key.toUpperCase()}</Text>{isFieldModified && (<View style={[styles.modifiedBadge, { backgroundColor: colors.primary }]}>- <Text style={[styles.modifiedText, { color: colors.textOnPrimary }]}>Modified</Text>+ <Text style={[styles.modifiedText, { color: colors.textOnPrimary }]}>+ {t("requestFormat.modified")}+ </Text></View>)}</View><Text style={[styles.fieldDescription, { color: colors.textSecondary }]} numberOfLines={1}>- {FIELD_DESCRIPTIONS[key]}+ {t(`requestFormat.field.${key}`)}</Text></View>@@ -611,7 +601,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques<IconButtonicon={RotateCcw}testID={`reset-${key}`}- accessibilityLabel={`Reset ${key} to the default`}+ accessibilityLabel={t("requestFormat.resetField", { key })}onPress={() => handleResetField(key)}/>)}@@ -629,14 +619,12 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques{/* Custom Fields Section */}<View style={styles.fieldsSection}><View style={styles.sectionHeader}>- <SectionTitle>Custom fields</SectionTitle>+ <SectionTitle>{t("requestFormat.section.customFields")}</SectionTitle></View><View style={[styles.fieldsCard, { backgroundColor: colors.card }]}>{localCustomFields.length === 0 ? (- <Text style={[styles.emptyHint, { color: colors.textSecondary }]}>- No custom fields. Add static key-value pairs to include in every payload.- </Text>+ <Text style={[styles.emptyHint, { color: colors.textSecondary }]}>{t("requestFormat.custom.empty")}</Text>) : (localCustomFields.map((field, index) => {const isDuplicate = duplicateFieldNames.has(field.key.trim())@@ -644,25 +632,25 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques<View key={field.id}><View style={styles.customFieldRow}><TextField- accessibilityLabel="Custom field key"+ accessibilityLabel={t("requestFormat.custom.keyLabel")}testID={`custom-key-${field.id}`}style={styles.customFieldInput}monoerror={isDuplicate}value={field.key}onChangeText={(text) => handleCustomFieldChange(field.id, "key", text)}- placeholder="Key"+ placeholder={t("requestFormat.custom.keyPlaceholder")}autoCapitalize="none"autoCorrect={false}/><TextField- accessibilityLabel="Custom field value"+ accessibilityLabel={t("requestFormat.custom.valueLabel")}testID={`custom-value-${field.id}`}style={styles.customFieldInput}monovalue={field.value}onChangeText={(text) => handleCustomFieldChange(field.id, "value", text)}- placeholder="Value"+ placeholder={t("requestFormat.custom.valuePlaceholder")}autoCapitalize="none"autoCorrect={false}/>@@ -670,7 +658,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Requesicon={X}tone="danger"testID={`remove-custom-${field.id}`}- accessibilityLabel="Remove this custom field"+ accessibilityLabel={t("requestFormat.custom.remove")}onPress={() => handleRemoveCustomField(field.id)}/></View>@@ -680,7 +668,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques}))}- <Button title="+ Add Field" onPress={handleAddCustomField} variant="secondary" />+ <Button title={t("requestFormat.custom.add")} onPress={handleAddCustomField} variant="secondary" /></View></View>@@ -690,14 +678,18 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Requesstyle={[styles.warningBanner, { backgroundColor: colors.error + "15", borderColor: colors.error + "40" }]}><Text style={[styles.warningText, { color: colors.error }]}>- Duplicate field names: {[...duplicateFieldNames].join(", ")}. Resolve duplicates to save changes.+ {t("requestFormat.duplicates", { names: [...duplicateFieldNames].join(", ") })}</Text></View>)}{/* Example payload preview */}<View style={styles.exampleSection}>- <SectionTitle>{localHttpMethod === "GET" ? "Example request" : "Example payload"}</SectionTitle>+ <SectionTitle>+ {localHttpMethod === "GET"+ ? t("requestFormat.section.exampleRequest")+ : t("requestFormat.section.examplePayload")}+ </SectionTitle><Viewstyle={[styles.exampleCard,@@ -716,7 +708,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Requesstyle={styles.copyButton}><Text style={[styles.copyButtonText, { color: copied ? colors.success : colors.primaryDark }]}>- {copied ? "Copied!" : "Copy"}+ {copied ? t("requestFormat.copied") : t("requestFormat.copy")}</Text></Pressable></View>@@ -724,9 +716,7 @@ export function ApiSettingsScreen({ navigation, route }: RootScreenProps<"Reques{/* Footer */}<View style={styles.footer}>- <Text style={[styles.footerText, { color: colors.textLight }]}>- Changes apply to new location data immediately- </Text>+ <Text style={[styles.footerText, { color: colors.textLight }]}>{t("requestFormat.footer")}</Text></View></ScrollView>diff --git a/apps/mobile/src/screens/BackendTemplateScreen.tsx b/apps/mobile/src/screens/BackendTemplateScreen.tsxindex f26494ea..f953b61f 100644--- a/apps/mobile/src/screens/BackendTemplateScreen.tsx+++ b/apps/mobile/src/screens/BackendTemplateScreen.tsx@@ -9,8 +9,10 @@ import { Card, Container, RadioRow } from "../components"import { API_TEMPLATES, ApiTemplateName } from "../types/global"import { space } from "../constants"import type { RootScreenProps } from "../types/navigation"+import { useTranslation } from "../i18n/useTranslation"+import type { TranslationKey } from "../i18n/options"-type TemplateOption = { value: ApiTemplateName; label: string; description: string }+type TemplateOption = { value: ApiTemplateName; label: string | null; descriptionKey: TranslationKey }/*** Eight options, each needing a sentence, is past the point where inline radio rows fit a form@@ -18,15 +20,16 @@ type TemplateOption = { value: ApiTemplateName; label: string; description: stri* Settings does for Default browser or Digital assistant app.*/const OPTIONS: TemplateOption[] = [- { value: "custom", label: "Custom", description: "Your own field names, mapped by hand" },+ { value: "custom", label: null, descriptionKey: "template.custom.description" },...Object.entries(API_TEMPLATES).map(([key, template]) => ({value: key as ApiTemplateName,label: template.label,- description: template.description+ descriptionKey: template.descriptionKey}))]export function BackendTemplateScreen({ navigation, route }: RootScreenProps<"Backend Template">) {+ const { t } = useTranslation()const selected = route.params.selectedconst choose = useCallback(@@ -45,8 +48,8 @@ export function BackendTemplateScreen({ navigation, route }: RootScreenProps<"Ba<RadioRowkey={option.value}testID={`template-${option.value}`}- label={option.label}- sub={option.description}+ label={option.label ?? t("common.custom")}+ sub={t(option.descriptionKey)}selected={selected === option.value}onPress={() => choose(option.value)}/>diff --git a/apps/mobile/src/screens/__tests__/ApiSettingsScreen.test.tsx b/apps/mobile/src/screens/__tests__/ApiSettingsScreen.test.tsxindex ffeab359..a09e6741 100644--- a/apps/mobile/src/screens/__tests__/ApiSettingsScreen.test.tsx+++ b/apps/mobile/src/screens/__tests__/ApiSettingsScreen.test.tsx@@ -150,7 +150,20 @@ describe("ApiSettingsScreen", () => {expect(getByTestId("nav-backend-template")).toBeTruthy()expect(getByText("Dawarich")).toBeTruthy()- expect(getByText(API_TEMPLATES.dawarich.description)).toBeTruthy()+ expect(getByText("OwnTracks-compatible format for Dawarich")).toBeTruthy()+ })++ it("shows the endpoint Dawarich expects, since its two modes post to different paths", () => {+ const { getByText } = renderWithTemplate("dawarich")++ expect(getByText(`Endpoint: ${API_TEMPLATES.dawarich.endpointExample}`)).toBeTruthy()+ })++ it("says what each mapped field carries, so a self-hoster can match it to the server's names", () => {+ const { getByText } = renderScreen()++ expect(getByText("Latitude coordinate")).toBeTruthy()+ expect(getByText("Direction of travel (0-360°)")).toBeTruthy()})it("opens the picker rather than switching in place", () => {@@ -216,14 +229,15 @@ describe("ApiSettingsScreen", () => {})// Verify we start on Dawarich (description visible)- expect(getByText(API_TEMPLATES.dawarich.description)).toBeTruthy()+ expect(getByText("OwnTracks-compatible format for Dawarich")).toBeTruthy()// Edit the "cog" field (bear) to something elseconst cogInput = getByDisplayValue("cog")fireEvent.changeText(cogInput, "heading")// Template description should disappear (switched to Custom)- expect(queryByText(API_TEMPLATES.dawarich.description)).toBeNull()+ expect(queryByText("OwnTracks-compatible format for Dawarich")).toBeNull()+ expect(getByText("Your own field names, mapped by hand")).toBeTruthy()})})diff --git a/apps/mobile/src/screens/__tests__/BackendTemplateScreen.test.tsx b/apps/mobile/src/screens/__tests__/BackendTemplateScreen.test.tsxindex 41ae8b91..2e0cfcf8 100644--- a/apps/mobile/src/screens/__tests__/BackendTemplateScreen.test.tsx+++ b/apps/mobile/src/screens/__tests__/BackendTemplateScreen.test.tsx@@ -1,3 +1,4 @@+import { t } from "../../i18n/t"import React from "react"import { render, fireEvent } from "@testing-library/react-native"@@ -37,7 +38,7 @@ describe("BackendTemplateScreen", () => {Object.values(API_TEMPLATES).forEach((template) => {expect(getByText(template.label)).toBeTruthy()- expect(getByText(template.description)).toBeTruthy()+ expect(getByText(t(template.descriptionKey))).toBeTruthy()})})diff --git a/apps/mobile/src/types/__tests__/defaults.test.ts b/apps/mobile/src/types/__tests__/defaults.test.tsindex 6a9ee93b..78eabd69 100644--- a/apps/mobile/src/types/__tests__/defaults.test.ts+++ b/apps/mobile/src/types/__tests__/defaults.test.ts@@ -148,9 +148,22 @@ describe("API_TEMPLATES", () => {expect(API_TEMPLATES[name].customFields.length).toBeGreaterThan(0)})- it.each(templateNames)("%s has label and description", (name) => {+ it("describes each template with its own sentence, so no row borrows another template's line", () => {+ const described = Object.fromEntries(templateNames.map((name) => [name, t(API_TEMPLATES[name].descriptionKey)]))++ expect(described).toEqual({+ dawarich: "OwnTracks-compatible format for Dawarich",+ geopulse: "Native Colota format for GeoPulse",+ overland: "Overland-compatible batch endpoint (GeoJSON Features)",+ owntracks: "Standard OwnTracks HTTP format",+ phonetrack: "Nextcloud PhoneTrack logging format",+ reitti: "OwnTracks-compatible format for Reitti",+ traccar: "Traccar OsmAnd protocol (HTTP GET)"+ })+ })++ it.each(templateNames)("%s has a label", (name) => {expect(API_TEMPLATES[name].label).toBeTruthy()- expect(API_TEMPLATES[name].description).toBeTruthy()})it.each(templateNames)(diff --git a/apps/mobile/src/types/global.ts b/apps/mobile/src/types/global.tsindex d68eb9a2..ef0fa755 100644--- a/apps/mobile/src/types/global.ts+++ b/apps/mobile/src/types/global.ts@@ -118,7 +118,7 @@ export type DawarichMode = "single" | "batch"export interface ApiTemplate {name: ApiTemplateNamelabel: string- description: string+ descriptionKey: TranslationKeyfieldMap: FieldMapcustomFields: CustomField[]httpMethod?: HttpMethod@@ -134,7 +134,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaendpointExample: "https://dawarich.example/api/v1/owntracks/points?api_key=YOUR_KEY",batchEndpointExample: "https://dawarich.example/api/v1/overland/batches?api_key=YOUR_KEY",label: "Dawarich",- description: "OwnTracks-compatible format for Dawarich",+ descriptionKey: "template.dawarich.description",fieldMap: {lat: "lat",lon: "lon",@@ -152,7 +152,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaname: "geopulse",endpointExample: "https://geopulse.example/api/colota",label: "GeoPulse",- description: "Native Colota format for GeoPulse",+ descriptionKey: "template.geopulse.description",fieldMap: {lat: "lat",lon: "lon",@@ -170,7 +170,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaname: "overland",endpointExample: "https://overland.example/",label: "Overland",- description: "Overland-compatible batch endpoint (GeoJSON Features)",+ descriptionKey: "template.overland.description",fieldMap: {lat: "lat",lon: "lon",@@ -188,7 +188,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaname: "owntracks",endpointExample: "https://owntracks.example/pub",label: "OwnTracks",- description: "Standard OwnTracks HTTP format",+ descriptionKey: "template.owntracks.description",fieldMap: {lat: "lat",lon: "lon",@@ -209,7 +209,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaname: "phonetrack",endpointExample: "https://nextcloud.example/apps/phonetrack/log/owntracks/SESSION_TOKEN/DEVICE_NAME",label: "PhoneTrack",- description: "Nextcloud PhoneTrack logging format",+ descriptionKey: "template.phonetrack.description",fieldMap: {lat: "lat",lon: "lon",@@ -227,7 +227,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaname: "reitti",endpointExample: "https://reitti.example/api/location",label: "Reitti",- description: "OwnTracks-compatible format for Reitti",+ descriptionKey: "template.reitti.description",fieldMap: {lat: "lat",lon: "lon",@@ -245,7 +245,7 @@ export const API_TEMPLATES: Record<Exclude<ApiTemplateName, "custom">, ApiTemplaname: "traccar",endpointExample: "http://192.168.1.10:5055",label: "Traccar",- description: "Traccar OsmAnd protocol (HTTP GET)",+ descriptionKey: "template.traccar.description",httpMethod: "GET",fieldMap: {lat: "lat",