Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a theme which loads .po and .mo files to display strings in English. I want to have only one language (Polish), but those two files are en_US. I tried replacing content in the en_US.po file but nothing changed on the website, I do not know why. Where does it store strings if changing .po files changes nothing?

share|improve this question
2  
Take a look at Translating Wordpress to get to know what you're dealing with. Besides that, you probably haven't generated the corresponding mo-file. Additionally you really shouldn't use the english translation file for the polish translation. –  ialocin Mar 25 at 14:41
2  
To further your reading, I did an answer a while ago. Go check it out wordpress.stackexchange.com/a/137727/31545 –  Pieter Goosen Mar 25 at 15:38

2 Answers 2

up vote 2 down vote accepted

There are already an en_US.po file in the theme you are using. You can simply make a copy of that file and rename it as pl_PL.po. You can now open the pl_PL.po template with poedit, do all your translations in there, and just save it. Poedit will automatically create a pl_PL.mo template.

No need to go through all the pt. Just remember, as previously stated, change the language in the wp-config.php to pl_PL

share|improve this answer
    
Thank you very much :). –  Pe-Ter Mar 26 at 10:16
    
My pleasure. Glad I could be of help –  Pieter Goosen Mar 26 at 10:20
    
yeeah we try to make good answers that's why I wrote all the steps... –  JMau Mar 26 at 12:24

Hi to translate your website you can do the following:

  1. Define your language in wp-config.php : define('WPLANG', 'pl_PL');
  2. Then generate a po file for your theme with e.g this service: iCanLocalize Scanner
  3. Then your po and mo files should be named pl_PL.po and pl_PL.mo and put into a folder called languages or lang or something like this in your theme.
  4. if not, create a folder for languages and then use load_theme_textdomain (or load_child_theme_textdomain if it's a child theme)
  5. If there's already a language folder with po and mo files just put your new files in the same folder.

With this you should be able to easily translate your site.

EDIT: if there's a pot file in your theme folder use it directly to generate po and mo files.

share|improve this answer
    
Thank you, all this information really helps me. –  Pe-Ter Mar 26 at 10:17
    
Just in case if you are looking for the "languages" directory for the theme, it works for me when I put the corresponding language .po and .mo into where default.po and default.mo are located. –  TimothyC Dec 5 at 8:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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