
-
AuthorPosts
-
January 23, 2025 at 10:04 am #1475638
Hi Enfold,
I am trying to translate the Fold/Unfold text which I have set-up in Dutch. However, I can’t seem to find the translation in WPML anywhere, not in the page translation menu but also not in the theme settings. I can only find the label for it, but not the input I gave it.
Please see the link attached and toggle between the languages to see that the ‘Lees meer’ button is not able to be translated (or I am missing something)
Looking forward to your reply.
January 24, 2025 at 7:09 am #1475713Hey dp-beheer,
Thank you for the inquiry.
We may need to access the site to check the issue properly. Please provide the login details in the private field. Did you adjust the read more text?
Best regards,
IsmaelJanuary 24, 2025 at 9:39 am #1475721yes – i think you are right . Allthough there are translatables in the code of enfold
__( 'Read More Text', 'avia_framework' ), __( 'Read more', 'avia_framework' ), __( 'Read Less Text', 'avia_framework' ), __( 'Read less', 'avia_framework' ),
on many languages these ( f.e. on german) tranlations are missing.
but for dutch there is: Lees minder and Lees meer inside the lang files – so i guess you only want to change that translation? One solution could be to have your own translation files – or to use a plugin to change these translations.
I don’t know how you have implemented multilanguage support for your installation. With WPML you have separate pages. There you could rename it manually in the element.
January 28, 2025 at 7:03 pm #1475940Hi both,
Thanks for the reply. The read more text translations are what seems to be for the placeholder text. But since I will put in my own custom language ‘Lees meer’ and ‘Lees minder’ this does not get recognised in the Advanced Translation Editor of WPML. I would be able to manually edit the page and add the translation there myself, but since that is not recommended by WPML, I would not want to use that method.
It seems the translations of the block is not being passed to WPML properly. Is this something I would have to contact them about, or should this be an Enfold feature?
TL;DR: So I would like to have a different translation for the ‘Read more’ and ‘Read less’ in 2 languages.
Kind regards,
JoostJanuary 29, 2025 at 5:41 am #1475952Hi,
Thank you for the update.
To fix the issue temporarily, we added this script using the Code Snippet plugin:
function ava_custom_translate_fold_unfold() { ?> <script type="text/javascript"> (function ($) { $(document).ready(function () { $('.avia-fold-unfold-section').each(function () { var $this = $(this); var data = $this.data('fold_unfold'); if (data) { var currentLang = '<?php echo apply_filters("wpml_current_language", NULL); ?>'; var translations = { 'nl': { 'more': 'Lees meer', 'less': 'Lees minder' }, 'en': { 'more': 'Read more', 'less': 'Read less' }, 'fr': { 'more': 'Lire plus', 'less': 'Lire moins' } }; if (translations[currentLang]) { data.more = translations[currentLang].more; data.less = translations[currentLang].less; $this.attr('data-fold_unfold', JSON.stringify(data)); } } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_translate_fold_unfold', 9999);
Please make sure to purge the cache before checking the page.
Best regards,
IsmaelJanuary 29, 2025 at 8:54 am #1475962Hi Ismael,
Thanks for the fix. It works as expected. As you mentioned that this would be a temporary fix, is this planned in a future Enfold update for a native fix?
Kind regards,
JoostJanuary 30, 2025 at 6:50 am #1475998January 31, 2025 at 11:13 am #1476069Hi Ismael,
I have contacted a WPML supporter. This is the conclusion from that message:
They added this piece of code to the XML editor:
<wpml-config> <shortcodes> <shortcode> <tag>av_textblock</tag> <attributes> <attribute>fold_more</attribute> </attributes> </shortcode> </shortcodes> </wpml-config>
https://wpml.org/documentation/support/language-configuration-files/ > based on this documentation. Perhaps this could be added to a future release?
February 3, 2025 at 7:06 am #1476222Hi,
Thank you for the update.
The changes above will be added in their config file if I am not mistaken: https://github.com/OnTheGoSystems/wpml-config/blob/master/enfold/wpml-config.xml
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.