Internationalization and localization tools


Locale-Sensitive Objective-C Method

Foundation NSDate

NSDate dateWithNaturalLanguageString:

Internationalization (I18n) Method Overview

This method performs date/string conversion using current locale.

Click here for additional Apple Developer Documentation details.

I18n Issues

  1. Could be the wrong locale (hard coded English)
  2. Creating an "old-style" date formatter
  3. NSDateFormatter attempts natural-language processing only after it fails to interpret an entered string according to format. Natural-language processing supports only a limited set of colloquial phrases, primarily in English. It may give unexpected results, and its use is strongly discouraged.

Resolution: You cannot use this method to initialize a formatter with the OS X v10.4 formatting behavior, you must use init. Initialize the formatter with init. If necessary, you can set the default class behavior using setDefaultFormatterBehavior:, or using setFormatterBehavior:message with the argument NSDateFormatterBehavior10_4.

Generally one needs to pass in locale, encoding or language to ensure that any culture-dependent conversion is done properly. If you determine that the call is i18n-safe, you can use Globalyzer's Ignore Comment functionality to ensure that it isn't picked up in a subsequent scan.

For information about Objective-C Internationalization, click here.

 

Lingoport internationalization and localization services and software