admin管理员组文章数量:1122832
I'm creating a new plugin actually, the plugin is working perfectly, but it's not available yet in the wordpress website, I have an issue with the translation, I will not use wordpress for the translation, it's a local translation, so I generated the PO and MO files using POedit, and I followed all the steps here : / from writing a perfect header in the main plugin file till adding php code in the same file in order to load text domain and the MO file, When I change the wordpress language from English to French, the plugin still with EN language,
What can be the issue ? is it because the plugin is not on the wordpress yet ?
Here's my laptop config :
- locahost : wampserver
- Windows 10
- Php version : 8.1
Thanks !!
I'm creating a new plugin actually, the plugin is working perfectly, but it's not available yet in the wordpress.org website, I have an issue with the translation, I will not use wordpress.org for the translation, it's a local translation, so I generated the PO and MO files using POedit, and I followed all the steps here : https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/ from writing a perfect header in the main plugin file till adding php code in the same file in order to load text domain and the MO file, When I change the wordpress language from English to French, the plugin still with EN language,
What can be the issue ? is it because the plugin is not on the wordpress.org yet ?
Here's my laptop config :
- locahost : wampserver
- Windows 10
- Php version : 8.1
Thanks !!
Share Improve this question edited May 28, 2024 at 17:57 Sam94 asked May 27, 2024 at 14:34 Sam94Sam94 151 silver badge5 bronze badges1 Answer
Reset to default 1Here's the solution : I'm talking about my case here, When I added the Text Domain Name to Gettext functions in interface.php
file, I used this command line : php add-textdomain.php TextDomainNameOfThePlugin PathToInterfaceFile/interface.php > tdn.php
, So I generated tdn.php
as you can see in that command line, and constructed my POT, PO and MO files based on this UNUSED NEW FILE, and I forgot to either rename tdn.php
to interface.php
(and delete the old interface.php
) so I can use it, or to copy its content and paste in into interface.php
file that didn't contain Text Domain Name in its Gettext functions.
So now, I just copied tdn.php
content to interface.php
, and the translation works perfectly.
本文标签: WordPress Plugin translation not working EN To FR
版权声明:本文标题:WordPress Plugin translation not working EN To FR 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736305407a1932579.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论