Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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.

    #1475713

    Hey 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,
    Ismael

    #1475721

    yes – 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.

    #1475940

    Hi 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,
    Joost

    #1475952

    Hi,

    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,
    Ismael

    #1475962

    Hi 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,
    Joost

    #1475998

    Hi,

    Thank you for the update.

    According to @Guenter, this may require more attention from the plugin developers. Have you tried opening a ticket in the WPML support forum? Please forward this thread for reference.

    Best regards,
    Ismael

    #1476069

    Hi 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?

    #1476222

    Hi,

    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

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.