Localizing an iOS app

Accessibility & localization Mid-level Swift 5.5+ iOS 17+ Reviewed By Alok Singh

Pick the fix

You show a date as "\(day)/\(month)/\(year)". What is better?

Options
Hint 1 of 1

Who should decide the order?

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A date.formatted(date: .abbreviated, time: .omitted), which follows the user's locale

Correct. Order, separators and month names adapt.

Why not the others?
  • B Translate the slash in the String Catalog. The order of day and month still differs by region.
  • C Always use ISO 8601 in the UI. ISO dates suit machines, not most readers.
  • D Use a DateFormatter with a fixed dateFormat. A fixed format ignores locale conventions.

30-second answer

Put every user-facing string in a String Catalog, with comments for translators, and never build sentences by concatenation. Format dates, numbers, currencies, measurements and lists with FormatStyle so they follow the user's locale. Support plurals and right-to-left layouts, localize App Store metadata, and test with pseudolanguages and real translations.

Practise saying it · 45 s. No recording, just a timer

Explain how you localize an app.

Say your answer out loud, then check which of these points you covered:

  • String Catalogs
  • FormatStyle
  • Plurals and RTL
  • Testing

Deep dive

Locale, calendar and time zone are separate settings.

Per-app language settings mean the app's language can differ from the system's.

Use String(localized:) for strings outside SwiftUI Text.

Long translations (German, Finnish) stress layouts.

Common mistakes

  • Hard-coded date formats.
  • Concatenating translated fragments.

Senior take & follow-ups

Seniors cover strings, formatting, plurals, layout and testing.

Follow-up questions

Think of your answer first, then open the hint.

  1. Why not concatenate?

    Show hint

    Word order differs by language.

  2. How do you test layout without translations?

    Show hint

    Double-length and right-to-left pseudolanguages.

Suggest a fix if something here is wrong or out of date.