• Resolved extremecarver

    (@extremecarver)


    Would it be possible to add support for Qtranslate-X to Say-What?

    Right now if I put the replacment string as “[:en]English_Text[:de]German_Text[:]”
    it would appear on the website exactly as entered. It would be great if the string showed up as
    “English_Text” with English language selected (and the same for German). [:XX] are language shortcodes recognised by Qtranslate-X – but right not the strings are not seen by qtranslate-x (or not seen as translatable – I’m not sure).

    I only have the basic plugin version – but I would be willing to buy pro if you could include that functionality there (otherwise there is no need for pro for me – I’m sufficient enough to find the strings myself in html sourcecode of the website).

    https://www.ads-software.com/plugins/say-what/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Lee Willis

    (@leewillis77)

    Hi;

    I’m not really that familiar with qtranslate, but I suspect you could resolve this by re-ordering the functions attached to the gettext filter.

    Adding this in your theme’s functions.php *may* help, but it’s completely untested, so may not work, or may have other unintended consequences – use at your discretion ??

    function lw_reorder_qtranslate_hooks() {
        if ( has_filter( 'gettext', 'qtranxf_gettext' ) === 0) {
    		remove_filter( 'gettext', 'qtranxf_gettext', 0 );
    		add_filter( 'gettext', 'qtranxf_gettext', 20 );
    	}
    	if ( has_filter( 'gettext_with_context', 'qtranxf_gettext_with_context' ) === 0) {
    		remove_filter( 'gettext_with_context', 'qtranxf_gettext_with_context', 0 );
    		add_filter( 'gettext_with_context', 'qtranxf_gettext_with_context', 20 );
        }
    }
    add_action( 'plugins_loaded', 'lw_reorder_qtranslate_hooks', 99 );
    Thread Starter extremecarver

    (@extremecarver)

    okay – thanks for the answer. I’ll give it a try.. (and ask again in qtranslate-x forum)… – maybe there is a better way than changing the theme (even though maybe I could try this in a child-theme so it survives updates).

    Plugin Author Lee Willis

    (@leewillis77)

    Sure – it can be added there, in a child theme, in a custom plugin, you might want to check out https://www.ads-software.com/plugins/functionality/ or https://www.ads-software.com/plugins/code-snippets/ to add the snippet.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Make strings translatable with Qtranslate-X’ is closed to new replies.