Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下问题:
我有一个 NSLocale 对象,并且想要访问此语言环境的 .lproj 目录中的资源。为此,我需要提供语言环境的全名,例如“德语”。我找不到从 NSLocale 对象中获取此字符串的方法。
我该如何做到这一点?
没关系:
NSLocale *locale = [[[NSLocale alloc] initWithLocaleIdentifier:language] autorelease]; [locale displayNameForKey:NSLocaleIdentifier value:language]);