We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(9)
对上述解决方案添加了一些修改:
Added few modification to above solutions:
这并不能真正回答您的问题,但您可以考虑在未来的 iOS+Android 项目中使用 DMLocalizedString。目前源代码仅适用于 iOS,但我相信制作 Android 版本非常容易。
This don't really answer your question, but you may consider DMLocalizedString for your future iOS+Android project. Currently the source is for iOS only, but I believe that making the Android version is pretty easy.
要转换为 Android,请使用我的正则表达式代码。您可以在线测试(复制替换字符串):
http://www.phpliveregex.com/p/6dA
使用的正则表达式是$2
^"(.*)"\s=\s"(.*)";$/m
,替换字符串是要转换为 iOS,请使用我的正则表达式代码(复制替换字符串):
http://www.phpliveregex.com/p/6dC
使用的正则表达式是
^\(.*)\<\/string\>/m
,替换字符串为"$1" = "$2";
For converting to Android, use my regex code. You can test it online (copy the replacement string):
http://www.phpliveregex.com/p/6dA
regex used is
^"(.*)"\s=\s"(.*)";$/m
, replacement string is<string name="$1">$2</string>
For converting to iOS, use my regex code (copy the replacement string):
http://www.phpliveregex.com/p/6dC
regex used is
^\<string name=\"(.*)\"\>(.*)\<\/string\>/m
, replacement string is"$1" = "$2";
基于网络的在线转换器(双向):
https://gunhansancar.com/tools/converter/
Web based online converter (both ways):
https://gunhansancar.com/tools/converter/
我想您可能会喜欢这个工具:
http://members.home.nl/bas.de。 reuver/files/stringsconvert.html
也是这个,但它缺少一些功能(例如转换名称中的空格):
http://localise.biz/free/converter/ios-to-android
它是免费的,无需注册,并且您不需要构建自己的脚本!
I think you might like this tool :
http://members.home.nl/bas.de.reuver/files/stringsconvert.html
Also this one, but it lacks some features (like converting whitespace in name) :
http://localise.biz/free/converter/ios-to-android
It is free, no need of registration, and you won't need to build your own script!
这是 Unix 思维方式和工具集派上用场的领域之一。我不知道 iPhone 格式是什么样的,但如果是你所说的那样,每行每个值一个,一个简单的 sed 调用就可以做到这一点:
我希望 sed 在你的 OSX 安装上可用。
This is one of the areas where the Unix mindset and toolset comes in handy. I don't know what the iPhone format is like, but if it's what you say, with each value one per line, a simple
sed
call could do this:I expect sed is available on your OSX install.
好吧,我使用 alex 的代码中的一些代码编写了自己的小转换器。
让 Java 正确读取和写入我从 xcode 项目中获得的 UTF 16 输入有点棘手,但现在它工作得非常顺利。
Ok i wrote my own little converter using a little bit from the code from alex.
It was a little bit tricky to get Java to correctly read and write the UTF 16 input I got out of the xcode project but now it is working like a charm.
我改进了上面的主要方法来为我工作:
I improved your main method above to work for me:
我用来转换 Java 属性文件的“工具”:
The "tool" I've used to convert a Java properties file: