String Constant as a Localized String

前端 未结 6 2040
深忆病人
深忆病人 2021-02-13 18:14

I would like to localize my constants. Constants are defined and declared the usual way:

extern NSString * const kStringName;

NSString * const kStringName = @\"         


        
6条回答
  •  天涯浪人
    2021-02-13 18:34

    Not exactly constant, but also useful

    //in the beginning of source file
    static NSString*  CommentsTitleString;
    
    @implementation ClassName
    
    +(void)initialize
    {
        CommentsTitleString =  NSLocalizedString(@"PLAYER_comments", nil);
    }
    
    @end
    

提交回复
热议问题