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

Wordpress theme doesn't read my translations from pt_BR.po file

programmeradmin3浏览0评论

I used PoEdit to create my .pot file. Added some translations, then created a .po file alongside with automatically created .mo file.

My .po file looks like this:

msgid ""
msgstr ""
"Project-Id-Version: xxx\n"
"POT-Creation-Date: 2020-04-16 15:45+0200\n"
"PO-Revision-Date: 2020-04-17 12:28+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Poedit-KeywordsList: _e;__\n"
"X-Poedit-SearchPath-0: .\n"

#: 404.php:7
msgid "Nie znaleziono strony."
msgstr "Página não encontrada."

Following all of the tutorials, I added these two files to wp-content/themes/mytheme/languages and also changed wp-config file by adding this line:

define( 'WPLANG', 'pt_BR' );

Not really sure why this doesn't work. My site still displays its original version of these strings. Has anyone had a problem like this? Or maybe I omitted some steps. I'm using Wordpress 5.4

I used PoEdit to create my .pot file. Added some translations, then created a .po file alongside with automatically created .mo file.

My .po file looks like this:

msgid ""
msgstr ""
"Project-Id-Version: xxx\n"
"POT-Creation-Date: 2020-04-16 15:45+0200\n"
"PO-Revision-Date: 2020-04-17 12:28+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Poedit-KeywordsList: _e;__\n"
"X-Poedit-SearchPath-0: .\n"

#: 404.php:7
msgid "Nie znaleziono strony."
msgstr "Página não encontrada."

Following all of the tutorials, I added these two files to wp-content/themes/mytheme/languages and also changed wp-config file by adding this line:

define( 'WPLANG', 'pt_BR' );

Not really sure why this doesn't work. My site still displays its original version of these strings. Has anyone had a problem like this? Or maybe I omitted some steps. I'm using Wordpress 5.4

Share Improve this question asked Apr 17, 2020 at 12:21 OlgaOlga 11 bronze badge 3
  • Did you also set your Site Language in Settings/General? – Jos Commented Apr 17, 2020 at 14:15
  • Oh, I didn't know it was necessary. So there's no other way to have an admin dashboard in one language and use translations for website in another? Either way, thanks, that solves partly my problem! – Olga Commented Apr 17, 2020 at 14:30
  • I don't know if that is possible. Perhaps you should post that as another question on this site. – Jos Commented Apr 17, 2020 at 14:39
Add a comment  | 

1 Answer 1

Reset to default 0

Try copying the files to wp-content/languages/themes/[theme name]-pt_BR.mo and .po.

发布评论

评论列表(0)

  1. 暂无评论