jQuery 1.11.3 and 2.1.4 Released – iOS Fail-Safe Edition

Posted on by

Here we are again. It’s too late for April Fools, so you can believe us when we tell you that we have two new patch releases for you: jQuery 1.11.3 and 2.1.4.

These releases include a hot-fix for a rare bug in iOS 8.2 and 8.3. This is the only change. As with 1.11.2 and 2.1.3, we do not anticipate any issues when upgrading. However, if you do encounter bugs in upgrading from the previous versions, please let us know.

You can include these files directly from the jQuery CDN if you like, or copy them to your own local server. The 1.x branch includes support for IE 6/7/8 and the 2.x branch does not.

https://code.jquery.com/jquery-1.11.3.js

https://code.jquery.com/jquery-2.1.4.js

These updates are already available as the current versions on npm and Bower. Information on all the ways to get jQuery is available at https://jquery.com/download/. Please keep in mind that public, third-party CDNs receive their copies today and it can take a few days to post the files. If you’re anxious to get started, our CDN is always available.

Many thanks to all of you who participated in this release by testing, reporting bugs, or submitting patches, including John-David Dalton, Michał Gołębiowski, Oleg Gaidarenko, Richard Gibson, Dave Methvin, Benjamin Poulain, and Oz Solomon.

Thanks for all your support, and we look forward to showing you all we have in store for jQuery 3.0!

 

Announcing Globalize 1.0

Posted on by

The jQuery Foundation is excited to announce the 1.0 release of the Globalize project, our internationalization (i18n) library. This release has been a long time coming and as Globalize picks up steam and gains more and more adoption every day, we are proud to finally announce the first stable release of this project. We could go on about the features and benefits of this latest release but we felt it was important that you hear it from the source. Below, Rafael Xavier, the lead for the Globalize project, details everything you need to know about the 1.0 release of Globalize and what is yet to come.

An always up-to-date, modular and simple i18n library

Allow me to skip the details and jump to the fun part. Below is what you get with Globalize today, which provides number formatting and parsing, date and time formatting and parsing, currency formatting, message formatting (ICU message format pattern with gender and pluralization support).

Date formatting and parsing

The date module provides methods that convert dates and times from their internal representations to textual form (formatting) and back again (parsing) in a language-independent manner. Your code can conveniently control the length of the formatted date, time, datetime.

locale .dateFormatter({ datetime: "medium" })( new Date() );
en "Feb 20, 2015, 12:15:00 PM"
zh "2015年2月20日 下午12:15:00"
zh-u-nu-native "二〇一五年二月二〇日 下午一二:一五:〇〇"
es "20 de feb. de 2015 12:15:00"
ar "٢٠‏/٠٢‏/٢٠١٥ ١٢،١٥،٠٠ م"

Your code can even select the fields individually, completely independent of the locale conventions. The pattern “GyMMMd” selects era in its abbreviated form, year, month in its abbreviated form, and day.

locale .dateFormatter({ skeleton "GyMMMd" })( new Date() );
en "Feb 20, 2015 AD"
zh "公元2015年2月20日"
es "20 feb. de 2015 d. C."
ar "٢٠ فبراير، ٢٠١٥ م"

 

Relative time formatting

In addition to formatting dates and times, the relative time module provides internationalized messages for date and time fields, using customary word or phrase when available.

locale, value .relativeTimeFormatter( "day" )( value );
en, -15 "15 days ago"
en, 0 "today"
en, 1 "tomorrow"

 

Number formatting and parsing

The number module provides methods that format and parse numbers. Your code can be completely independent of the locale conventions for decimal points, thousands-separators, or even the particular decimal digits used, or whether the number format is even decimal. Though, it can still conveniently control various aspects of the formatted number like the minimum and maximum fraction digits, integer padding, rounding method, display as percentage, and others.

locale .numberFormatter()( Math.PI );
en (English) "3.142"
es (Spanish) "3,142"
ar (Arabic) "٣٫١٤٢"

Formatting thousands-separators:

locale .numberFormatter()( 1000000 );
en-US (English as spoken in the United States) "1,000,000"
en-IN (English as spoken in India) "10,00,000"

Formatting percentages:

locale .numberFormatter({ style: "percent" })( 0.15 );
en (English) "15%"
es (Spanish) "15 %"
ar (Arabic) "١٥٪"

 

Currency formatting

The currency module provides methods that allow to format a currency. Your code can be completely independent of the locale conventions for which currency symbol to use, whether or not there’s a space between the currency symbol and the value, the side where the currency symbol must be placed, or even decimal digits used by particular currencies. Currencies can be displayed using symbols (the default), accounting form, 3-letter code, or plural messages.

Formatting currencies using symbols:

3-letter currency code en (English) de (German) zh (Chinese) ar (Arabic)
.currencyFormatter( "USD" )( 1 ); "$1.00" "1,00 $" "US$ 1.00" "US$ ١٫٠٠"
.currencyFormatter( "EUR" )( 1 ); "€1.00" "1,00 €" "€ 1.00" "€ ١٫٠٠"
.currencyFormatter( "CNY" )( 1 ); "CN¥1.00" "1,00 CN¥" "¥ 1.00" "ي.ص ١٫٠٠"
.currencyFormatter( "JPY" )( 1 ); "¥1" "1 ¥" "JP¥ 1" "JP¥ ١"
.currencyFormatter( "GBP" )( 1 ); "£1.00" "1,00 £" "£ 1.00" "£ ١٫٠٠"
.currencyFormatter( "BRL" )( 1 ); "R$1.00" "1,00 R$" "R$ 1.00" "R$ ١٫٠٠"

