Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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.

This topic contains 45 replies, has 3 voices.

Last updated by michaelZ-21 1 day, 11 hours ago.

Assigned support staff: Alejandro.

Author Posts
November 30, 2019 at 7:24 pm #5048073

michaelZ-21

I am trying to:
use function __(); within own widget plugin.
After upgrading WPML Multilingual CMS to version 4.3.4 it does not work any more.
Original string of Source Code (ENGLISH) is shown in frontend.

Code:

$out .= "  [/av_iconlist_item]
                      [av_iconlist_item title='".__('Invoice address and payment options','obfv')."' link='' linktarget='' linkelement=''
                      ".__('Please enter address and select your payment method','obfv')."
                      [/av_iconlist_item]
                      [av_iconlist_item title='".__('Successful order','obfv')."' link='' linktarget='' linkelement='' icon='ue812' font='
                      ".__('You have finished your order','obfv')."
                      [/av_iconlist_item]
                   [/av_iconlist]";

Link to a page where the issue can be seen:
see image upload

I expected to see:
String within __(); function with own domain 'obfv' should be shown in GERMAN, as seen within WPML string translated table with state translation finished

Instead, I got:
original english string of function __();

December 2, 2019 at 2:11 pm #5054321

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hello

Could you please try upgrading one more time to the latest releases - there were some issues with the 4.3.4 release.

Please make sure to upgrade ALL the WPML plugins.

Then write back if it still is not working correctly

Thanks

December 3, 2019 at 9:19 am #5058793

michaelZ-21

Hi,

thank you for your answer.
I have upgraded to 4.3.5 (with all sub Plugins), but the error is still not solved.

Also Woocommerce Mails are not translated fully. e.g. Phone is not translated.
Within Frontent WC Shop e.g. the string "From" (Price) is not translated anymore.

Regards,
Michael

December 3, 2019 at 10:38 am #5059567

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

December 6, 2019 at 2:05 pm #5084293

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hello,
I'll take care of this ticket because Yvette is not currently available.

First of all, i suggest you follow this https://wpml.org/errata/rest-api-is-disabled-blocking-some-features-of-wpml-notice-and-performance-issues/

This will fix the "REST API" blocked issue.

Then, activate WooCommerce Multilingual, this is very important because otherwise anything related to WooCommerce Multilingual will not work. In the dev environment i noticed the verson was a bit outdated so i updated it to the latest release.

Last but not least you need to create your .MO files by going to WPML > Localize Themes and plugins > WPML hat geänderte oder neue MO-Dateien erkannt
Select everything and scan them.

Then you can return to the string in WPML > String Translation and re-translate it (add a character and save it, for example)

The only thing i'm missing here is how is that section that appears in english is added, because i believe the problem is not the string itself but the way it's added to the section.

December 8, 2019 at 9:38 am #5088599

michaelZ-21

Hi,

thank you for your answer.
I have activated Woocommerce Multilingual on the productive system too and also
did the scanning in "Localize Themes and plugins". But without success.

Within "String Translation" e.g. the "FROM" text is translated successfully,
but not shown in Frontend.

Maybe you are able to take a look into the productive system, since I cannot see
any further difference!

Note about WC-Multilingual:
I do not really need the shop area beeing in two language. I only need WC showing
in the primary languate German. Therefor I did not see the advantage of having
this plugin enabled. I has not able to see any difference.

As I mentioned, that in the older version of WPML there was no issue, therefor
I think that the translation is done and should still work after upgrade.

And the not working translation is seen in several parts of the page:
- theme ENFOLD shop overview (e.g. FROM instead of AB price prefix)
- Woocommerce E-Mails
- own Plugin, using function __()

So I still would appreciate your help!
Would you please provide me the hidden-login data input for productive system?

Thank you in advance,
Regards,
Michael

December 9, 2019 at 1:06 pm #5093021

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Ok, so here's the thing, even if you don't want it translated there are things that work under the hood that could make things incompatible without WooCommerce Multilingual but if you find that everything works as expected without it, then awesome!

Cn you tell me where can i check the code you wrote? i mean in what directory and file/line of code.

I just enabled the fields so you can add the credentials safely and privately.

December 10, 2019 at 6:28 pm #5102193

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

I'm checking the problem. this will probably take a while, but in the meantime can you update to our lates release of all of our plugins: https://wpml.org/account/downloads/

many users with similar issues told us the problem went away as soon as they updated the plugin to our latest release and also after they re-updated the translations in WPML > String Translation.

Try that and let me know how it goes. i'll try to see if i can find other possible causes for the issue.

December 12, 2019 at 5:50 am #5111895

michaelZ-21

Hi,
I have updated to the latest version of WPML (4.3.6) and all sub-plugins too.

NO Change.

Since this problem is really causing troubles, it would be great to get a solution very soon.

Thank you,
Regards,
Michael

December 12, 2019 at 5:28 pm #5117747

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Cuold you try to use _e() instead of __() in

__('Check your cart, add some products or change amount','obfv')

- then delete the string in WPML > String Translation.
- Go to WPML > localize themes and plugins
- Select and scan your plugin (the one that has this string)
- Translate it again in WPML > String translation
- Check if that solves the problem.

If that doesn't help, then i'll ask a developer to take a look at my findings to see if he can help because to be honest everything esle seems to be working correct.

I tried to do it myself many times but the changes never got saved so i couldn't test it. it's very important you delete the string and re-add it because otherwise it might not get updated at all.

Then, you mention this problem only happens on your production site, correct? does it mean that in the staging site the problem is not happening? if so, can you check if there's a difference between the 2? like maybe another plugin or a plugin/theme version to check?

December 12, 2019 at 7:56 pm #5118361

michaelZ-21

Hi Alejandro,

thank you for your answer.

the _e() does not change the text too. It only shows it earlier because of the echo.

I performed your steps and ensured, that the translation was deleted. It was.
But the issue still occures!

It is right, that at first my test system was not showing the problem.
But it started having the issue after updating
WPML Multilingual CMS 4.2.4.1 -> 4.3.5

So both systems have the problem!

Please tell me whether a ssh access would help on test system to get closer to it?

Thank you in advance!
Regards,
Michael

December 13, 2019 at 9:16 pm #5126331

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

SSH is not necessary. i have escalated this to our developers because there must be something i'm missing.

In the meantime could you try this please: https://wpml.org/errata/hosting-with-read-only-folder-wp-content-languages-issues-with-wpml-string-translation/

December 16, 2019 at 4:49 pm #5139833

michaelZ-21

Hi,

thank you for your link to the other issue.
I have checked the permissions for the folder wp-content/languages
and this is all right:
drwxrwxr-- 5 www-data www-data 4096 Nov 27 20:16 languages/

Regards,
Michael

December 16, 2019 at 6:36 pm #5140617

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Could you try adding this code to the end of the functions.php file of you current theme:

load_theme_textdomain("obfv");

then delete the string in WPML > String Translation

Then go to WPML > Localize themes and plugin > Select the theme where you have the code and scan it again.

Find it in WPML > String Translation and try to translate it again. see if that works.

If it doesn't then try to find the .mo file of your domain in wp-content/themes/enfold (or in your plugin directly or wp-content/languages/plugins and see if you can find a file called "obfv-xx_XX" where obfv is the name of the domain of the string and xx_XX is the locale (like en_EN for example).

If you find it, move it from there to wp-content/languages/WPML and see if the translation works now.

December 17, 2019 at 5:06 pm #5148943

michaelZ-21

Hi,

I did all your suggested steps on my test environment! Just for info.

Below my answers with the prefix "MZ":

Could you try adding this code to the end of the functions.php file of you current theme:
load_theme_textdomain("obfv");
MZ: Done

then delete the string in WPML > String Translation
MZ: Done
Then go to WPML > Localize themes and plugin > Select the theme where you have the code and scan it again.
MZ: Done
Find it in WPML > String Translation and try to translate it again. see if that works.
MZ: Done - BUT NO CHANGE!

If it doesn't then try to find the .mo file of your domain in wp-content/themes/enfold (or in your plugin directly or wp-content/languages/plugins and see if you can find a file called "obfv-xx_XX" where obfv is the name of the domain of the string and xx_XX is the locale (like en_EN for example).
MZ: I have only found some .mo files in:
- wp-content/languages/wpml/obfv-en_US.mo
- wp-content/languages/wpml/missing/obfv-de_DE.mo
MZ: NOTE: the issue does not only happens for the "obfv" Domain- it also happens for string in the "woocommerce" Domain!

MZ: Additional Note: I am using the ENFOLD-Child Theme. Maybe this is causing some issues within your new version?