- Issue created by @davidiio
We needed to display node title as previous or next link text so we used token [node:title] but it was only returning default node translation on all languages.
Create a drupal with multiple languages
Create a few nodes and translate them into different languages
Create a entity page view of these nodes
Set the prev and next link to display [node:title]
Navigate this view on different language
Observe that view title is always displayed in default language
Use the langcode parameter in the replace() method of Token.
For my use case I simply add this is the detokenize() method of the EntityPager.php class
$langcode = \Drupal::languageManager()->getCurrentLanguage()->getId();
return $this->token->replace($string, $data, ['langcode' => $langcode, 'clear' => TRUE]);
While it is OK for me, it would be best to detect view language configuration, wether it is in a specific language or interface text language selected for page.
Active
1.0
Code