martindholmes / BreezeMap

BreezeMap is a project to create a simple user interface for interactive map and facsimile editing based on TEI XML and OpenLayers 4+.
MIT License
11 stars 3 forks source link

Abstract all UI text #7

Closed martindholmes closed 6 years ago

martindholmes commented 6 years ago

This obviously needs to be done; all sorts of captions etc. are embedded in the JS directly. Options are:

  1. An external file containing only captions, which could be overridden by a specifically-named user version.
  2. A section of the XML file where these captions are defined, with the defaults in the template file which I haven't yet created.
  3. A combination of the two: a set of default values in an external file which can be overridden in the XML file.

These captions will have to be properties of the holMap object in the JSON.

martindholmes commented 6 years ago

Currently this is done by creating string variables in the hol.Utils namespace. But a better approach would be to create a single object with child objects whose keys are language designations (per BCP47), which then contain string members. The startup code could then find the first applicable [xml:]lang attribute from the map upwards, and assign the appropriate member to a property of the hol.VectorLayer instance, which would then use it. When ES6 modules are fully supported, the object could be spun off into a module for easier editing.

martindholmes commented 6 years ago

Created an object indexed by language in commit 08ee692.

martindholmes commented 6 years ago

Closing this for now; we're pretty far along with it, until we have someone who can actually do a translation for us.