|
Locale-Sensitive JavaScript Method
Internationalization (I18n) Method OverviewThis method compares two strings, using the default locale when there are no locales passed in, else using the locales and optional options, returning 0 if
the strings are equal, -1 if the base string sorts before compareString or 1 if the base string sorts after compareString. Click here (w3schools) and here (MDN) for additional details. Note: Not all browsers support the locales and options parameters. I18n IssuesWhether or not calling
Suggested ReplacementIf strings are user-facing, they may need be translated by retrieving them from a locale-sensitive resource file. Be sure to pass in the locales parameter to ensure sorting is based on the application locale. Include options as needed to fine-tune the collation. To improve performance, you may want to construct the locale-sensitive 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.
|