如何從#define
的東西中製作NSLocalizedString
?如何從一個正在被#define的東西中創建一個NSLocalizedString?
我有什麼權利現在:
#define StationsControllerIdentifier @"Stations"
我怎麼想它是(但不工作):
#define StationsControllerIdentifier NSLocalizedString(@"Stations", @"stations menu btn")
如何從#define
的東西中製作NSLocalizedString
?如何從一個正在被#define的東西中創建一個NSLocalizedString?
我有什麼權利現在:
#define StationsControllerIdentifier @"Stations"
我怎麼想它是(但不工作):
#define StationsControllerIdentifier NSLocalizedString(@"Stations", @"stations menu btn")
有什麼不妥。您是否已將必要的Localizable.strings
文件添加到您的項目中,然後放上要本地化的字符串?
你需要添加一個文件.strings擴展,在其下方註明:
#define StationsControllerIdentifier @"Stations"
,然後使用它像
NSLocalizedString(@"Stations")
什麼不起作用? –
在xcode中使用預處理器助手來查看它如何擴展。 –