简体   繁体   English

WordPress翻译问题

[英]WordPress translation issues

I've been working with WP for quite a while now however I was never required to use translations for it - until yesterday happened. 我已经使用WP已有一段时间了,但是直到昨天才发生,我从来没有被要求使用翻译。

I'm currently using the Plugin 'Theme My Login' to build a frontend interface for subscribers, which is supposed to be completely German. 我目前正在使用“主题我的登录名”插件为订户构建前端界面,该界面应该是完全德语的。 However, for some odd reason, about half of the error messages thrown are English and the other fifty percent are German. 但是,由于某些奇怪的原因,抛出的错误消息中约有一半是英语,其余百分之五十是德语。 For example, after logging out of WordPress, the message telling you to 'log in to access this page' is german, while the login error messages (eg wrong password, non-existent user etc.) are english. 例如,注销WordPress后,告诉您“登录以访问此页面”的消息为德语,而登录错误消息(例如,错误的密码,不存在的用户等)为英语。

I've tried editing the standard WordPress language file de_DE to match my requirements as well as editing the language file that comes with the plugin, however none of the changes I make seem to have any effect on the actually displayed errors. 我曾尝试编辑标准的WordPress语言文件de_DE以符合我的要求以及编辑该插件随附的语言文件,但是我所做的任何更改似乎都不会对实际显示的错误产生任何影响。

Could anyone of you imagine what mistake I keep making here? 你们中谁能想象我在这里犯了什么错误?

Try telling WordPress where exactly to look for the language file. 尝试告诉WordPress在何处寻找语言文件。 For example, the following assumes the .mo file is located at wp-content/languages/theme-my-login-de_DE.mo 例如,以下假定.mo文件位于wp-content / languages / theme-my-login-de_DE.mo

if ( file_exists( WP_LANG_DIR . '/theme-my-login-de_DE.mo' ) )
    load_textdomain( 'theme-my-login', WP_LANG_DIR . '/theme-my-login-de_DE.mo' );

Upload translated files in to: 将翻译后的文件上传到:

/httpdocs/wp-content/plugins/theme-my-login/language

Example: 例:

theme-my-login-tr_TR.mo
theme-my-login-tr_TR.po

delete .pot file and you should be good to go 删除.pot文件,您应该一切顺利

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM