如何启用WPML翻译我的内容小部件?

发布于 2025-01-30 18:57:34 字数 277 浏览 4 评论 0原文

我正在开发WordPress插件,并想知道如何使用WPML从插件数据库表中翻译文本。

这是我希望WPML转换为多种语言的代码的示例:

 echo esc_html_e('Contact with','my-plugin') ." ". esc_attr($name);

 *$name it's called from my plugin table in WordPress Database*

如何将“与WPML的多种语言支持”翻译为“与”和$ name?

I'm developing a WordPress plugin and would like to know how I may translate a text from the plugin's database table using WPML.

Here's a sample of the code I want WPML to translate into multiple languages:

 echo esc_html_e('Contact with','my-plugin') ." ". esc_attr($name);

 *$name it's called from my plugin table in WordPress Database*

How do I translate "Contact with" and $name with WPML's multiple language support?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

水波映月 2025-02-06 18:57:34

您将需要使用 string translation 用于每个字符串的翻译。如果您一开始看不到字符串,则需要首先找到字符串

有关更多详细信息,请查看 https://wpml.org.org/documentation/getting/getting/getting/getting/getting/getting of - 启动的指南/翻译 - 网络

You will need to use String translation for the translation of each string. If you don't see a string at first you will need to find the strings first.

For more details take a look at https://wpml.org/documentation/getting-started-guide/translating-widgets

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