最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

actions - Translate are not working for standard admin

programmeradmin1浏览0评论

I'm developing a plugin which uses strings of the "default" textdomain, but several strings will not shown translated.

My locale language is "de_DE" (german). I try to access the word "Count", which is available inside the "admin-de_DE.po" file. (To make sure, the loaded .mo file is actual, I compiled it with Poedit and Loco for debugging.) Other strings of that file will be shown translated, for example "[Pending]" as "[Ausstehend]", but not "Count" as "Anzahl".

What is my mistake?

add_action( 'admin_init', 'action_admin_init' );
function action_admin_init() {
  _e( 'Count' );
}

I'm developing a plugin which uses strings of the "default" textdomain, but several strings will not shown translated.

My locale language is "de_DE" (german). I try to access the word "Count", which is available inside the "admin-de_DE.po" file. (To make sure, the loaded .mo file is actual, I compiled it with Poedit and Loco for debugging.) Other strings of that file will be shown translated, for example "[Pending]" as "[Ausstehend]", but not "Count" as "Anzahl".

What is my mistake?

add_action( 'admin_init', 'action_admin_init' );
function action_admin_init() {
  _e( 'Count' );
}
Share Improve this question asked Jul 16, 2019 at 8:29 TahtuTahtu 1173 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The only instance of "Count" I can see in the default domain's admin file has a context value of "Number/count of items". So your code should be:

add_action( 'admin_init', 'action_admin_init' );
function action_admin_init() {
  _ex( 'Count', 'Number/count of items' );
}

Ref: _ex.

发布评论

评论列表(0)

  1. 暂无评论