aufree / hodor Goto Github PK
View Code? Open in Web Editor NEWSimple solution to localize your iOS App.
License: MIT License
Simple solution to localize your iOS App.
License: MIT License
我的页面包含了侧滑抽屉,如果我多个页面都使用了国际化,难道得再切换后发个通知全部刷新一下UI么,这样是不是太复杂了。或者你有没有更好的办法
Hi, this is not an issue as I was able to edit your project and added new ViewController which worked well. However, after copying the Language.m(.h) files into my project and using kLang(), I am not able to load Chinese Strings (no text shows up if I select Chinese) and English shows when I select English though I have set them up in the Localisable.string for Simplified Chinese. I need help with this. Any pointers will be highly appreciated. Thanks
你好, 我觉得系统语言的获取不应该使用[[NSBundle mainBundle] preferredLocalizations],
而应该取[NSLocale preferredLanguages]中第0个, 再判断, 我只想到了用这种不严谨的判断方法:
NSString *firstLanguage = [NSLocale preferredLanguages].firstObject;
if ([firstLanguage hasPrefix:@"en"]) {
return 英语;
}
if ([firstLanguage hasPrefix:@"zh-Hans"] || //简体
[firstLanguage hasPrefix:@"yue-Hans"] //粤语简体
) {
return 中文简体;
}
if ([firstLanguage hasPrefix:@"zh-Hant"] || //繁体
[firstLanguage hasPrefix:@"zh-TW"] || //**
[firstLanguage hasPrefix:@"zh-HK"] || //香港
[firstLanguage hasPrefix:@"yue-Hant"] //粤语繁体
) {
return 中文繁体;
}
if ([firstLanguage hasPrefix:@"ja"]) {
return 日语;
}
if ([firstLanguage hasPrefix:@"ko"]) {
return 韩语;
}
return 其他;
使用系统的方法我们可以使用genstrings配合完成国际化的工作,使用宏重定义后该工具就不能使用了。对于这块的优化作者有没有啥想法或者实践啊?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.