Add initial project files
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { getPathname } from '#i18n/navigation';
|
||||
import type { LanguageAlternative } from '../types';
|
||||
|
||||
export function localeHref(alternative: LanguageAlternative): string {
|
||||
const path = alternative.path.split('/').filter(Boolean).join('/');
|
||||
|
||||
return getPathname({
|
||||
locale: alternative.locale,
|
||||
href: path ? `/${path}` : '/'
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user