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

  • Did you also set your Site Language in Settings/General? – Jos Apr 17 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 Apr 17 at 14:30
  • I don't know if that is possible. Perhaps you should post that as another question on this site. – Jos Apr 17 at 14:39
0

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

| improve this answer | |
  • To clarify - I added subdirectory named 'themes/mythemename' to wp-content/languages and there I pasted these two files named: mythemename-pt_BR.po and mythemename-pt_BR.mo. Still nothing – Olga Apr 17 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.