TASKS-1823 WebManager module

This commit is contained in:
Igor Martyniuk
2026-08-28 08:35:58 +00:00
parent fdb2cf3837
commit c93d8c025b
654 changed files with 26232 additions and 6075 deletions
+21
View File
@@ -0,0 +1,21 @@
import { hasLocale } from 'next-intl';
import { routing } from './routing';
/**
* Internal hrefs in page content are locale-prefixed (`/{locale}/{path}`);
* when the site serves unprefixed URLs, the prefix is stripped at render
* time so navigation does not bounce through the proxy redirect.
*/
export function toPublicHref(href: string): string {
if (routing.localePrefix !== 'never') {
return href;
}
const [, first = '', ...rest] = href.split('/');
if (!hasLocale(routing.locales, first)) {
return href;
}
return `/${rest.join('/')}`;
}