Display a translated setting value in a view
- This topic has 22 replies, 2 voices, and was last updated 2 years, 6 months ago by
Arno.
-
AuthorPosts
-
September 21, 2022 at 1:19 PM #38371
Arno
ParticipantHi Long,
I just e-mailed all details.
September 22, 2022 at 1:26 PM #38384Arno
ParticipantHi Long,
Meanwhile, I found that another issue I have, is also caused by the bug we're discussing here. I was showing a value from a Meta Box settings field in a Kadence block, but it wasn't showing anything in the translated post. I asked Kadence for help, and they came back with this:
"I did a little test to see if meta box and WPML actually talk to each other. I added the metabox shortcode to output the text you've added in your site settings.
[rwmb_meta id="site_settings_texts_advanced_filters" object_id="site-configuration" object_type="setting"]
This did not output the translated text from your string translations on the German page. That tells me that Meta Box and WPML are not talking to each other and this isn't an issue with Kadence Dynamic content it's an issue of WPML not translating the output from MetaBox."
September 22, 2022 at 9:09 PM #38392Long Nguyen
ModeratorHi Arno,
Now you can see the second URL is translated as well, screenshot (removed)
You can check whether the translation is completed or not by checking the icon "pen" or "circle arrows", screenshot https://monosnap.com/file/EAyVJy42XLpBJuihNbtvumdXVOca93
September 22, 2022 at 9:26 PM #38393Arno
ParticipantHi Long,
I know about the WPML icons, but that does not seem to be causing this issue. For example: I now added the field "site_settings_urls_start_page_promotions" to the test view. This field shows the pencil icon in WPML String Translation, so its translation is complete. Nevertheless, as you can see, the translated page shows the English value.
Why is that?
By the way, can you remove the link to your first screenshot as that shows the site. Thanks!
September 24, 2022 at 9:51 AM #38407Long Nguyen
ModeratorHi,
I've checked the field
site_settings_urls_start_page_promotions
on your site and the value to translate is not correct, then I re-add this field to the String translation and it is translated as well. I send the screen record via the ticket.September 24, 2022 at 9:51 PM #38411Arno
ParticipantHi Long,
Thank you for sorting that out, and for the video. Indeed that makes the fields work!
We now have a way to fix this if it happens. What do you think the underlying problem is? What is actually causing this?
Unfortunately the other issue (https://support.metabox.io/topic/display-a-translated-setting-value-in-a-view/page/2/#post-38384) is not solved yet. I had hoped it was the same issue. I have used the field site_settings_texts_advanced_filters containing the text "More filters" in 3 Kadence blocks (accordion, text, button) in the same test page that you used. All work fine in English but no text is displayed in German.
I also added the field to the test view and that works fine for both languages.
I think there might be two issues:
1) If you search for "site_settings_texts_advanced_filters" in String Translations, it finds 5 entries. One entry would make sense.
2) In our views, we use your work around (https://support.metabox.io/topic/display-a-translated-setting-value-in-a-view/#post-38274) to retrieve the field values. Kadence is probably using another way, that should normally work too, but does not.September 28, 2022 at 11:27 AM #38450Long Nguyen
ModeratorHi,
I'm not sure why the helper shortcode or helper function
rwmb_meta()
is not able to display the translation strings in other languages on your site. I've informed the development team to take a look at this case.
Meanwhile, you can create your own shortcode to display the field value and use the WordPress functionget_option()
then add the shortcode to the Kadence block, just like the helper shortcode[rwmb_meta]
. Please read more on the documentation https://codex.wordpress.org/Shortcode_APISeptember 28, 2022 at 12:17 PM #38451Arno
ParticipantHi Long,
Yes, I will use get_option(). That's issue 1. It would be great if you could find out issue 2 as well: randomly, some translated setting values were not returned until the field is re-added, while other fields work fine.
Please keep me posted about the progress.
Do you still need the test website to log into, or can I remove it?
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.