type Locale = Ref | string export interface LocalizedNavigationParams { locale: Locale projectUrl: string path?: string target?: '_blank' | '_self' } export function navigateToLocalizedPage({ locale, projectUrl, path = '', target = '_blank', }: LocalizedNavigationParams) { const url = buildLocalizedUrl(locale, projectUrl, path) return navigateTo(url, { external: true, open: { target }, }) } export function buildLocalizedUrl(locale: Locale, projectUrl: string, path: string = '') { const lang = getLocalizedPath(locale) return `${projectUrl}${lang}${path}` } export function getLocalizedPath(locale: Locale) { const lang = unref(locale) return lang === 'ru' ? '' : `/${lang}` }