• corrado1

    (@corrado1)


    Hello everyone,
    my name is Corrado, I have almost finished creating my site using the WPrentals Theme, the default language is English and to create the multilingual version for now only in Italian I have used Polylang and Loco Translate.
    I only need one sentence to complete everything, a sentence that I have not been able to translate, it is a text in a field, in Polylang it does not appear in the Languages ??- Transaltions page where there are the strings to translate, and it does not appear in Loco either, not even by clicking Sinc. I asked the creator of the Theme for support and he told me that: Once you add a test in the fields, that text will need to be registered as a new string in your multilanguage plugin, the words/test added manually need to be registered as new strings in your plugin to be able to translate them.

    To register new strings on Polylang I found some tutorials online but I am a beginner and it is not clear to me how to use them.
    For example I found this one that has the same problem even if with another Theme, can someone explain this procedure to me as an explanation for dummies?

    https://uxper.gitbook.io/wp-golo/faqs/how-to-add-new-string-in-polylang

    Find the string that you need to be registered. I need to register Sign Out, so I went to header.php (file in the child theme) and found the row containing:

    Therefore, you need to register Sign Out. When you find out, go to functions.php (file in the theme) and add the following line to the bottom:

    pll_register_string(‘golo-framework’, ‘Sign Out’, ‘true’);

    From that moment, the Sign Out string is located in Strings Translations and you can add translations for the languages that you have set up in Polylang.
    Insert translation for registered strings

    Go to Strings Translations and add translations for the new string:
    Quite simply, but that’s not enough. Now we have made Polylang aware of what the words should offer the translation we have inserted, but Polylang still does not know where to show these words. You need to do the following.
    Calling for translated strings

    Return to the header.php file and replace:

    Instead, place:

    And that is that. Now you have informed Polylang that the Sign Out option should change depending on the language that is selected on the site.
    This procedure should be repeated for each word-string to be translated. Keep in mind that strings are in different theme files, and all the strings can be registered through the functions.php file.

  • You must be logged in to reply to this topic.