• Resolved danc77

    (@danc77)


    Hi there

    I’m using Polylang on more than one site and so far everything works amazingly good. Plugin is fast and very intuitive. Thank you!

    I’m having an issues on one of sites I’m developing. Only two plugins in use are WPL PRO (WP Real estate plugin by Realtyna) and Polylang.
    I’m trying to translate additional (dynamic) strings on my system. WPL works in way that such strings in theory should be generated for translation please see this article , however Polylang is not picking up such additional dynamic strings. Checking on servers I can see a keywords.php file where these strings are added.

    How can I get Polylang to translate these dynamic strings? I suppose a function needs to be added to function.php (telling Polylang to translate these additional strings?)

    Polylang settings I use:
    The language is set from the directory name in pretty permalinks
    Remove /language/ in pretty permalinks
    When the front page is visited, set the language according to the browser preference
    Activate languages and translations for media
    All Synchronization options checked
    Languages en_US, it_IT, hr,
    theme is WPL Twentyeight (child theme of WPL Twentyeight)

    https://www.ads-software.com/plugins/polylang/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Chrystl

    (@chrystl)

    Hello

    How can I get Polylang to translate these dynamic strings?

    You have 2 options: create a wpml-config.xml or use the functions pll__() and pll_register_string().

    Thread Starter danc77

    (@danc77)

    Thank you for your reply. Unfortunately I’m not a coder so I’m not sure how to implement any of those solutions. I may need more step by step explanation how to direct these additional keywords from keyword.php file to polylang in order to get these dynamic strings to translate.

    Plugin Support Chrystl

    (@chrystl)

    To create a wpml-config.xml you need some informations:

    1) In your Data Base => wp_options:
    – find the option name of your plugin in option_name columns. If you don’t find it ask to your plugin author.
    – find the names of each options in option_value columns, it’s next to the option name cell. It’s a long strings. Paste it here and I will unserialize it.
    It exist a plugin the Adminer which explores the DB. It can help you to find the option name of my theme and the values. I never tested it.

    2) After unserialized, create your wpml-config.xml. Write just the admin-texts part:

    <wpml-config>
     <admin-texts>
            <key name="my_plugins_options">
                <key name="option_name_1" />
                <key name="option_name_2" />
                <key name="options_group_1">
                    <key name="sub_option_name_11" />
                    <key name="sub_option_name_12" />
                </key>
            </key>
            <key name="simple_string_option" />
        </admin-texts>
    </wpml-config>

    And upload it in /wp-content/polylang/ .

    You will find the strings in the tab Strings translation in your wp admin.

    Thread Starter danc77

    (@danc77)

    Sorry to be pain. I know that your explanation is perfectly clear to you but I’m still not clear what I’m searching for.
    Using PHPmyadmin I can’t see wp_options nearest to that is kdyn_options which mostly give options of WP installation, plugins end etc. From there I’m lost what I need to look for.

    Let me try to rephrase better. Maybe will be easier for you to understand what I wanna do.

    I have fully functional and translated web site check here, (both theme and WPL plugin are translation friendly and I translated the po files in my language). I have few additional strings I added in installation (type of properties for example) I which I can see on my server in a php file named keywords. these strings look like this:
    __(‘Unit’, WPL_TEXTDOMAIN);
    __(‘Building land’, WPL_TEXTDOMAIN);
    __(‘Agricultural Land’, WPL_TEXTDOMAIN);
    these strings are added to a existing keyword.php file (containing all other already translated keywords) located in path to plugin/languages folder on my installation.
    WPL itself have option to generate additional strings for translation more information you can find here, to use with wpml or similar plugins. Using this function polylang doesn’t recognize newly added strings (all other strings are recognized i.e. widgets page translations etc.

    Plugin Support Chrystl

    (@chrystl)

    Could you specify what is generated by the button “Generate WPL dynamic strings for using in translation plugins like WPML”.
    An icl_register_string or a wpml-config.xml file or a .po/.mo file?

    Thread Starter danc77

    (@danc77)

    Thank you for your reply.

    I checked existing po/mo files these additional strings aren’t added to existing po/mo files. No new po/mo file is generated.

    Searched through server files wpml-config.xml not found.

    Searched in database through phpMyAdmin no cl_register_string were found.

    Only file where these additional strings are seen is keywords.php file which is located in language folder of WPL plugin

    Plugin Support Chrystl

    (@chrystl)

    Only file where these additional strings are seen is keywords.php file which is located in language folder of WPL plugin

    It doesn’t help.

    Searched in database through phpMyAdmin no cl_register_string were found.

    You can’t find this WPML function in your DB.

    You should ask to your plugin author how he makes his plugin compatible with WPML.

    Thread Starter danc77

    (@danc77)

    Just an update.

    Since WPL is a complex piece of software implementation of polylang as per how I wanted it were not possible due to simple reason WPL has its own data structure.
    However I solved my problem by manually adding additional strings to po file and having it translated to wanted language

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Polylang WPL Translation of aditional strings’ is closed to new replies.