GIScience / ors-map-client

Openrouteservice API web SPA client using VueJS, Vuetify and Vue2Leaflet
http://maps.openrouteservice.org
Apache License 2.0
106 stars 32 forks source link

Unify translation file syntax and use JSON correctly #334

Closed koebi closed 1 year ago

koebi commented 1 year ago

The original message states:

ich habe ein Problem mit den i18n Ordner, das Mir bekannte JSON Format sieht nicht koscher aus. Das JSON nested structure file nutzt keine ' sondern "

which translates to I have a problem with the i18n-folders, the JSON format (which I know) is not quite kosher. The JSON nested structure file doesn't use ' (singlequotes, editor's note) but " (doublequotes, editor's note).

It goes on to state that this is evident in this file

export default {
   maps: {
     pageTitle: 'Ors Maps',
     Places: 'Orte',
     isochrones: 'Isochronen',
     placeNameRequired: 'Ortsangabe benötigt',
     altitude: 'Höhenänderung',
     settings: 'Einstellungen',
     toggleAccessibleMode: 'Barrierefreien Modus aktivieren/deaktivieren',
     about: 'Über ors',
     updateSearch: 'Suche in dieser Gegend',
     updateSearchAfterZoomOrCenterChange: 'Suche nach Kartenbewegung aktualisieren',
     pageNotFound: 'Seite nicht gefunden. Überprüfen Sie, ob die URL unvollständig oder falsch ist'
   }
}

which should look like

{
   "maps": {
     "pageTitle": "Ors Maps",
     "Places": "Orte",
     "isochrones": "Isochronen",
     "placeNameRequired": "Ortsangabe benötigt",
     "altitude: "Höhenänderung",
     "settings: "Einstellungen",
     "toggleAccessibleMode": "Barrierefreien Modus aktivieren/deaktivieren",
     "about": "Über ors",
     "updateSearch": "Suche in dieser Gegend",
     "updateSearchAfterZoomOrCenterChange": "Suche nach Kartenbewegung aktualisieren",
     "pageNotFound": "Seite nicht gefunden. Überprüfen Sie, ob die URL unvollständig oder falsch ist"
   }
}

It notes further that

die Java Befehle export default sollten da nicht enthalten sein können wir uns an das Format halten?

which translates to

the Java statement export default should not be there. Can we stick to the Format?

TheGreatRefrigerator commented 1 year ago

The files in the i18n folder are no JSON (JavaScript Object Notation) files but native JavaScript files. As it's a .js and not a .json file, the export is needed to properly import it in other JS files.