@NengQs:
As far as I know, you can't auto-translate external links. You probably need to hard code it.
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';$attributes = ! empty( $item->attr_title ) ? ' title="' . $item->attr_title .'"' : '';<!--:en-->https://webmarket.es/clients/index.php?lang=English<!--:--><!--:es-->https://webmarket.es/clients/index.php?lang=Espanish<!--:-->
//line 79
$title = empty( $item->label ) ? __($title) : __($item->label);
// line 240 : added __($)
$output .= empty( $item->label ) ? esc_html( __($item->title) ) : esc_html( __($item->label) );abmcr wrote:I have solved the problem 2
<!--:en-->Page<!--:--><!--:it-->Pagina<!--:-->
but with an edit on the core file
I post this edit , may be someone put the code in the functions
I have edited the nav-menu.php file into the wp-admin/includes folder
i have changed the line 240 as
- Code: Select all
$output .= empty( $item->label ) ? esc_html( $item->title ) : esc_html( $item->label );
in
- Code: Select all
$output .= empty( $item->label ) ? esc_html( get_language($item->title) ) : esc_html( get_language($item->title) );
And i have added this small and stupid function at line
257
- Code: Select all
function get_language($mystring,$lg='it'){
//find the position of the strin needed
$pos=strpos($mystring, $lg."-->");
if (!$pos) return $mystring;
$string=substr($mystring, $pos+5, (strlen($mystring)-($pos+5)));
//now search the end of the language identifier
$pos=strpos($string, "<!--:-->");
$string=substr($string, 0, -(strlen($string)-$pos));
return $string;
}
NB: in this function the filter is based on the code of language: in this example the italian language. Change as your preference
Bad code, i know
If this function goes on the functions php file of the theme....
Return to qTranslate Support Forum
Users browsing this forum: Google [Bot], Google Adsense [Bot] and 3 guests