Well Fixed! thank Chouby
Here is my solution, i use pll_the_language_link
and i cut the last two characters of the current link page, append to the url translate, and check if the current page is a page with the parameter
here is the code:
add_filter('pll_the_language_link', 'my_link', 10, 2);
function my_link($url, $slug) {
$arr=array('pagename',
'nombrepagina',
'nomepágina',
);
foreach($arr as $a) {
if (stripos($_SERVER['REQUEST_URI'],$a) !== false) {
return $url .substr($_SERVER['REQUEST_URI'], -2);
break;
}
else
return $url;
}
}