diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-26 18:48:59 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-26 18:48:59 -0400 |
commit | 689d49f28a258a985e2ce7ec9c2d3a876a0845d0 (patch) | |
tree | 3a3813d99519834beb206d50b80bb833995d5531 /src | |
parent | 9283c64ea17fab9c9fa1a73f079269a171a26918 (diff) |
urls: getURLsFromRoot: do that getOrigin funky
Diffstat (limited to 'src')
-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; + } }; } |