Formatting currencies in their full names:

locale .currencyFormatter( "USD", { style: "name" })( 1 );
en (English) "1.00 US dollar"
de (German) "1,00 US-Dollar"
zh (Chinese) "1.00美元"
ar (Arabic) "١٫٠٠ دولار أمريكي"

Formatting currencies in the accounting form, which, for example, in the English locale uses parens instead of the minus sign for negative numbers:

locale .currencyFormatter( "USD", { style: "accounting" })( -1 );
en (English) "($1.00)"

 

ICU message format support (with gender and pluralization support)

The message module provides methods that allow for the creation of internationalized messages, with optional arguments (variables/placeholders) allowing for simple replacement, gender and plural inflections. The arguments can occur in any order, which is necessary for translation into languages with different grammars.

Globalize.loadMessages({
  en: {
   likeIncludingMe: [
      "{count, plural,",
      "    one {You have one task remaining}",
      "  other {You have {count} tasks remaining}",
      "}"
    ]
  }
});

 

locale, count .messageFormatter( "likeIncludingMe" )({ count: count });
en, 1 "You have one task remaining"
en, 99 "You have 99 tasks remaining"

 

Built on standards

Globalize is based on the Unicode Consortium standards and specifications (UTS#35) and it uses its 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, so you’ll always have access to the most accurate and up-to-date locale data.

CLDR content

Globalize needs CLDR content to function properly, although it doesn’t embed or host such content. Instead, Globalize empowers developers to load CLDR data the way they want. Vanilla CLDR in its official JSON format (no pre-processing) is expected to be provided. As a consequence, (a) Globalize avoids bugs caused by outdated i18n content. Developers can use up-to-date CLDR data directly from Unicode as soon as it’s released, without having to wait for any pipeline on our side. (b) Developers have full control over which locale coverage they want to provide on their applications. (c) Developers are able to share the same i18n dataset between Globalize and other libraries that leverage CLDR. There’s no need for duplicating data. For more information read our documentation on CLDR Usage.

Browser and Node.js Support

Globalize is systematically tested against desktop and mobile browsers and Node.js. So, using it you’ll get consistent results across the various browsers and between client and server. For more details read our Browser Support section.

Get Started

Install it and use it today. See examples for AMD + bower, or Node.js + npm, or plain JavaScript in our Usage section.

If you’re coming from Globalize 0.x, don’t panic. We’ve created a migration guide for you.

Team and Community

We’re grateful for all the support we have received, specifically from Jörn Zaefferer and Scott González for their help with the initial rewrite concept and for being constant advisors; John Emmons, Steven R. Loomis, and Mark Davis (Unicode) for their help with CLDR and UTS#35 specification questions; Alex Sexton and Eemeli Aro for their messageformat.js and make-plural.js libraries that power respectively our MessageFormat and Plural modules; and the jQuery Foundation for the community building, collaborative efforts and its continued support of Globalize and web internationalization.

We want to also thank Nebojša Ćirić, Mihai Niță, and Shanjian Li (Google); Steven Loomis, Steven Atkin, and John Emmons (IBM); Rick Waldron (Ecma-402 2nd Edition editor); Caridy Patiño and Eric Ferraiuolo (Yahoo); Christophe Jolif and Clement Mathieu (Dojo); Cameron Dutro and Kirill Lashuk (Twitter); Craig Cummings and Tex Texin (jsi18n.com); Santhosh Thottingal and Kartik Mistry (Wikipedia); Axel Hecht (Mozilla); Bruno Lewin and Daniel Goldschmidt (Microsoft); Lily Wen (Adobe); Edwin Hoogerbeets (LG); Eirik Rude (Oracle); Xiang Xu (Paypal); Iskren Chernev (moment.js); and Tingan Ho (l10ns.org) to have joined us in an effort to better coordinate the globalization (internationalization and localization) activity of the JavaScript community. If you want to get involved or read more about it, head over to the javascript-globalization@googlegroups.com mailing list or take a look at our JavaScript Globalization overview page.

Upcoming

We’re working on even more exciting features that will soon be part of Globalize. To name a few: runtime optimization and non-gregorian calendar support. So, if any of these are of your interest, make sure you chime in. Express your thoughts and your needs (e.g., which calendars you want to be supported).
We are always looking for contributors to join our team. If you want to get involved, please read the contributing guide. Your help is very welcome.

Announcing PEP 0.3.0

Posted on by

Today, we’re happy to announce the first release of PEP (jQuery Foundation’s Pointer Events polyfill) since Google transferred the Pointer Events polyfill to the jQuery Foundation. There’s more work to do in order to address changes to the Pointer Events specification and flesh out our test suite, but you can start using Pointer Events in your projects today! Other projects, like jQuery UI, jQuery Mobile, and Dojo are in the process of switching to Pointer Events with PEP.

To celebrate our first release, Alex Schmitz built a little demo which he used to show PEP working on different devices.

P drawn on desktop ChromeE drawn in Chrome on AndroidP drawn in Mobile Safari

Since the transfer, we’ve been focusing on moving over to new infrastructure to allow easier contributions and faster development. We’ve switched the tests over to using Intern and set up continuous integration with Travis CI, using BrowserStack to run the tests in all of our supported browsers. We’ve also switched away from plain file concatenation to using ES6 modules via Esperanto to make the cross-file dependencies explicit. Lastly, we’ve moved to our common release infrastructure to ensure consistent releases.

To get started with PEP, you can get the files from npm, bower (pepjs), the jQuery CDN, or the GitHub release. Check out the samples or view the project README for more details. If you run into any issues using PEP, please file an issue or join us on IRC in #pep on freenode.