Internationalization and localization tools


Locale-Sensitive JavaScript Method

string.toLowerCase();

Internationalization (I18n) Method Overview

This method returns a copy of the string converted to lowercase letters; the lowercase rules follow the Unicode Character Database specifications.

Note: There are a few cases where the locale-independent Unicode results are incorrect. For example, Turkish has both a dotted and a dotless uppercase I, yet in both cases toLowerCase will result in the dotted lowercase i.

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

I18n Issues

toLowerCase uses the locale of the browser, rather than the locale of the application, to determine how to lowercase letters. This can be problematic if this 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, call toLocaleLowerCase which will work correctly if your application is to run in the default locale. If you want the application to be able to run in a locale that is other than the default 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