• I’m use plugin QTranslate-x for multi language and i can’t change placeholder text by language . I’ve been tried “[:en]Type Search [:ja]Search[:]” but not successful. can you guide me how to convert placeholder text in each language ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    You will need to make a modification within the plugin code to be able to make it work.

    1. Make sure to have a full site back-up before making any changes to the site files.
    2. Open up the wp-content\plugins\ajax-search-lite\includes\functions\functions.php file and scroll to lines 292-404, which should be this function:

    if (!function_exists('asl_icl_t')) {
        /* Ajax Search Lite wrapper for WPML and Polylang print */
        function asl_icl_t($name, $value) {
            if (function_exists('icl_register_string') && function_exists('icl_t')) {
                icl_register_string('ajax-search-lite', $name, $value);
                return stripslashes( icl_t('ajax-search-lite', $name, $value) );
            }
            if (function_exists('pll_register_string') && function_exists('pll__')) {
                pll_register_string($name, $value, 'ajax-search-lite');
                return stripslashes( pll__($value) );
            }
            return stripslashes( $value );
        }
    }

    3. Change that piece of code to this one:

    if (!function_exists('asl_icl_t')) {
        /* Ajax Search Lite wrapper for WPML and Polylang print */
        function asl_icl_t($name, $value) {
            if (function_exists('icl_register_string') && function_exists('icl_t')) {
                icl_register_string('ajax-search-lite', $name, $value);
                return stripslashes( icl_t('ajax-search-lite', $name, $value) );
            }
            if (function_exists('pll_register_string') && function_exists('pll__')) {
                pll_register_string($name, $value, 'ajax-search-lite');
                return stripslashes( pll__($value) );
            }
            if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
                return stripslashes( qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage( $value ) );
            }
            return stripslashes( $value );
        }
    }

    4. Save the file.

    After that, it should be running the qtranslate filter through that text.
    If this works, I will make sure to implement it to the next release.

    Thread Starter huytran0424

    (@huytran0424)

    thanks All done

    list94

    (@list94)

    Hi,

    I have same issue but with plugin Polylang maybe is any solution for this plugin and Ajax search placeholders?

    How could I apply this using WPGlobus translation plugin, I gave up on qtranslatex due to duplicate content and title warnings.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multi language for Placeholder text’ is closed to new replies.