Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 16:00 9:00 – 16:00 9:00 – 16:00 9:00 – 16:00 9:00 – 16:00 -
- 17:00 – 18:00 17:00 – 18:00 17:00 – 18:00 17:00 – 18:00 17:00 – 18:00 -

Supporter timezone: Africa/Cairo (GMT+02:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Ahmed Mohammed 1 year, 11 months ago.

Assisted by: Ahmed Mohammed.

Author Posts
December 20, 2022 at 7:50 pm

Sebastien

I am trying to:
Show the translations of strings I have translated using the WPML String translation plugin.

Link to a page where the issue can be seen:
The orange button "Send"
hidden link

I expected to see:
"Envoyer"

Instead, I got:
"Send"

It should be "Envoyer" in french as translated inside the strings translations plugin (see screenshot).

I was able to see the translation for a moment, while I was in the "Auto-register strings for translation", but when I disable it, the translations are not showing up in the front-end. It has the same effect if I am either in logged-in or not.

There is no cache on this env, the files permissions are fine. But I don't understand why my language files doesn't change when I add translations 🤔 Maybe this might be a lead.

There is only the "REST enabled" that is not ok on my side, but it might be a false positive since hidden link works.

The error_log has no issues since I made some changes, so there is no more meaningful information there.

Screen Shot 2022-12-20 at 2.32.23 PM.png
December 21, 2022 at 12:09 pm #12692059

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for contacting WPML support!

I understand that you're trying to translate the Send button text on this page hidden link.

I tried to log in to the website, but I'm being redirected to the login page as shown in this screencast: hidden link.

By looking at the debug information, it looks like you're using Formidable Forms on your website. If that form was created using the Formidable Forms plugin, then you'll need to install the Formidable Multilingual plugin and follow the documentation here: https://wpml.org/documentation/plugins-compatibility/how-to-translate-formidable-forms-with-wpml/#translating-formidable-forms-and-form-pages.

If the form wasn't created using Formidable Forms, please check the log in issue, and I will be happy to log in and take a look.

Looking forward to hearing back from you.

December 22, 2022 at 3:39 pm #12702233

Sebastien

Hi there,

I tried to login and it worked 🙁 . Can you try in Incognito mode ? If it doesn't work on the first try, try again when the page blinks after your attempt. If it still doesn't work, go in the address bar and hit Enter instead of refresh and try again.

For this very form, we are not using Formidable Forms for this, it's hardcoded in

site/wp-content/themes/source/sidebar-submit-cv-form.php

on line 115 like this:

<?php _e('Send', 'empc'); ?>
December 22, 2022 at 5:02 pm #12702541

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Sebastien,

I was able to log in using Safari 🙂

I scanned the custom theme by going to WPML → Theme and plugins localization and I re-translated the string, but it didn't work.

So I changed

_e('Send', 'empc');

to

$my_current_lang = apply_filters( 'wpml_current_language', NULL );


			 if ($my_current_lang == 'en')
			 {
			 _e('Send', 'empc');
			 }
			 else 
			 { _e('Envoyer', 'empc');
		}

and it did the trick on the French translation. While custom programming work is beyond the scope of our support, I thought this can be an exception as it was a quick thing to do.

If any further help needed with the custom theme, I would suggest you consider contacting one of our certified partners from this link: http://wpml.org/documentation/support/wpml-contractors/

You will get the custom assistance you need to get on with your project.

Regards,

December 22, 2022 at 6:29 pm #12702959

Sebastien

I am a programmer myself and I know this could be a solution, but we have like 100 strings to translate and we might have 2 more languages in the future. Having to hardcode all of this for each strings we want to translate is far from an ideal solution. The String translation plugin is supposed to handle this to avoid this specific case.

If I code the strings like you told me, it's almost like I am bypassing the whole plugin to end up with more legacy code and make it harder to translate my website in the long run.

The issue is with the plugin or its configuration in the admin, not the way we wrote the code to translate the string.

The "Send" string was just an exemple, this is not the only string that I have a problem with. So the quick-fix using apply_filters() won't do.

Please read my original post for infos like:

"I was able to see the translation for a moment, while I was in the "Auto-register strings for translation", but when I disable it, the translations are not showing up in the front-end. It has the same effect if I am either in logged-in or not."

I appreciate your effort.

December 23, 2022 at 11:29 am #12706221

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

I totally understand your concerns here, but our hands are limited when the issues happen with custom-made themes.

With that said, you mentioned this is happening with other strings too. Could you please provide me with more examples? Maybe by checking many examples, I can find something related causing this issue.

Looking forward to hearing back from you.

The topic ‘[Closed] Translated strings won't display in frontend if I stop using autoregister string’ is closed to new replies.