Localisation
XXX is the main area of the project - i.e. admin, front end, etc
YYY is the module of the area - i.e. article, menu, etc
Key is the "thing" we're providing text for - i.e. title, contact name, email address, etc
so, ADMIN_ARTICLE_Title = Title etcI have 2 files, one in English, one in Dutch and I use an appSetting in my web.config file to specify what my DefaultCulture should be. The site will only run in either Dutch or English so there is no need to make anything more complicated that this, and it allows development and maintenance to be affected in English, whilst the live site is presented in Dutch.This is all working well, but then I got to thinking about the javascript and drew a blank through my google searching. Some of my javascript files perform validation, and alert the user with appropriate messages if the content isn't valid. I asked some of my local brains and still came up with a blank, a few names were banded about, but I didn't get to HackDay and so didn't get to pick their brains.At the moment, I've added a line to my resources file to contain the javascript file to include in the file. This allows there to be muliple validation files, one per language if I want - at the moment there is just one file and it's in Dutch. But really this isn't a great solution. I've started doing some investigation and playing, but haven't really had the time to progress it any further.The current 4 options to do this that I can think of are:
- Basic - 2 javascript files, one per language - duplicate functionality
- Literals - 3 javascript files - one per language, plus one with functionality
- A self detecting piece of javascript that works out the locale from some setting and thus includes the appropriate literals file (or other data store method) dynamically
- A method using a better form of data store than variables
Anyone done any localisation/localization in javascript and got any more options or solutions for me?