how to make url string absolute?
The options are the second parameter in url(), then you also have to pass the first parameter, which is by default 'canonical':

$entity-&gt;getTranslation($language)-&gt;url('canonical', ['absolute' =&gt; TRUE]);


url() is deprecated, so better use toUrl():

$entity-&gt;getTranslation($language)-&gt;toUrl('canonical', ['absolute' =&gt; TRUE])-&gt;toString();