How to get node url of selected language?
You want to use toUrl() with the language option.

$node-&gt;toUrl('canonical', ['language' =&gt; $node-&gt;language()]);


Unfortunately, toUrl() currently doesn't automatically respect the active language.