本地化 string

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];

}

posted @ 2015-04-07 12:21  Mareon  阅读(136)  评论(0编辑  收藏  举报