diff options
-rw-r--r-- | src/urls.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/urls.js b/src/urls.js index 2976a522..5e334c1e 100644 --- a/src/urls.js +++ b/src/urls.js @@ -300,14 +300,18 @@ export function getURLsFromRoot({ return (targetFullKey, ...args) => { const [groupKey, subKey] = targetFullKey.split('.'); - return ( - '/' + + const toResult = (groupKey === 'localized' && baseDirectory ? to('localizedWithBaseDirectory.' + subKey, baseDirectory, ...args) : groupKey === 'localizedDefaultLanguage' ? to('localized.' + subKey, ...args) - : to(targetFullKey, ...args)) - ); + : to(targetFullKey, ...args)); + + if (getOrigin(toResult)) { + return toResult; + } else { + return '/' + toResult; + } }; } |