首页 > 其他 > 详细

本地化 string

时间:2015-04-07 13:27:44      阅读:87      评论:0      收藏:0      [点我收藏+]

static const char* getLocalizedText(const char* pKey, const char* pTableName = NULL);

 

const char* SystemHelper::getLocalizedText(const char *pKey, const char* pTableName)

{

    NSString* key = [NSString stringWithUTF8String:pKey];

    

    NSString* table = pTableName ? [NSString stringWithUTF8String:pTableName] : nil;

    

//    NSString* pString = [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil];

    NSString* result = NSLocalizedStringFromTable (key, table, nil);

                          

    return result ? [result UTF8String] : NULL;

    

//    return [pString UTF8String];

}

本地化 string

原文:http://www.cnblogs.com/niwococo/p/4397955.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!