开发者

localization with core data

Does anyone have any recommendations with localization of core data? My application will have information that will sometimes be the same in both langauges, such as a person's photo, or different such as the person's biography.

From what I understand, it's possible to localize the field names, but what开发者_StackOverflow社区's the best course of action for field values?


If you want to localize string values, you should create an entity named something like LocalizableText with attributes locale and localizedText. Instead of using NSStrings for your attributes, you will instead have a relationship to LocalizableText.

So your Person entity would have a relationship named biography to entity LocalizableText. It would also have a read-only property for localizedBiography which would check for the appropriate localizedText to return based on the current locale of your user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