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

plugins - One file for all translations

programmeradmin4浏览0评论

Is there any solution to translate just specific strings from plugins/theme from one central file? So the only translated strings are there (frontend) so editor of the website doesn't need to search trough all .MO files in Loco translate for example?

Is there any solution to translate just specific strings from plugins/theme from one central file? So the only translated strings are there (frontend) so editor of the website doesn't need to search trough all .MO files in Loco translate for example?

Share Improve this question edited Apr 15, 2020 at 21:39 Tom J Nowell 61.1k7 gold badges79 silver badges148 bronze badges asked Apr 15, 2020 at 21:19 KarnakKarnak 1171 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

No, this isn't possible, that's not how mo or po files work.

A po file declares which locale it is for, and gets compiled into an mo file. You can't store more than 1 locale in the same file. Each file represents a single locale.

Keep in mind that these files aren't a WordPress thing. They're a gettext thing, and are used in lots of different applications, including other CMS's and even programs that have nothing to do with websites and servers.

So there is no WordPress based solution to your problem. Your search should continue elsewhere, specifically in the area of tooling

发布评论

评论列表(0)

  1. 暂无评论