$router->map('GET','/th/work/sample', 'work/sample.php', 'sample', 'th');
But that fifth parameter isn't available. Is there any workaround for this?
That is because the map function just does not support a fifth parameter.
public function map($method, $route, $target, $name = null)
source code AltoRouter.php:map
You can call match
function passing in the original route if you can somehow intercept and get your code to work before router. The match function returns you a route name. But this means you create named routes for each language and then you will begin to appreciate the solution provided by @gbe
$router->map('GET', '/[:lang]/work/sample', 'work/sample.php', 'sample')