zoukankan      html  css  js  c++  java
  • iOS 本地化-国际化-(App名字国际化)

    本地化:根据不同的语言切换不同的文字(localization)

    国际化:i18n(其他语言)

     

    格式:左边是key,右边是value

    "Cancel" = "取消";

    让项目支持中文和英文

     

     取文字

    // 英文 : Cancel
    // 中文 : 取消
    
    NSString * title =[[NSBundle mainBundle] localizedStringForKey:@"Cancel" value:@"Cancel" table:@"Test"];
    //简写
    //NSLocalizedStringFromTable(@"Cancel", @"Test", @"A title on cancel button")
    [self.button setTitle:title forState:UIControlStateNormal];
    // 如果字符串文件名是空的,就会去加载Localizable.strings文件
    
    // genstrings指令的作用:自动生成strings文件 

     App软件名的本地化

    创建名为InfoPlist.string的语言包

    Base

    "CFBundleName" = "111";

    English

    "CFBundleName" = "Test";

    Chinese(Simplified)

    "CFBundleName" = "测试";

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    SharePoint Development
    win32- copyfile的使用
    SetWindowHookEx的复习
    C++ vector的使用
    关于char * 和 char [] 的一点理解
    CreateThread
    C++字符串大写字母转小写字母
    字符串逆序
    使用RegSetValueEx创建键值
    EnumColorProfiles WcsGetDefaultColorProfile WcsSetDefaultColorProfile的使用
  • 原文地址:https://www.cnblogs.com/StevenHuSir/p/10132371.html
Copyright © 2011-2022 走看看