/** * @copyFrom http://Finn-Rasmussen.com/myphp-1.11/myphp-1.11-js/html/javascript/Locale.js.php * Copyrigt notice: You may copy the source code as is as long as you keep the copy right notice intact * * @package javascript * @author http://Finn-Rasmussen.com * @copyright http://Finn-Rasmussen.com * @version 1.11 * @since 27-nov-2009 */ var Locale = new function() { // Consts, do NOT change this.PERIOD = '.'; this.COMMA = ','; this.DASH = '-'; this.SLASH = '/'; this.language = LanguageCode.DANISH; this.country = CountryCode.DK; this.getInstance = function(language, country) { if (typeof language !== 'undefined') { this.language = language; } if (typeof country !== 'undefined') { this.country = country; } return this; } this.getDecimalPoint = function() { var decimalPoint = this.PERIOD; switch (this.language) { case LanguageCode.DANISH: case LanguageCode.NORWEGIAN: case LanguageCode.SWEDISH: decimalPoint = this.COMMA; break; default: break; } return decimalPoint; } this.getThousandSeperator = function() { var thousandSeperator = this.COMMA; switch (this.language) { case LanguageCode.DANISH: case LanguageCode.NORWEGIAN: case LanguageCode.SWEDISH: thousandSeperator = this.PERIOD; break; default: break; } return thousandSeperator; } this.getSeperator = function() { var seperator = this.SLASH; switch (this.language) { case LanguageCode.DANISH: case LanguageCode.NORWEGIAN: case LanguageCode.SWEDISH: seperator = this.DASH; break; default: break; } return seperator; } }