iOS 语言国际化配置
2024-09-04 12:26:12
所谓的iOS 国际化,就是根据系统不同的语言自动切换。
首先,如图:
创建一个.strings文件,以“Localizable.strings”为文件名:
创建完之后,在XCode的右边勾选自己需要的语言:
勾选完之后,在Localizable.strings的文件名左边会出现一个小箭头,打开能看到两个文件(勾选的两个):
在文件Localizable.strings(English)写
"key" = "Go"
在文件Localizable.strings(Simplifued)写
"key" = "开始"
使用方法:
NSString *str = NSLocalizedString(@"key", nil);
最新文章
- Codeforces CF#628 Education 8 C. Bear and String Distance
- unity3d CarWaypoints插件
- Android Studio 有用的插件
- C#获取CPUID(MD5输出),网卡ID,主DNS,备用DNS
- System.Web.HttpContext.Current 跟踪分析
- FastDfs点滴
- 5A的肖特基二极管 SK5x / SK5xx
- 跨站脚本攻击(XSS)
- Oracle 关于事物的描述
- web页面布局思想
- 【转】ConcurrentModificationException异常解决办法 --不错
- 0122——UITabBarController
- 分离你的spring配置文件,让结构更清晰
- [译]ASP.NET Core 2.0 视图组件
- armlinux下的网路传输(tcp/ip)
- Python类元编程初探
- selenium常用的API
- 简单易懂的程序语言入门小册子(5):基于文本替换的解释器,递归,不动点,fix表达式,letrec表达式
- 磁性窗体设计C#(二)
- 微信小程序开发工具 ubuntu linux版本
热门文章
- What's the difference between @Component, @Repository &; @Service annotations in Spring?
- final关键字介绍
- initBinder转换日期格式
- 重构指南 - 使用多态代替条件判断(Replace conditional with Polymorphism)
- Linux 套接字编程 - TCP连接基础
- Scrapy框架之代理和cookie
- 检测IE浏览器兼容Edge模式及IE11
- FragmentActivity的简单使用
- centos7部署ethereum私有链
- Orchard Core 文档翻译 (五)自动路由 Autoroute (OrchardCore.Autoroute)