NewFile -> iOS -> Resource -> Strings File
命名为 Localizable.strings
self.title = NSLocalizedString(@"Local Video", nil);//NSLocalizedString这个是Foundation框架下NSBundle中定义的一个宏
Localizable.string(Chinese(Simplified))文件中代码如下:
/*
Localizable.strings
Eleven
Created by coderyi on 15/8/18.
Copyright (c) 2015年 coderyi. All rights reserved.
*/
"Eleven Video"="十一 视频播放器";
"Local Video"="本地视频";
"Network Video"="网络视频";
"More"="更多";
"a simple powerful video player"="一个简单强大的播放器";
"wifi transfer"="wifi传输文件";
"play"="播放";
"clear"="清空";
"rorate"="旋转";
"You can transfer video files via itunes or wifi\nSupport m4v, wmv, 3gp, mp4, mov, avi, mkv, mpeg, mpg, flv, vob format"="可以通过itunes或者wifi传输视频文件\n支持m4v,wmv,3gp,mp4,mov,avi,mkv,mpeg,mpg,flv,vob等格式";
"Open button, and then enter the address in the browser address bar\nClose button Remember when the transfer is complete"="打开下面的按钮,在浏览器地址栏输入即将出现的地址\n传输完成记得关闭按钮";
"Enter any HTTP, RTSP, RTMP, RTP address play network streaming or live"="输入任何HTTP,RTSP,RTMP,RTP地址播放网络流媒体或直播";
"OK"="确定";
———————————————————————————————————————————————————————————————————————Localizable.strings(English) 文件中代码如下:/*
Localizable.strings
Eleven
Created by coderyi on 15/8/18.
Copyright (c) 2015年 coderyi. All rights reserved.
*/
"Eleven Video"="Eleven Video";
"Local Video"="Local Video";
"Network Video"="Network Video";
"More"="More";
"a simple powerful video player"="a simple powerful video player";
"wifi transfer"="wifi transfer";
"play"="play";
"clear"="clear";
"rorate"="rorate";
"You can transfer video files via itunes or wifi\nSupport m4v, wmv, 3gp, mp4, mov, avi, mkv, mpeg, mpg, flv, vob format"="You can transfer video files via itunes or wifi\nSupport m4v, wmv, 3gp, mp4, mov, avi, mkv, mpeg, mpg, flv, vob format";
"Open button, and then enter the address in the browser address bar\nClose button Remember when the transfer is complete"="Open button, and then enter the address in the browser address bar\nClose button Remember when the transfer is complete";
"Enter any HTTP, RTSP, RTMP, RTP address play network streaming or live"="Enter any HTTP, RTSP, RTMP, RTP address play network streaming or live";
"OK"="OK";
本文介绍了一个iOS应用如何实现多语言支持的过程,通过使用Localizable.strings文件进行资源字符串管理,并提供了中英文对照的具体示例。
1216

被折叠的 条评论
为什么被折叠?



