Globalize (JavaScript library) explained

Globalize
Author:Rafael Xavier de Souza
Developer:jQuery Foundation
Programming Language:JavaScript
Platform:See Browser support
Genre:JavaScript library
License:MIT License[1]

Globalize is a cross-platform JavaScript library for internationalization and localization that uses the Unicode Common Locale Data Repository (CLDR).

Overview

Globalize provides number formatting and parsing, date and time formatting and parsing, currency formatting, unit formatting, message formatting (ICU message format pattern), and plural support.

Design Goals:

Globalize is based on the Unicode Consortium's Common Locale Data Repository (CLDR), the largest and most extensive standard repository of locale data available. CLDR is constantly updated and is used by many large applications and operating systems, to always have access to the most accurate and up-to-date locale data.

Usage

Since Globalize doesn't bundle any localization data, it has to be first initialized using some CLDR content:

var Globalize = require("globalize");Globalize.load(require("cldr-data").entireSupplemental);Globalize.load(require("cldr-data").entireMainFor("en", "es"));

Globalize("en").formatDate(new Date);// > "11/27/2015"

Globalize("es").formatDate(new Date);// > "27/11/2015"

History

Globalize was first announced in October 2010 by John Resig[2] and originally developed by David Reed, sponsored by Microsoft, under the name jQuery Globalization plugin,[3] built on top of an export of the .net locale database.[4] From there the dependency on jQuery was removed[5] and the project renamed to Globalize.[6] In a much larger effort, the project was entirely rewritten on top of Unicode's CLDR, making use of its comprehensive and accurate coverage of all kinds of localization data.[7]

Notes and References

  1. Web site: License - jQuery Project . 2016-01-30 . jQuery Foundation.
  2. http://blog.jquery.com/2010/10/04/new-official-jquery-plugins-provide-templating-data-linking-and-globalization/ Announcement of jQuery Globalization on jQuery Blog
  3. https://github.com/globalizejs/globalize/commit/3fc4b83d15a3337d5d9e70efebb36a4a8af0f861 Initial commit of jQuery Globalization on GitHub
  4. https://github.com/globalizejs/globalize/tree/3fc4b83d15a3337d5d9e70efebb36a4a8af0f861/generator The source files for the generator on GitHub
  5. https://github.com/globalizejs/globalize/commit/252f8ad0f668dbc63c7c43deef160acc9b3c9746 GitHub commit that starts a non-jQuery dependent version of the library
  6. https://github.com/globalizejs/globalize/commit/5cdac721d5ac49e708dc690fc15d60c7dc526bac Final GitHub commit to rename the repo from jquery-global to Globalize
  7. http://blog.jquery.com/2015/04/23/announcing-globalize-1-0/ Announcement of Globalize 1.0