An isRootTree parameter was added to LocalizeParser::_translateRouteTree since prefixes should only be added to relative redirectTo for root routes, however they should always be added to absolute redirectTo, hence the prefixLang condition checking for / at the beginning or for isRootTree
addPrefixToUrl was modified to:
react to urlPrefix being an empty string - now it no longer returns an extra slash from the beginning of the string template
respect the slash at the beginning of the url (or lack thereof)
rename plitedUrl which was probably meant to be splitUrl
Other than that, I formatted the entire file with TSLint, fixing some formatting issues
I tested this version of the library in the production application that I'm working on at my company, as well as in the sample app in this repository, and didn't notice any issues.
Fixes #132
A small explanation for the implementation:
isRootTree
parameter was added toLocalizeParser::_translateRouteTree
since prefixes should only be added to relativeredirectTo
for root routes, however they should always be added to absoluteredirectTo
, hence theprefixLang
condition checking for/
at the beginning or forisRootTree
addPrefixToUrl
was modified to:urlPrefix
being an empty string - now it no longer returns an extra slash from the beginning of the string templateplitedUrl
which was probably meant to besplitUrl
I tested this version of the library in the production application that I'm working on at my company, as well as in the sample app in this repository, and didn't notice any issues.