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
21
votes
3 answers

Localizing jquery validation with asp.net mvc 3

I am using Asp.Net Mvc3 and the unobtrusive jquery validation. I'd like to have my dates validation localized, I mean, jquery is validating my date as being MM/dd/yyyy but I would like it to be dd/MM/yyyy. I'm trying to use the jQuery Globalize…
thitemple
  • 5,833
  • 4
  • 42
  • 67
19
votes
3 answers

Can't get the jquery globalization to work

I try to use the jQuery Globalization plugin in order to fix the comma problem with jquery unobstructive client validation. However I tried many many solutions and there no good solution to fix this. I am on a non-English localization computer and…
Rushino
  • 9,415
  • 16
  • 53
  • 93
11
votes
2 answers

ASP.NET MVC 3 RC 2 client side validation with globalization

My goal is to validate a user input on the client-side, depending on the users' culture. I have a primitive data-model with the following structure: public class User { public int UserId { get; set; } [Required] …
sde
  • 123
  • 1
  • 5
6
votes
3 answers

Unobtrusive Validation on en-GB Dates

I am designing a data input form using asp.net MVC4 which has an input of type date. Using the unobtrusive jQuery library in chrome and jQueryUI datepicker I was still getting an error (The field news_date must be a date.), after selecting a correct…
5
votes
1 answer

How do I make globalization work with MVC2 and jquery?

I am trying out some globalization in an asp.net mvc2 application but can't get it to work fully. I am using the library http://github.com/nje/jquery-glob as a tool to display currency and dates etc according to user wishes. However something is…
mhenrixon
  • 6,179
  • 4
  • 40
  • 64
5
votes
2 answers

Globalize.addCultureInfo is not a function

I am using the Globalize jQuery plugin to have globalization (correct number and date formats) on the client side in my MVC website. So I have downloaded that plugin and included the following javascript files after the validation js files…
user2711444
  • 179
  • 1
  • 4
  • 13
4
votes
1 answer

JQuery Validation Globalization MVC 4 DateTime

In my class I have the property: public virtual DateTime Date { get; set; } Which renders "31/12/2012 12:00:00 AM" by default with the culture set to "en-CA" and "12/31/2012 12:00:00 AM" if the culture is "en-US". The JQuery validation works fine…
3
votes
1 answer

Globalization, Localization, Internationalization: Add Languages (French, etc.) / asp.net 4.0 / for dummies

I'm not a programmer, but I have a little company website that I developed with MS Visual Web Developer 2010 Express (not Visual Studio), so I'm not completely inept. I want to add French and Spanish languages to my website. So some websites have,…
3
votes
1 answer

Globalize and cldr with requirejs

I am trying to Globalize. Below is my project configuration at present: At present I am not using the node environment, specifically not using either of npm or bower, rather using NuGet as package manager. Module system: AMD On application startup,…
3
votes
1 answer

Numeric Format for No Thousands Separator

Is there a number format that would produce a localized number without the thousands separator? Globalize.format("1000.12", "n?" ) I realize I could do: Globalize.culture().numberFormat[","]=""; But I have some fields where I want it off and…
Tim
  • 3,576
  • 6
  • 44
  • 58
3
votes
1 answer

Jquery Globalize format of number and Google Chrome

This fiddle return the correct value of "5,5" in both IE and FF but in Chrome it returns "5.5" Fiddle: http://jsfiddle.net/4tvSH/ Globalize.culture("sv-SE"); alert(Globalize.format(5.5)); Is there a bug in the Globalize plugin? edit: This is…
Anders
  • 17,306
  • 10
  • 76
  • 144
2
votes
1 answer

Data Annotations + MVC3 + Culture Issue

I'm having a problem working with Cultures, MVC3 and Data Annotations. I defined a table STORES on a spanish database (COLLATION is set for LATIN_GENERAL); some of the fields are defined in SQL as DECIMAL(18,2) NOT NULL. On my MVC3 Application I…
2
votes
1 answer

jquery global plugin parsing inputs

I am trying to do this with jquery globalization plugin but it fails in the browser (client script error, indexOf()) var newquantity = $.global.parseFloat(edititem.find('td.edititem-quantity > input')); I used to use the jquery calculation plugin…
mare
  • 13,033
  • 24
  • 102
  • 191
2
votes
1 answer

npm install globalize - E_MISSING_BUNDLE

I'm sure this is a silly configuration problem but I cannot seem to figure it out. I'm using the globalize package within nodejs installed this way: npm install --save globalize cldr-data Which looking at my package.json installed: "globalize":…
darrin
  • 749
  • 5
  • 23
2
votes
1 answer

How to check if jQuery Globalize is initialized?

I am using the jQuery Globalize library which uses cldr for internationalization. Before you can use any of the Globalize functions, you have to load the correct cldr-data and pass it to Globalize. Is there a way to check if this initialization has…
magnattic
  • 12,638
  • 13
  • 62
  • 115
1
2 3