• hi, i working on the translation of a website, but there is a text in a textbox of the theme options that i can’t translate, it does not shows in string translations. So i was wondering if there is a way to use some kind of a shortcode where i select the language and type the translation so Polylang can show only that text in the translated version and hide the original and vice-versa…I think Polylang does not have shortcodes, but it would be a good idea to translate parts of a theme that can’t be translated in another way.

    https://wordpress.org/plugins/polylang/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    No there is no shortcode in Polylang. But there are other ways to translate your theme options. You can create a wpml-config.xml file. Is your theme freely available?

    Thread Starter alex.alp

    (@alexalp)

    Unfortunately, it is a themeforest theme (WildCommunity), is there a step-by-step tutorial on how to do that so i can do it for future themes and not to bother you haha

    Plugin Author Chouby

    (@chouby)

    Save your option with some text that you can easily identify. Then go in PHPMyAdmin. Select the wp_options table. Click on search. You get a form. On the line ‘option_value’, select LIKE %...% in the dropdown, type your option text and submit your search.

    Generally you get one line. Post here the option name and the option value. If the option value is serialized (this is most often the case), you can unserialize it online.

    Thread Starter alex.alp

    (@alexalp)

    ok, i followed those steps, but i’m not sure if i copied is the info you need:

    option_name varchar(191) utf8_general_ci
    option_value longtext utf8_general_ci

    let me know if i have to give you something else

    thanks!

    Thread Starter alex.alp

    (@alexalp)

    sorry i realized my mistake, here is the right info
    where it says translate this, it’s the text i want to translate, how do i put it in the wpml-config.xml file?

    [welcome] => Bienvenido a …–Translate this
    [members] => Firmas Actuales…
    [info] => intro text –Translate this
    [1box-title] => Foros–Translate this
    [1box-link] => forums/
    [2box-title] => Grupos–Translate this
    [2box-link] => grupos/
    [3box-title] => Beneficios–Translate this
    [3box-link] => /beneficios
    [4box-title] => Firmas–Translate this
    [t-2] => Foros1
    [t-3] => En los Foros–Translate this
    [t-4] => Todos los derechos reservados
    [t-21] => Leer más …–Translate this

    Plugin Author Chouby

    (@chouby)

    Yes this is what I need. Copy paste this in a text file:

    <wpml-config>
        <admin-texts>
            <key name="option_name">
                <key name="welcome" />
                <key name="info" />
                <key name="1box-title" />
                <key name="2box-title" />
                <key name="3box-title" />
                <key name="4box-title" />
                <key name="t-3" />
                <key name="t-21" />
            </key>
        </admin-texts>
    </wpml-config>

    Replace option_name on the 3rd line by your own option name. Save the file as wpml-config.xml and upload it to the directory wp-content/polylang. This directory does not exist. You have to create it.

    Thread Starter alex.alp

    (@alexalp)

    thanks a lot Chouby, just one more thing, i didn’t understand the option_name replacement, where can i see my own option name to replace it with the exact name?

    Plugin Author Chouby

    (@chouby)

    When you made your search, you got the option name and option value. Here is an example: http://nimb.ws/UZOztv

    Thread Starter alex.alp

    (@alexalp)

    oh i see, it’s the name of the theme in this case, i followed all the steps, i noticed i had to name the folder with all letters in lowercase.

    Everything worked well, except the button Read More which i dont know why it doesnt show the translation even though i typed it.

    Thanks a lot!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Translation shortcode?’ is closed to new replies.