langswitch

This commit is contained in:
Arno Kaimbacher 2018-11-21 13:40:34 +01:00
parent ad42e73126
commit 8d91d0e7a8
14 changed files with 792 additions and 76 deletions

13
app/Helpers/utils.php Normal file
View file

@ -0,0 +1,13 @@
<?php
/**
* Get an associative array with localeCodes as keys and translated URLs of current page as value
*/
function getLocalizedURLArray()
{
$localesOrdered = LaravelLocalization::getLocalesOrder();
$localizedURLs = array();
foreach ($localesOrdered as $localeCode => $properties) {
$localizedURLs[$localeCode] = LaravelLocalization::getLocalizedURL($localeCode, null, [], true);
}
return $localizedURLs;
}