Questions tagged [jquery-globalization]

jQuery/Globalize (former jquery-global) is a library for the globalization of strings, dates, and numbers/currencies formatting and parsing for different cultures in JavaScript. It enables you to add globalization support to your JavaScript applications. This plugin includes globalization information for over 350 cultures ranging from Scottish Gaelic, Frisian, Hungarian, Japanese, to Canadian English. It's released to the community as open-source.

Globalize (from the jQuery team) is a JavaScript library for internationalization and localization that leverage the official Unicode CLDR JSON data. It started as jQuery plugin named jquery-global, but now it has no dependancy on jQuery. The library works both for the browser and as a Node.js module.

It enables complex culture-aware number and date parsing and formatting, including the raw culture information for hundreds of different languages and countries, as well as an extensible system for localization.

Features

  1. Supports over 350 different cultures, including country-specific cultures and language, country-neutral cultures.

  2. Culture information for each culture is available through a simple data structure, accessible to plugins for their own purposes.

  3. Supports formatting dates to any of these cultures, including those that have non-Gregorian calendars, Gregorian calendars with a year offset, and calendars with multiple Eras.

  4. Supports formatting numbers to strings as numbers, currency, or percentages, to any of these cultures, including those with very special formatting rules, such as number group sizes that differ between currency and percentages, or have a different number of digits.

  5. Supports parsing dates and numbers from the culture specific string representation of them back into JavaScript dates and numbers.

  6. Supports localization through a localize() API that handles selecting the best known match automatically.

  7. Supports the Accept-Language header value as-is, to select the culture best suited to the user per their browser settings.

  8. Extensibility allows for plugins to access and add to the culture information, including cultures it does not already support.

  9. Retrofitted the jQueryUI DatePicker plugin to use this plugin, rather than its existing globalization support. This was fairly simple to do and immediately opens up the range of cultures supported by the plugin to the full set of cultures supported by jQuery.glob.js.

Links

https://github.com/jquery/globalize
Read Me
jQuery Globalization Plugin from Microsoft
Exploring Globalization with jQuery
Proposal for a globalization plugin: jQuery.glob.js

43 questions
2
votes
1 answer

Best practice to implement globalization in MVC application

For form labels and alert messages which are client side, using resource file is heavy or not ? Shall I need separate implementation for client side specific strings using jquery and resource file for server side messages. Please let me know the…
2
votes
2 answers

jQuery Globalization. Pass currency unit as argument for C format

I am setting up a multilingual site that deals with currencies. I want to be able to display correct currency formats based on the selected language. The server side PHP stuff is a doddle. Using a combination of PHPs NumberFormatter and strftime I…
1
vote
2 answers

Jquery Globalization reverse algorithm

Jquery Globalization works great. You can format a currency doing something like this: $("#currencyInput").val(Globalize.format(100000.25, "c")); Is possible to reverse the formatting to be able to edit the value back? (keeping the culture…
Catalin
  • 11,503
  • 19
  • 74
  • 147
1
vote
2 answers

datejs vs Jquery/globalize

Could someone list the pros and cons of using one over the other. (www.datejs.com vs. https://github.com/jquery/globalize). All I knew is Jquery/globalize supports more culture than datejs.
Ram Alagianambi
  • 195
  • 1
  • 1
  • 6
1
vote
1 answer

Globalize bug in new v1.2.*? Parsing empty string returns 0

This question represents a proposed bug for Globalize. The owners of that project ask that it first be published as a SO question, so here we go... With the new version 1.2.1 (and 1.2.2) of Globalize we're noticing that number-parsing an empty…
1
vote
1 answer

Globalize bug in new v1.2.1? Parsing certain numbers returns NaN for 17 cultures (India, Bangladesh, Bhutan)

With the new version 1.2.1 of Globalize we're seeing 17 cultures for which parsing fails for numbers in the "hundreds" range (e.g. between 100 and 999). Here's a concrete example using the CLDR JSON data version 30.0.2 (also tested with the CLDR…
1
vote
2 answers

Jquery Globalize package

I'm very new to Visual Studio 2015 so I apologize if this is a dumb question. I downloaded this jquery globalize package will aids me with validation of dates from different locale. I have no idea what the scripts are for or how they are use. Are…
user5518616
1
vote
1 answer

Globalize error with local numbers on .Net MVC Project

I am trying to validate local decimal numbers (Portuguese -> pt-PT) but I get a console error in the Browser: Uncaught TypeError: t.parseFloat is not a function. Exception occurred when checking element SizeOpenedWidth, check the 'number'…
Patrick
  • 2,995
  • 14
  • 64
  • 125
1
vote
0 answers

Format a Number using JQuery globalization to include as few decimals as possible but as many as are required without rounding

Using the JQuery globalization plugin, I want to format numbers to use as many decimals needed to represent the correct value. Also i want the format to use as few decimals as possible. For example the following example yields…
Yodiz
  • 258
  • 2
  • 12
1
vote
2 answers

Issue with translation to different language using Jquery i18n

I am developing the mobile app with multilanguage support using phonegap and jquery.I am using Jquery i18n for multi language support. Followed the example shown in the site. I am able to pick the right file, but it shows me with the special…
Surya
  • 439
  • 3
  • 9
  • 31
1
vote
2 answers

parseFloat gives NaN for swedish culture

I am using jQuery Globalize plugin along with jQuery validation. For the valid swedish number 5.000,00 parseFloat function gives NaN What could be the bug in below code/library?