• Hello,
    I noticed that the fields within {} are not being translated when the form is loaded via AJAX. Form message translations work fine.
    Also, the “lang” attribute does not change.
    I use template file with apply_shortcodes() and load it via AJAX.

Viewing 1 replies (of 1 total)
  • Thread Starter makaulius

    (@makaulius)

    /**
     * translate
     *
     * @param $text_or_array
     * @return array|mixed|string
     */
    function do_translate($text_or_array){
        if ( !is_textdomain_loaded( 'pll_string' ) ) {
             Helpers::load_string_translations_textdomain();
        }
        return Helpers::translate_translation_strings_recursive($text_or_array);
    }

    !is_textdomain_loaded(‘pll_string’) – whether it’s AJAX or not, it’s always false.
    So load_string_translations_textdomain() not running.
    Is it really bad if I skip this check, because running load_string_translations_textdomain() solves the problem?

Viewing 1 replies (of 1 total)
  • The topic ‘Form does not translate via AJAX’ is closed to new replies.