(href, languageCode)
| 10 | // Add the language to the given HREF |
| 11 | // /articles/foo -> /en/articles/foo |
| 12 | export function getPathWithLanguage(href, languageCode) { |
| 13 | return slash(path.posix.join('/', languageCode, getPathWithoutLanguage(href))).replace( |
| 14 | patterns.trailingSlash, |
| 15 | '$1' |
| 16 | ) |
| 17 | } |
| 18 | |
| 19 | // Remove the language from the given HREF |
| 20 | // /en/articles/foo -> /articles/foo |
no test coverage detected