以不同语言显示网页的最佳实践

发布于 2024-09-17 00:51:57 字数 286 浏览 3 评论 0原文

我想部署一个不同语言(德语和英语)的网页。作为后端解决方案,我将使用在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白鸥掠海 2024-09-24 00:51:58

您可以使用插件“WPML”。很确定这会做你想做的事。

You can use the plugin "WPML". Pretty sure that will do what you want.

原谅过去的我 2024-09-24 00:51:58

@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文