Internationalization and localization tools


Locale-Sensitive JavaScript Method

string.toLocaleLowerCase();

Internationalization (I18n) Method Overview

This method returns a copy of the string converted to lowercase letters; the lowercase rules are based on the default locale. It works similarly to toLowerCase except that it should handle the few places where the locale is needed to return the correct character. For example, Turkish has both a dotted and a dotless uppercase I; calling toLocaleLowerCase with the default locale set to Turkish will correctly result in a dotted and dotless lowercase i.

Click here (w3schools) and here (MDN) for additional method details.

I18n Issues

toLocaleLowerCase uses the default locale, rather than the locale of the application, to determine how to lowercase letters. This may be problematic if the string has non-English characters and you want your internationalized application to run in a different locale.

Suggested Replacement

If the string will have non-English characters, and you want the application to be able to run in a locale that is other than the browser's locale, you will need to either handle casing in server-side code, or use a 3rd party JavaScript library which can support casing based on a locale parameter.


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