Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
Translation for infobox
Russ Garretta48e1e409667
diff --git a/web/locales/en/translation.json b/web/locales/en/translation.jsonindex 7b195b7..a41cf55 100644--- a/web/locales/en/translation.json+++ b/web/locales/en/translation.json@@ -1,9 +1,4 @@{- "nav": {- "about": "about",- "stats": "stats",- "exports": "exports"- },"edit": {"edit": "Edit","remote": "Edit with remote control (JOSM, etc)",@@ -11,7 +6,6 @@"error": "Unable to load remote editor - make sure it's running and has remote control enabled.\nError: "},"names": {- "pipeline": "Pipeline","power": {"transformer": "Transformer","tower": "Power tower",@@ -54,6 +48,7 @@"exchange": "Telephone exchange","cabinet": "Telecoms cabinet"},+ "pipeline": "Pipeline","petroleum": {"well": "Well","facility": "Petroleum facility"@@ -89,6 +84,25 @@},"other-pumping-station": "Other pumping station"},+ "info": {+ "name": "Name",+ "operator": "Operator",+ "output": "Power",+ "source": "Source",+ "start-date": "Start date",+ "generation-method": "Generation method",+ "substation-type": "Substation type",+ "reference": "Reference",+ "circuits": "Circuits",+ "type": "Type",+ "website": "Website",+ "view-openstreetmap": "View on OpenStreetMap"+ },+ "nav": {+ "about": "about",+ "stats": "stats",+ "exports": "exports"+ },"units": {"kV": "kV","Hz": "Hz",@@ -99,10 +113,6 @@"kW": "kW","V": "V"},- "info": {- "website": "Website",- "view-openstreetmap": "View on OpenStreetMap"- },"more_info": "More info","wikipedia": "Wikipedia","wikimedia-commons": "Wikimedia Commons",diff --git a/web/src/infopopup.ts b/web/src/infopopup.tsindex cd16cca..ba3c3fd 100644--- a/web/src/infopopup.ts+++ b/web/src/infopopup.ts@@ -22,9 +22,28 @@ const hidden_keys = ['gid','ref_len','frequency',+ 'transition','angle']+function fieldName(key: string) {+ return (+ {+ name: t('info.name', 'Name'),+ operator: t('info.operator', 'Operator'),+ output: t('info.output', 'Output'),+ source: t('info.source', 'Source'),+ start_date: t('info.start-date', 'Start date'),+ method: t('info.generation-method', 'Generation method'),+ substation: t('info.substation-type', 'Substation type'),+ ref: t('info.reference', 'Reference'),+ circuits: t('info.circuits', 'Circuits'),+ type: t('info.type', 'Type'),+ repd_id: 'REPD ID'+ }[key] || titleCase(key)+ )+}+function formatVoltage(value: number | number[]): string {if (!Array.isArray(value)) {value = [value]@@ -179,7 +198,7 @@ class InfoPopup {})key = t('info.website', 'Website')} else {- key = titleCase(this.friendlyRender(key))+ key = fieldName(key)}return el('tr', el('th', key), el('td', value))@@ -266,7 +285,7 @@ class InfoPopup {el('a', el('div.ext_link.osm_link'), {href: this.osmLink(feature.properties['osm_id'], feature.properties['is_node']),target: '_blank',- title: t('info.view_openstreetmap', 'View on OpenStreetMap')+ title: t('info.view-openstreetmap', 'View on OpenStreetMap')}))}@@ -351,7 +370,7 @@ class InfoPopup {el('a', el('div.ext_link.commons_link'), {href: data['sitelinks']['commonswiki']['url'],target: '_blank',- title: t('wikimedia_commons', 'Wikimedia Commons')+ title: t('wikimedia-commons', 'Wikimedia Commons')}))}