MB + Polylang
Support › MB Frontend Submission › MB + Polylang
- This topic has 14 replies, 3 voices, and was last updated 2 years, 6 months ago by
Long Nguyen.
-
AuthorPosts
-
June 29, 2022 at 3:15 PM #36711
Marco Curcio
Participantgood morning,
I have a problem with translation.
if in the polylang settings I leave the url: mysite/en/page I can translate all the fields of the MB frontend forms, but I cannot use this solution because I would have to duplicate all the inserted entries of the cpt and it is impossible.
if i change the language from the content in polylang I solve the problem of the single slug of the cpt entries (more important) but in the pages the MB fields are no longer translated, I use the function __ ('xx', 'textdomain') and I have translated everything, but it is as if the change of language does not recognize me ..
can someone help me please?
thank youJune 30, 2022 at 4:05 PM #36736Long Nguyen
ModeratorHi Marco,
Thanks for reaching out.
Can you please share some screenshots of the issue on your site? Do you mean the field title is not translated?
June 30, 2022 at 4:21 PM #36738Marco Curcio
ParticipantI just discovered that even if the page is in English, if I do a var_dump of get_locale () inside the MB box it tells me that the language is still Italian, as if it were separate from the rest of the page
June 30, 2022 at 4:26 PM #36739Marco Curcio
ParticipantJune 30, 2022 at 4:36 PM #36740Marco Curcio
Participantvar_dump get_locale() inside filter rwmb_meta_boxes: it_IT
var_dump get_locale() inside wp_head hook: en_GBsame page
June 30, 2022 at 4:48 PM #36741Marco Curcio
Participantif instead I use the pll_current_language () function inside the MB box it doesn't give me the language, so I guess I put the default one.
The problem therefore is that the filter does not take the page language but remains the default oneJuly 1, 2022 at 4:28 PM #36765Long Nguyen
ModeratorHi,
Thanks for your additional information.
I'm going to check this issue and get back to you later.
July 4, 2022 at 1:00 PM #36784Marco Curcio
Participanthi,
did you find a solution?July 5, 2022 at 12:45 PM #36796Long Nguyen
ModeratorHi Marco,
Did you try to translate the hardcoded strings in a theme or a plugin with the PO file? Refer to this documentation https://polylang.pro/doc/how-to-translate-the-themes-and-plugins-hardcoded-strings/
I've also tried to translate the field label with Loco Translate but do not see any issue like that.
July 5, 2022 at 2:08 PM #36797Marco Curcio
ParticipantHello,
the whole site is translated with .po files, that's not the problem,
if I set the language from the content: point 1 of https://polylang.pro/doc/url-modifications/it recognizes me the strings of the metaboxes in the po file, but it does not load me the translations in the frontend only of the MB. Everything else works.
July 5, 2022 at 8:56 PM #36802Long Nguyen
ModeratorHi Marco,
It works as well on my local site, screen record https://monosnap.com/file/itLmSKdUyJNP9n4XEx3tFWl326AoaI
You can also try to use this plugin to translate theme/plugin texts https://wordpress.org/plugins/theme-translation-for-polylang/
July 5, 2022 at 11:42 PM #36809Marco Curcio
Participanthere a video with the problem, i've also tried the plugin you suggested but doesn't work
VIDEOJuly 6, 2022 at 12:49 PM #36830Long Nguyen
ModeratorHi,
Please share your site (or staging) credentials via this contact form https://metabox.io/contact/
I will help you to investigate the issue.October 15, 2022 at 11:36 AM #38666jmcbade
ParticipantI want to use Polylang with MB and CPTs.
Is this resolved?
October 16, 2022 at 9:21 PM #38685Long Nguyen
ModeratorHi jmcbade,
Can you please create a new topic with your issue? And please share some screenshots, steps that you are trying to do but do not succeed. I will help you to check the issue.
-
AuthorPosts
- You must be logged in to reply to this topic.