Prepend URLs with directory if a language is selected (Polylang Synced Pages)

I’m using Polylang on a WordPress page where there are multiple languages and translated pages.
There are two languages who are very similar (90% the same) but a few pages are different, therefore I’ve synced most of the pages.

That means it also syncs the links which then direct to the origin language and the therefore displaying the content in that origin language. I need to be able to add the language directory in front of every URL so the user stays on that language page.

I can get the the directory with the following code:
$language = pll_current_language('slug');

I’ve tried it with the following code but the directory get’s ignored:

add_action( 'init', 'rewrite_page_based_on_language' );

function rewrite_page_based_on_language() {
    global $wp_rewrite;
    $wp_rewrite->page_structure = $wp_rewrite->root . $language . '/%pagename%';
}