I'm trying to add the language to the beginning of the url when missing only using $stateProvider. So if you navigate to "/products" it would became "/pt/products".
I've tried to add a param default value like this:
$stateProvider
    .state('root', {
        url: '/:lan',
        abstract: true,
        template: '<div ui-view=""></div>',
        params: { lan: 'pt' }
    });
But it doesn't have the desired effect. How is it done?
 
    