Comment field labels: some translations not working

HI,

I made some translations using the instructions here https://theme.co/docs/theme-translations
and it was fine, but now some labels are again in English under posts. https://eftmaailm.ee/miks-teraapiat-vaja-on/

I re-uploaded and checked the et.po and et.mo files but the problem stays.

For example label “Comment” is translated into Estonian “Kommentaar” but still shows in English.
Same thing with Share icons Alt texts - ‘Share on Facebook’ is translated but stays in English.

How can I fix this?

Thanks in advance,
Eva

Hi Eva,

Thank you for writing in, please follow the solution provided by Lely here.

Add another case after the last break

 case 'Comment' :

                $translated_text = __( 'Kommentaar', '__x__' );
                break;

Hope it helps,
Cheers!

Hi,

Unfortunately this didn’t work. The labels stay exactly the same.
Also - adding this code canceled some other changes I had previously made to the texts around Comment form.

Eva

Hello Eva,

Your language translation filename is incorrect. Please resave the x.pot file and save it as:

__x__-et.po
__x__-et.mo

The key word should be in the translation. It is not working because of the incorrect filename.

We would love to know if this has worked for you. Thank you.

Hi again,

I started the translation from the scratch - re-downloaded x.pot file and made a few translations, to the comment field labels mainly. Then uploaded the .po and .mo files with names given by you.

Now it looks like on the screenshot in wp folder.

But this didn’t help either.
I left the functions.php as it was.

Regards,
Eva

Hello Eva,

Please move your translation files to wp-content/languages/themes/.

Hope this helps. Please let us know how it goes.

HI,

That fixed most of the translations, thank you for the help :slight_smile:

  1. Still - the alt texts on social sharing icons below each post: Share on facebook, Share on Pinterest etc. stayed in English. There are translations for all these texts in the .po file. How can I fix this?

  2. Now that the translation files are in parent theme folder, when there will be an update to the theme, do I have to upload the files again after update?

Regards,
Eva

Hey Eva,

  1. Those strings come from Cornerstone and it has a different text domain. Specifically, it’s cornerstone. You need to translate Cornerstone separately. That means you’ll need to translate and upload another set of .po and .mo. You can find the pot file in cornerstone/lang

  2. It could get overwritten. Is there a problem uploading to wp-content/languages/themes/ as Ruenel instructed? That way, your language files won’t get overwritten.

Thanks.

Hi Christian,

  1. I have created new set of .po and .mo files from cornerstone.pot. and uploaded it to cornerstone/lang
    Is that the right folder? The alt texts for icons stayed in English. So where should i upload these files?

  2. I did upload my main et.po and et.mo files to wp-content/languages/themes/ - so that’s ok, no overwriting on update, as I understand.

Thanks again,
Eva

Hello Eva,

Thanks for updating in!

1.) Please make sure that your translation files in added in wp-content/languages/plugins/ and it must be named as cornerstone-et.poand cornerstone-et.mo.

2.) The theme translation file is in the correct folder. Just renamed it to __x__-et.po and __x__-et.mo

Hope this helps.

Hi Ruenel,

That fixed it! Thank you so much for your help :slight_smile:
You have the greatest support service.

Warm regards,
Eva

Glad everything is working now, Eva.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.