From 689d49f28a258a985e2ce7ec9c2d3a876a0845d0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 26 Jan 2025 18:48:59 -0400 Subject: urls: getURLsFromRoot: do that getOrigin funky --- src/urls.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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; + } }; } -- cgit 1.3.0-6-gf8a5