rasvaan / accurator

Accurator cpack
7 stars 3 forks source link

Localisation #156

Closed rasvaan closed 8 years ago

rasvaan commented 8 years ago

Localisation

IDs are used within Accurator for injecting code, injecting localised labels and formatting using CSS. Having a consistent naming scheme for IDs will make the code more manageable in the future.

IDs should be formulated according to the following scheme:

[UI_NAME] ELEMENT DESCRIPTION

Example:

List of possible ELEMENT and their abbreviated versions:

List of current UI_NAME (a page or an element that is occurring on multiple pages):

Note: name of the modal or the name of the form + a description of the functionality if multiple controls exist such that we can differentiate between them

rasvaan commented 8 years ago

Pages todo

rasvaan commented 8 years ago

This will be moved to a new feature branch.

Before we update all this, I would really like to investigate the possibility of doing some sort of templating, by adding variables to the static HTML which are instantiated on the back-end according to given parameters. The programmatic flow would be something like this:

  1. Request for page is received by handler
  2. Parameters Locale and Domain are retrieved from request
  3. Text labels are retrieved from triple store based on parameters
  4. Specified page location is related to static html file
  5. Static html file is 'parsed'
  6. Variables in static html file are replaced by obtained labels
  7. Html is replied populated with text labels

I think the quasi quotations could help, this provides functionality for generating html:

element -->
    {rdf(UI, dcterms:title, literal(lang(en, Title)))},
    html({|html(Title)||
      <h1>Title</h1>
    |}). 

If we could replace <h1>Title</h1> with the static page and populate the list of variables added tot html(Title) dynamically this would bring us a long way in implementing point 4, 5 and 6. We should ask Jan if this is easily achieved.

LaraHack commented 8 years ago

Test pages:

Further testing:

rasvaan commented 8 years ago

logos on the bible page not very visible in the bible domain this might be something to have a look at during the templating.