Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #59890

    Rob V
    Participant

    Hi, I use WPML for the translation of my site into dutch and german. Is it possible to also translate some customizer content (i.e. Topbar Content) so that the topbar content will change also with the language you choose?

    thanks for your help!

    #60221

    Rad
    Moderator

    Hi Rob,

    Thank you for writing in!

    It’s not yet possible for top bar content, translation is only possible on templates that using __(), _e(), and more.

    As for now, this can’t be added as builtin because of different nature of every language plugin. All we could do is add css visibility for each of your content based based on your plugin css selectors.

    Would you mind provide as url address as sample?

    Thank you.

    #64460

    Rock9 D
    Participant

    Hi there,

    I am currently working on the same issue. For our client we want to translate the topbar content for the English pages.
    What is this solution you are mentioning?
    Anyhow, the website is http://www.bb-bricks.com

    Hope you can help!

    Thanks in advance

    #64790

    Rad
    Moderator

    Hi Rock,

    First, please install a language plugin then I’ll check if possible. The plugin must support manual translation or css selector.

    Let me know.

    #64883

    Rock9 D
    Participant

    Hi there,

    we have installed (and used) WPML for translating the entire site.

    I assume this should be sufficient? Or do I need to get another plugin for this specific matter?

    -Dominique

    #65299

    Rad
    Moderator

    Hi Rock,

    I’m not sure with WPML, and there is no language selector available so can’t do further check.

    For the meantime, please check your plugin if it has feature similar to this http://theme.co/x/member/forums/topic/how-to-translate-footer-content-in-customizer/#post-62545

    If doesn’t have, then you could use the plugin mentioned on that thread.

    In your case, it would be /x/framework/views/global/_topbar.php and <?php echo x_get_option( 'x_topbar_content' ); ?>

    Let me know if something is confusing 🙂

    #66204

    Rock9 D
    Participant

    Hi there,

    thanks for the point-in-the-right-direction! I have been able to fix this using the method as described in the topic above and the WPML documentation. What worked for us was the following:

    1) copy the file to the child
    2) replace the string in the _topbar.php:
    <?php echo get_theme_mod( ‘x_topbar_content’ ); ?>
    with
    <?php echo icl_t(‘X-Icon’, ‘Topbar’, get_theme_mod( ‘x_topbar_content’ )); ?>
    (icl_t is mentioned by WPML to get the new content. And it was get_theme_mod, not x_get_option 😉 )
    3) register the string in functions.php of the child theme:
    icl_register_string(‘X-Icon’, ‘Topbar’, get_theme_mod( ‘x_topbar_content’ ));

    and it shows up in the WPML String-translation interface (please remark that string-translations must have been installed for WPML)

    I guess this should work for other custom strings as well.

    Hope this helps others as well, and thank you for the support!

    -Dominique

    #66594

    Christian
    Moderator

    You’re welcome Dominique.