Globalize (JavaScript Library)
   HOME

TheInfoList



OR:

Globalize is a
cross-platform In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software r ...
JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. Libraries With the expanded demands for JavaScript, an ea ...
for
internationalization and localization In computing, internationalization and localization (American) or internationalisation and localisation (British English), often abbreviated i18n and L10n, are means of adapting computer software to different languages, regional peculiarities and ...
that uses the Unicode
Common Locale Data Repository The Common Locale Data Repository Project, often abbreviated as CLDR, is a project of the Unicode Consortium to provide locale data in XML format for use in computer applications. CLDR contains locale-specific information that an operating syst ...
(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: * Leverages the Unicode CLDR data and follows its UTS#35 specification. * Keeps code separate from i18n content. Doesn't host or embed any locale data in the library. Empowers developers to control the loading mechanism of their choice. * Allows developers to load as much or as little data as they need. Avoids duplicating data if using multiple i18n libraries that leverage CLDR. * Keeps code modular. Allows developers to load the i18n functionalities they need. * Runs in browsers and
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code ou ...
, consistently across all of them. * Makes
globalization Globalization, or globalisation (Commonwealth English; see spelling differences), is the process of interaction and integration among people, companies, and governments worldwide. The term ''globalization'' first appeared in the early 20t ...
as easy to use as
jQuery jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of Aug 2022, jQuery is used ...
. Globalize is based on the Unicode Consortium's
Common Locale Data Repository The Common Locale Data Repository Project, often abbreviated as CLDR, is a project of the Unicode Consortium to provide locale data in XML format for use in computer applications. CLDR contains locale-specific information that an operating syst ...
(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 John Resig is an American software engineer and entrepreneur, best known as the creator and lead developer of the jQuery JavaScript library. , he works as the chief software architect at Khan Academy. History Resig graduated with an undergraduate ...
and originally developed by David Reed, sponsored by
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
, under the name jQuery Globalization plugin, built on top of an export of the .net locale database. From there the dependency on jQuery was removed and the project renamed to Globalize. 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.Announcement of Globalize 1.0
/ref>


References

{{Authority control Free software programmed in JavaScript JavaScript libraries Software using the MIT license