以不同语言显示网页的最佳实践
我想部署一个不同语言(德语和英语)的网页。作为后端解决方案,我将使用在 Linux 上的 nginx/PHP/MySQL 堆栈上运行的 Wordpress。
从这里的各种帖子中,我认为查看浏览器区域设置(HTTP 请求中的 ACCEPT-LANGUAGE 字段)是设置正确语言的良好初次尝试。当然,用户可以覆盖此设置,并且此选择将存储在 cookie 中。
所以我的问题是:
如何在 WordPress 中实现这一点?是否必须为每种语言部署两个单独的 WordPress 安装,或者是否有一些我尚未找到的插件。
I would like to deploy a webpage in different languages (German and English). As a backend solution I would use Wordpress running on a nginx/PHP/MySQL stack on Linux.
From various posts here I think that looking at the browser locale (the ACCEPT-LANGUAGE
field in HTTP request) is a good first try for setting the correct language. Of course the user will be able to override this and this choice will be stored in a cookie.
So my questions is:
How would one implement that in wordpress? Would one have to deploy two separate wordpress installations one for each language or is there some plugin for it which I have not found yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用插件“WPML”。很确定这会做你想做的事。
You can use the plugin "WPML". Pretty sure that will do what you want.
@GorillaPatch,
请参阅WordPress 答案中的此问题了解如何添加语言支持使用 .mo 和 .po 文件添加到您的 WordPress 主题。
@GorillaPatch,
See this question on WordPress Answers on how to add language support to your WordPress theme using the .mo and .po files.