How to get term ID from translated term name? 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-&gt;argument-&gt;argument = $termId;

  return TRUE;

}
A suggestion :

$my_translated_term_name = 'astuce';

$query = \Drupal::database()-&gt;select('taxonomy_term_field_data', 'td');
$query-&gt;addField('td', 'tid');
$query-&gt;condition('td.name', $my_translated_term_name);
// For better performance, define the vocabulary where to search.
// $query-&gt;condition('td.vid', $vid);
$term = $query-&gt;execute();

$tid = $term-&gt;fetchField();