WPPizza – A Restaurant Plugin for WordPress › Support › Translations › WordPress backend changes
- AuthorPosts
- 7 January, 2020 at 5:44 pm #46145
Hi olly, I’m back;)
I opened a ticket on wpml
https://www.loom.com/share/510249e4f2f54e09ae5734141a4336a5
https://wpml.org/it/forums/topic/backend-di-wordpress/ and together with a technician we understood that something is wrong with the compatibility between wpml and wppizza plugin.
We can clearly see this because the WordPress backend changes language every time the language is changed, and it shouldn’t.
Can I somehow help you correct this problem?
Thanks Maurizio.7 January, 2020 at 5:45 pm #46147first of all, what versions of wppizza and wpml are we talking about please?
7 January, 2020 at 5:58 pm #46148forget that question. i watched the video you linked to and figured it out from there what the versions are
i’ll see what happens when i do this locally here first of all and will get back to you when i know more8 January, 2020 at 1:44 am #46154Assuming you are happy to edit some php files (let me know if that is not the case )
could you please try the following(I dont use WPML really as such , so it would be great if you could let me know if the below solves your problem and does not cause any others elsewhere before I makes this actually part of an update)
in [your site path]/wp-content/plugins/wppizza/classes/class.wppizza.categories.php you will find at approx line 118 the following codeblock
if(function_exists('icl_get_languages')){ global $sitepress; $languages = icl_get_languages(); /**loop through non current languages to get categories**/ foreach($languages as $lang_code=>$lang_arr){ if($lang_code!=ICL_LANGUAGE_CODE){ $sitepress->switch_lang($lang_code); /*get cats for that language**/ $wpml_sort_cats_lang[$lang_code] = get_categories($args); } } /**make sure we switch back to current language when done**/ $sitepress->switch_lang(ICL_LANGUAGE_CODE); }
REPLACE that whole codeblock with
if(function_exists('icl_get_languages')){ global $sitepress; $languages = icl_get_languages(); /**loop through non current languages to get categories**/ foreach($languages as $lang_code=>$lang_arr){ if($lang_code!=ICL_LANGUAGE_CODE){ $sitepress->switch_lang($lang_code); /*get cats for that language**/ $wpml_sort_cats_lang[$lang_code] = get_categories($args); } /**make sure we switch back to current language when done**/ $sitepress->switch_lang(ICL_LANGUAGE_CODE); } }
i.e move the second ->switch_lang() inside the loop
let me know if that solves the issue in your case too – seems to work fine when i do this here in a test environment8 January, 2020 at 1:02 pm #46163I made the required changes.
It only works in part, the main language of the site is in Italian.
1. Italian (perfect)
2. English (only a part)
3. Spanish (only part of it)
4. Russian (only a part)
5. French (only a part)If you want to experiment with my site, I have a backup of the files and the database, if you need a username and password, tell me which email to send them to.
8 January, 2020 at 1:58 pm #46165when you are saying “only a part of it”
which “parts” in particular do not work…
(admin? frontend? some global text strings ? or particular plugins/themes only ?)8 January, 2020 at 3:54 pm #46166I speak of the WORDPRESS BACKEND.
But this is safely connected to the problem I have in this post:
https://www.wp-pizza.com/topic/wpml-string-translation-update/8 January, 2020 at 4:04 pm #46168This reply has been marked as private.8 January, 2020 at 4:28 pm #46169This reply has been marked as private.8 January, 2020 at 5:28 pm #46172i’m a bit confused now
if I go here:
https://www.[yoursite].it/wp-admin/plugins.php
i get different languages in the descriptions (quite probably because the plugins and their descriptions have no IT translation)
even though WPPizza is DE-activated ???
So i assume you are not actually referring to this ?!if i look at my clone of your site here now i get the same plugins names/descriptions (/wp-admin/plugins.php) as well as the same admin labelling – i.e the stuff on the left like “Media”, “Pagine”, “Prodotti” “Openig Hours” etc etc (/wp-admin)
regardless of whether wppizza is active or not (i can show you screenshots if you like)i must be missing something…:(
please can you give me a distinct example (some text/heading/label somewhere) that changes/is different
depending on whether wppizza is activated or not ….8 January, 2020 at 9:52 pm #46175no sorry, I realized that wppizza was disabled, I will make a detailed report. and I send you everything.
8 January, 2020 at 11:49 pm #46174Something you did, because now everything works perfectly, let’s see if you have also solved the problem I had in this post.
https://www.wp-pizza.com/topic/wpml-string-translation-update/
I’ll tell you if it’s fixed over time.9 January, 2020 at 5:30 pm #46177This reply has been marked as private.9 January, 2020 at 7:44 pm #46180thanks for the screenshots. they help a lot and i think i know where the issue is now (just need to find a few variables that are set by WP/WPML)
will post back here when I think i solved it10 January, 2020 at 11:53 am #46190This reply has been marked as private.14 January, 2020 at 3:29 pm #46239Hi Holly,
I checked the changes you told me, now I’m happy to tell you that everything works as I wanted.
I will be able to tell you if with this change, you have also solved the problem:
https://www.wp-pizza.com/topic/wpml-string-translation-update/14 January, 2020 at 7:32 pm #46240Good stuff.
happy to hear it. I’ll make that part of the next wppizza update.Thanks for letting me know / testing the fix
15 January, 2020 at 3:00 pm #46245Can I advise you to contact wpml and have it inserted as plugins that are completely compatible with wpml plugin?
They can put you on their list.
- AuthorPosts
- The topic ‘WordPress backend changes’ is closed to new replies.