buddycloud/webclient — pull request #85 by highfellow (2012-11-14 21:00:13+00:00)
Title: welcome page localised

This is my first proof of concept version of the localisation code. I've just localised the welcome page so far, but I should be able to use the same basic approach for the rest of it. The libraries I've added are a cut down version of https://github.com/fabi1cazenave/webL10n, adapted to work with requirejs.

I decided in the end to try to keep the templates clean by localising most of the strings based on a 'data-l10n="token_value"' attribute, rather than using embedded javascript everywhere.

The function I've used to scan the template for localisable strings will work for most cases but not all. E.g. strings in tag attributes will need to be done with embedded javascript. The same for the ones which come from the views not the templates. This shouldn't be a problem - they just need treating as special cases.

Let me know what you think. :-)