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