1

I want to add a string to a pot document for language, but it says there’s an error. I have opened file .pot with a text editor and I have add this code

#:D:\Programe\InstantWP\InstantWP_4.3.1\iwpserver\htdocs\wordpress\wp-
content\themes\sydney-child/category-38.php:56
msgid “”
“Read more”
msgstr “”

while in my file I have add this one

<?php _e( ‘Read more’, ‘sydney-child’ ); ?>

Then I have downloaded file .pot and I have opened it with Poedit, I have add the translation “Read more”, but when I update it says: “Source code not available. Translations can’t be uploaded by source code because there is no source code in the path specified in catalog properties” (the message was Italian, so I hope to have well translated in English)

Can anyone help me? Thanks

1 Answer 1

0

Well, the way I work with Poedit is:

  • Open Poedit
  • Open the .pot file with Poedit
  • Define the language of the translation
  • Find the info you want to translate on the left collumn
  • Place the translation on the right collumn
  • Save the .po
  • Compile the .mo
  • Save both on the 'language' folder of the theme

Since you are trying to create a term where it doesn't exists, the second line of your first step looks incorrect.

#: theme-name.php:123 // the reference
msgid "Page Title" // the original term
msgstr "" // the translation

Reference: https://developer.wordpress.org/themes/functionality/localization/

5
  • Hi Marcelo, my problem is that I want to add the info to translate, because there wasn't in the theme originally. So I have read to open the file .pot and add that code. Isn't it right? Sep 25, 2017 at 8:45
  • Ok, my bad, I missunderstood that. In the first part of the code, seems wrong. The correct would be: msgid “Read more” . Try the documentation page link . Sep 25, 2017 at 9:08
  • I edited my question to be more clear Sep 25, 2017 at 9:12
  • Hi Marcelo, unfortunately it doesn't still work. I have installed another plugin, Loco Translate, and this way I have understood I have badly configured my child theme because it says "Unconfigured bundle. This bundle isn't set up for translation in a way we understand. It needs configuring before you can do any translations.". While modifying file po of parent theme it works. Can you tell me how I have to set up the child theme? Sep 25, 2017 at 15:29
  • You can use a plugin: wordpress.org/plugins/child-theme-configurator Or you can see the Codex: codex.wordpress.org/Child_Themes Sep 25, 2017 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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