comphist / cora

A web-based, token-level annotation tool for non-standard language data
http://www.linguistics.rub.de/comphist/resources/cora/
MIT License
10 stars 6 forks source link

Generate localized GUI strings purely in JavaScript? #60

Open mbollmann opened 8 years ago

mbollmann commented 8 years ago

Originally reported by: Marcel Bollmann (Bitbucket: mbollmann, GitHub: mbollmann)


Can we generate GUI strings purely in JavaScript, instead of the current PHP/JS duality?

This would remove the need to double each localization key in the source: once for the data-trans-id attribute, and once for PHP to generate the localized string. Instead, we would rely on the data-trans-id attribute and generate all localized strings by JavaScript.

We currently have a loading screen anyway, so maybe we could do this while the page is not yet visible, to avoid showing the user a page without text while the localizations load.


mbollmann commented 8 years ago

Original comment by Marcel Bollmann (Bitbucket: mbollmann, GitHub: mbollmann):


Calling gui.updateAllLocaleText() takes ~155ms on average on my VirtualBox system; ~175ms when the editor is open. Measured with:

var a, b;
a = performance.now(); gui.updateAllLocaleText(); b = performance.now(); (b - a)

Compare times on underberg etc.