I have a custom argument validator for Views, which expects a term name input and outputs the tid for the query. This works great in English, but I'm not sure what to do for translations. Is there any way to search for a term id from the translated term name?
Here's my code:
public function validateArgument($argument) {
if(strpos($argument, '-')){
$argument = str_replace('-', ' ', $argument);
}
$term = taxonomy_term_load_multiple_by_name($argument);
$termId = key($term);
$this->argument->argument = $termId;
return TRUE;
}