开发者

Add language string wordpress

开发者 https://www.devze.com 2023-03-03 01:37 出处:网络
I use the _e(\'Read more\') function in Wordpress. But how can I add a translation string? Like if I want _e(\'Read more\') -> translated to dutch = \'Lees dit artikel verder\'.

I use the _e('Read more') function in Wordpress. But how can I add a translation string? Like if I want _e('Read more') -> translated to dutch = 'Lees dit artikel verder'.

Also how can I set the current frontend language programatically? Because I embedded wp to my site and I can check what language I'm in and set it correct开发者_运维百科.

Thanks


In short, you'll want to create a POT file of all the translatable strings, use that to create a PO file of original/translated strings, and use that to create a MO file (binary version of the PO file).

Localization is a somewhat complicated subject and is addressed in part in the official WordPress documentation: http://codex.wordpress.org/Translating_WordPress

This blog post is more straightforward in some ways, but not as comprehensive: http://www.forumone.com/blogs/post/translating-your-wordpress-site-using-pot-file

0

精彩评论

暂无评论...
验证码 换一张
取 消