Home Forums Theme Support Fitness How can i translate content in Theme Options?

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #13530

    Hi,

    I am translating my Fitness based website. Translating menu, pages, posts and widgets went all fine. But I need help on the translation of content that is part of the ‘Theme Options’. This concerns: the Footer Boxes Content 1,2 and 3 and the Copyright Section – Custom Copyright Text .

    Kind regards, Robert

    #13563

    Hi there and sorry for the delay but we were out of office during the winter holidays.

    Do you use any plugin for your translations?

    Cheers!
    Chris

    #13571

    Hi Chris,

    Thanks for your reply, i’m using Polylang for the translation of your theme. I have been able to translate widgets, pages and posts. But the content in the three footer boxes and copyright part do not show up in the text translations tab that is part of the Polylang plugin.

    Kind regards, Robert

    #13591

    Hey Robert,

    Does polylang have any shortcode like this example:

    [content lang="en"] Content in English Here [/content]
    [content lang="de"] Content in German Here[/content]

    I used to use WPML for translating and it had a shortcode like this and you could translate dynamic content like this. Unfortunately I don’t have too much experience with Polylang so I don’t know if it has something similar.

    Let me know how’s going.

    Cheers!
    Chris

    #13604

    Hi Chris,

    Unfortunately Polylang doesn’t support a [content…] shortcode. But all content I placed in WordPress text widgets appear in the Polylang translatable strings.

    B.T.W. I use Polylang version 2.0.12 downloaded from https://nl.wordpress.org/plugins/polylang/

    Cheers Robert.

    #13610

    Hey,

    I’ve made some research and it seems that Polylang is compatible with a config file of WPML.

    Check it out here: https://polylang.wordpress.com/documentation/documentation-for-developers/the-wpml-language-configuration-file/

    I’ve also attached the file for the theme so you can translate the footer boxes.

    Simply download the file and extract the content in the theme’s folder.

    Note that I didn’t test the file so please let me know how’s going.

    DOWNLOAD FILE FROM HERE: http://d.pr/f/AI6S

    Cheers!
    Chris

    #13616

    Hi Chris,

    Thank you for your reply. I’m going to try your solution shortly.

    Kind regards,
    Robet

    #13784

    Hi Chris,

    I thought i replied to your ‘wpml-config.xml solution’ post earlier but it seems like I didn’t 🙁
    Unfortunately the wpml-config.xml approach doesn’t work for the Footer Boxes and Custom Copyright Text textareas in the Theme Options section of your theme.
    However, texts that are placed in the 3 Footer Sidebar widgets do show up in Polylang and can be translated.
    Maybe it is possible to implement the translation of the Footer boxes and Copyight text as you did for the Footer widgets?

    Kind Regards, Robert

    #13789

    Hi Robert,

    The widgets are handled by WordPress and that’s why it is working. It’s part of the WP core disregarding the theme you’re using.

    How did you try with the wpml file?

    Cheers!

    #13794

    Hi Chris,

    I’ve both experimented with your wpml-config.xml file placed in the root folder of the fitness theme and in the root folder of the fitness_child theme created by myself. Both approaches didn’t work.
    In the WPML documentation I found about the wmpl-config.xml file:

    “admin-texts: When themes and plugins use ‘get_option’, Polylang can filter these calls and provide translation to the values of these options.”

    I don’t know if the fitness theme does use this WP get_option() function to implement translation of Theme options.

    Kind Regards,
    Robert

    #13800

    Hey,

    My theme uses get_option too and that is what it makes it compatible with the wpml file. Can you give me a test username & pwd. on your site so I can take a closer look?

    Cheers!

    #13801
    This reply has been marked as private.
    #13803

    I’ve checked your site but I cannot see the wpml-config.xml file in the theme’s root folder or child theme folder. You need to upload the file and let me know so I can check it out.

    #13805
    This reply has been marked as private.
    #13807

    Hey Robert,

    I’ve made a more in-depth research and it seems that the theme options I am using on the Fitness theme (SMOF) isn’t compatible with polylang because it doesn’t use get_option. I thought it was (in the last 2 years I’ve been using a different theme options framework which uses get_option) but it has a different way of saving the data.

    If you still want to get your hands dirty a little bit you can try and install redux framework and then use this plugin to convert the smof theme options (the one that fitness uses) to redux and then the translation would work https://wordpress.org/plugins/redux-converter/

    But any changes you want to make you should make it on your dev host (localhost) not on the production server.

    Cheers!
    Chris

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.