假设您要将用户偏好的语言环境存储在数据库中,您将使用哪个值?
Assume you want to store the locale of user preference in database, which value you will use?
en_US 或 en-US
en_US or en-US
它们是两个标准,但您更喜欢将哪一个用作您自己的应用程序的一部分?
They are two standards, but which one you prefer to use as part of your own application?
更新:似乎很多网站都使用破折号而不是下划线,例如
Updated: Is seems many web sites use dash instead of underscore, e.g.
http://zh.wikipedia.org/zh-twhttp://www.google.com.hk/search?hl=zh-TW
我很确定-"是标准.如果您看到_"在某个地方,它可能是某些人想出的让它成为有效标识符的东西.
I'm pretty sure "-" is the standard. If you see "_" somewhere it's probably something some people came up with to make it a valid identifier.
为了正确起见,我个人会选择-".
Personally I'd go with "-", just to be correct.
http://en.wikipedia.org/wiki/IETF_language_tag
https://datatracker.ietf.org/doc/html/rfc5646
这篇关于en_US 或 en-US,您应该使用哪一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!