Internationalization and localization tools


Locale-Sensitive .NET JavaScript Method

Date.parseInvariant(dateString);
Number.parseInvariant(numberString);

Internationalization (I18n) Method Overview

The Date and Number parseInvariant static methods parse a date or number string based on the invariant culture rather than the current Culture (Locale); in other words, regardless the locale, the string will be parsed in the same way.

Note that these are Microsoft JavaScript Extended methods that require the .NET Framework. For additional method details, click here (Date) and here (Number).

I18n Issues

Whether or not calling parseInvariant is an i18n issue is dependent on how it is being used in the application. If the current Culture should be used when parsing the string, then this method should not be called.

Suggested Replacement

To ensure that the current culture is used when parsing the string to create the Date or Number rather than the invariant culture, call parseLocale.


Globalyzer will detect this method and report it as an i18n issue. If you have determined that the call is being handled correctly, you can use Globalyzer's Ignore Comment functionality to ensure that it isn't picked up in a subsequent scan.



Locale-Sensitive JavaScript Methods

 

Lingoport internationalization and localization services and software