2

Can I pass an argument to NSLocalizedString to override the localized string and tell it what language to use so that the user can choose a language from a Settings menu?

How so?

Moshe
  • 57,511
  • 78
  • 272
  • 425

1 Answers1

2

We’ve done something similar, but the answer was to not use NSLocalizedString. Instead, since you know what language the user has selected, you just load the text for that language. You can store it in property lists, using Core Data or SQLite, etc.

Jeff Kelley
  • 19,021
  • 6
  • 70
  • 80
  • So you made your own method to return a language string? – Moshe Dec 07 '10 at 18:29
  • 1
    What we did, actually, was to make separate Core Data entities for each language (it was easier to do it that way because that’s how it came out of our CMS). Then, we added the user-selected language to the predicate when searching for the entity (which has a `language` property), and used properties like `title` on the entity to get to the text. – Jeff Kelley Dec 07 '10 at 18:44