• Resolved whitelily85

    (@whitelily85)


    I am using the Inspiro (child) theme and am trying to translate the hero_title and hero_description.

    After adding the below php, only 1 string showed up under “Translate Strings”, hero_description, but entering the translated text here does not display it on the actual page.

    Am I doing something wrong?

    add_action(‘init’, function() {
    if(function_exists(‘falang_register_string’)) {
    // Hero section strings
    falang_register_string(‘inspiro_child_theme’, ‘hero_title’, get_theme_mod(‘hero_title’));
    falang_register_string(‘inspiro_child_theme’, ‘hero_description’, get_theme_mod(‘hero_description’));
    }
    });

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author sbouey

    (@sbouey)

    The meta description/title are translated on your site in spanish (english default)

    can you make a screen capture of the Falang > String translation

    Thread Starter whitelily85

    (@whitelily85)

    Plugin Author sbouey

    (@sbouey)

    You can use the filter on the top to make easier reading of string translation

    on the falang-strings-5 i see site header_site_title and header_site_description (not translated)

    but the call

    falang_register_string(‘inspiro_child_theme’, ‘hero_title’, get_theme_mod(‘hero_title’));
    falang_register_string(‘inspiro_child_theme’, ‘hero_description’, get_theme_mod(‘hero_description’));

    Seem wrong it’s falang_register_string($name,$string,$context)

    it’s more (not tested)

    falang_register_string(‘hero_title’,get_theme_mod(‘hero_title’), ‘inspiro_child_theme’, , );

    Thread Starter whitelily85

    (@whitelily85)

    The header_site_title and header_site_description are different values, they are under “site identity” in the theme customiser.

    The values I need (hero_title and hero_description) are under the “homepage hero area” > “content” in the theme customiser.

    I have tried different calls, but I can’t seem to get these strings added….

    Thread Starter whitelily85

    (@whitelily85)

    I got a bit further… I managed to register the strings with the below code.

    The strings are showing up now with the correct original value.

    However, after translating them, the translations don’t show up in the other language (ES), still the original (ENG) gets displayed.

    Any advice on how to get this working? Many thanks in advance!



    add_action( ‘init’, function() {

    if ( ! function_exists( 'falang_register_string' ) ) {
        return;
    }
    
    $hero_title = get_theme_mod( 'header_site_title' );
    $hero_desc  = get_theme_mod( 'header_site_description' );
    
    if ( $hero_title ) {
        falang_register_string(
            'header_site_title',
            $hero_title,
            'inspiro_hero'
        );
    }
    
    if ( $hero_desc ) {
        falang_register_string(
            'header_site_description',
            $hero_desc,
            'inspiro_hero'
        );
    }

    });

    • This reply was modified 1 month, 1 week ago by whitelily85.
    Plugin Author sbouey

    (@sbouey)

    Hi, it’s a free theme, i will install it and see what’s wrong

    Thread Starter whitelily85

    (@whitelily85)

    Thank you so much @sbouey!

    Plugin Author sbouey

    (@sbouey)

    Hi,

    in the theme there is a wpml-config.xml file , Falang read it and add the string for translation automatically

    https://snipboard.io/GMA37E.jpg

    the problem is hero_title or header_site_title (site description)

    header_site_title is the string i have see you can configure in the theme (same for description)

    Thread Starter whitelily85

    (@whitelily85)

    Thank you for testing. I didn’t get them automatically, I don’t know what the problem can be.

    I tried to add them manually, but as you indicated before the call was not right, so now there are several strings that might be duplicated. Could this possibly cause a problem?

    Is there any way to remove any custom strings and start over?

    • This reply was modified 1 month, 1 week ago by whitelily85.
    Plugin Author sbouey

    (@sbouey)

    There are no way to force this

    the string appear when i have set the string in

    Apparence / Customize > Home page hero area > Content

    Thread Starter whitelily85

    (@whitelily85)

    Yes, that is exactly where I have set it. But the strings still didn’t appear automatically. I have added them manually and they appear ( I am only using the first 2, not the button). But when I translate the strings, it still shows the English text on http://www.bodegaronda.com/es

    https://bodegaronda.com/screenshot-2026-03-05-125125.jpg

    https://bodegaronda.com/screenshot-2026-03-05-125148.jpg

    • This reply was modified 1 month, 1 week ago by whitelily85.
    • This reply was modified 1 month, 1 week ago by whitelily85.
    Thread Starter whitelily85

    (@whitelily85)

    Dear sbouey, I was just wondering if you had the time to have a look at the screenshots and if you have any other insight/ideas/solutions?



    Plugin Author sbouey

    (@sbouey)

    Sorry i haven’t look before,

    Can you filter by inspiro (and not view all group) , remove the code you have put and put a text for button (to be sure all the options are set)

    Thread Starter whitelily85

    (@whitelily85)

    There is no “inspiro” in the filter 🙁

    Plugin Author sbouey

    (@sbouey)

    Did you remove your specific code and put somthing in the button or url field in the inspiro theme and publish it

Viewing 15 replies - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.