MailPoet String not translating
-
there is a string in Mailpoet that dont get translated its shown on the checkout page and its pretty annoying when you have 3 language set and it only shown English
the string is :
default email opt-in message displayed on checkout page for ecommerce websites
im not sure what the issuse is but after reaching out to mailpoet about it they say its a problem with the loco translation plugin
The page I need help with: [log in to see the link]
-
The text you’ve shown is actually the context, for which there are two strings:
- Yes, I would like to be added to your mailing list
- I would like to receive exclusive emails with discounts and product information
Are you using a custom translation file? Do you also have the system translations installed? Please give more details of your situation.
Also, try the string debugger and see what result you get. e.g.
Requires WP_DEBUG is on.
i have polylang pro and Polylang for WooCommerce installed to
her what i get in the debug
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the
w3-total-cachedomain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at theinitaction or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/kn2c1gvj3wj1/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for thewoocommercedomain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at theinitaction or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/kn2c1gvj3wj1/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for thecomplianz-gdprdomain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at theinitaction or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/kn2c1gvj3wj1/public_html/wp-includes/functions.php on line 6114
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for thehealth-checkdomain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at theinitaction or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/kn2c1gvj3wj1/public_html/wp-includes/functions.php on line 6114Running test for domain => mailpoet
Have locale: en_GB
~ filter:pre_determine_locale: none => en_GB
Have plugin bundle => MailPoet
Unloading text domain for auto loader
Removing JIT lockunload_textdomain returned true
Query: msgid “Yes, I would like to be added to your mailing list”
| msgctxt “”
“default email opt-in message displayed on checkout page for ecommerce “
“websites”
Calling _x( “Yes, I would like to be added to your mailing list”,”default email opt-in message displayed on checkout page for ecommerce websites”,”mailpoet” )
~ filter:pre_determine_locale: none => en_GB
~ filter:lang_dir_for_domain {wp_content_dir}/plugins/mailpoet/../../languages/plugins/
~ action:load_textdomain: {wp_content_dir}/plugins/mailpoet/../../languages/plugins/mailpoet-en_GB.mo
~ filter:load_textdomain_mofile: {wp_content_dir}/plugins/mailpoet/../../languages/plugins/mailpoet-en_GB.mo (exists=1)
~ filter:translation_file_format: php
~ action:load_textdomain: {loco_lang_dir}/plugins/mailpoet-en_GB.mo
~ filter:load_textdomain_mofile: {loco_lang_dir}/plugins/mailpoet-en_GB.mo (exists=0)
~ filter:translation_file_format: php
~ filter:load_translation_file: {loco_lang_dir}/plugins/mailpoet-en_GB.l10n.php (exists=0)
~ filter:load_translation_file: {loco_lang_dir}/plugins/mailpoet-en_GB.mo (exists=0)
~ filter:load_translation_file: {wp_content_dir}/plugins/mailpoet/../../languages/plugins/mailpoet-en_GB.l10n.php (exists=1)
~ filter:gettext: [“Yes, I would like to be added to your mailing list”,”default email opt-in message displayed on checkout page for ecommerce websites”] => “Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter”
====>| msgstr “Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter”
Translated result state => true
Searching 5 possible locations for string versions
found in {wp_lang_dir}/plugins/mailpoet-en_GB.po => ‘Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter’
found in {wp_lang_dir}/plugins/mailpoet-en_GB.mo => ‘Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter’
found in {wp_lang_dir}/plugins/mailpoet-en_GB.l10n.php => ‘Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter’
3 matches in 5 locations; 3 files searchedi updated the string in mailpoet to this :
Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter Good Luck
but it dont reflect the same in the Loco plugin there its just the “old” string :Yes, add me to your mailing list and Rolex Contest minimum purchase 100€ to enter
Your test shows that you aren’t using the custom translation file location. The files at
languages/plugins/mailpoet-en_GB.*(System location) are loaded by WordPress, not by Loco Translate. You can actually disable my plugin to use files here. What happens when you do that?but it dont reflect the same in the Loco plugin there its just the “old” string :
I’m not sure what you mean by “in” the plugin. Do you mean displaying on your website, or in the Loco editor?
Separately, and seemingly unrelated to Mailpoet, you have lots of _load_textdomain_just_in_time warnings which may cause you other issues.
Just realised. You’re saying you added “Good Luck” and it doesn’t appear? Where did you enter this?
is that the english one i added..??
i delete the english translation now.
in the mailpoet there is the default email opt-in message displayed on checkout page for ecommerce websites string you can chance and i updated that and then i should be able to edit it in the Loco plugin editor yaa but there the string for the default email opt-in message displayed on checkout page for ecommerce websites is not updated like in the mailpoet setting for the default email opt-in message displayed on checkout page for ecommerce websites string
yaa i notied that i hoped that it was fixed in the last update for the plugins
not sure what cause the issue to start with _load_textdomain_just_in_timeyaa i added the “Good Luck” to the string in the setting in mailpoet
but in dont show in the Loco editor after updated.
The debug is after i updated the string in the settings
-
This reply was modified 1 year, 4 months ago by
dennisr1.
Right. Looks like MailPoet stores its own strings in site settings. This will also be in a single language. Bad practice in my opinion. See section of FAQ: Watch out for plugin settings.
Custom site settings won’t update PO files. My plugin (or any PO editor) cannot know about such things. Nothing I can do here.
okay im gonna write to them and ask why they dont make it translatable when its a customer facing string
thanks for your input on the issue much appreciated
thanks Tim W for the post on my other post again much appreciated
No problem.
If your site is in multiple languages, but you’re not running Multisite (one lang per site) then you’re going to have to clear/reset Mailpoet’s custom string settings every time you update a PO file.
If you are running one site per language then it could work; you’d just have to accept that the Mailpoet config is where you manage certain translations, and the PO files will never reflect that customization.
yaa i can see i would be easier with a multisite..
i hope they update the string in the next update or something..
but thanks for your quick help isolating the issuse much appreciated
Just updating this thread to note that the MailPoet authors have confirmed their plugin circumvents translation file updates on purpose.
The workaround is to filter all the custom strings. This could be used to override the settings to fetch the actual translation from your installed files.
yaa but im not sure on how to implement it in the code
or what file to add the code to at all
The topic ‘MailPoet String not translating’ is closed to new replies.