<?php
use Jet\UI;
use Jet\MVC;

?>
<div style="position: absolute;top:15px; right: 15px;">
	<?php foreach( MVC::getBase()->getLocales() as $locale ): ?>
		<?php if( $locale->toString() == MVC::getLocale()->toString() ): ?>
			<?= UI::flag( $locale ) ?>
		<?php else:
			$equal_page = MVC::getPage( locale: $locale );
			if( !$equal_page ) {
				$equal_page = MVC::getHomePage( locale: $locale );
			}
			?>
			<a href="<?= $equal_page->getURL() ?>"><?= UI::flag( $locale ) ?></a>
		<?php endif; ?>
	<?php endforeach; ?>
</div>
