Skip to content

@i18n-micro/route-strategy

18 exports across 1 entry point. Generated from the API snapshot that pnpm run api:surface checks against the TypeScript sources.

@i18n-micro/route-strategy

ts
import { /* … */ } from '@i18n-micro/route-strategy'
ExportKindSignature
buildEncodedPathAliasesfunction(routePath: string) => string[]
buildFullPathfunction(locale: string | string[], basePath: string, customRegex?: string | RegExp) => string
buildFullPathNoPrefixfunction(basePath: string) => string
buildRouteNameconst(baseName: string, localeCode: string, isCustom: boolean, prefix?: string) => string
cloneArrayconst<T extends object>(array: T[]) => T[]
extractLocalizedPathsfunction(pages: NuxtPage[], globalLocaleRoutes: LocaleRoutesConfig, filesLocaleRoutes: LocaleRoutesConfig, parentPath?: string) => LocalizedPathsMap
isInternalPathfunction(path: string, excludePatterns?: (string | RegExp | object)[]) => boolean
isLocaleAllowedForUnlocalizedRoutefunction(routeLocales: Record<string, string[]>, locales: Locale[], unlocalizedPath: string, localeCode: string) => boolean
isLocaleDefaultconst(locale: string | Locale, defaultLocale: Locale) => boolean
isLocalizationDisabledForPagefunction(globalLocaleRoutes: LocaleRoutesConfig, originalPath: string, pageName: string) => boolean
isPageRedirectOnlyconst(page: NuxtPage) => boolean
LocalizedPathsMaptypeRecord<string, Record<string, string>>
normalizePathconst(routePath: string) => string
normalizeRouteKeyfunction(key: string) => string
removeLeadingSlashconst(routePath: string) => string
RouteGeneratorclass23 members
RouteGeneratorOptionsinterface11 members
shouldAddLocalePrefixconst(locale: string, defaultLocale: Locale, addLocalePrefix: boolean) => boolean
RouteGenerator — 23 members
MemberType
activeLocaleCodesstring[]
collectPageNamesprivate (pages: NuxtPage[]) => string[]
computeActiveLocaleCodesprivate () => string[]
customRegexstring | RegExp | undefined
defaultLocaleLocale
ensureFileExistsprivate (filePath: string) => void
ensureTranslationFilesExist(pagesNames: string[], translationDir: string, rootDir: string, disablePageLocales?: boolean) => void
excludePatterns(string | RegExp)[] | undefined
extendPages(pages: NuxtPage[]) => void
extractLocalizedPaths(pages: NuxtPage[], parentPath?: string) => { [key: string]: { [locale: string]: string; }; }
fallbackRedirectComponentPathstring | undefined
filesLocaleRoutesLocaleRoutesConfig
generateDataRoutes(pages: NuxtPage[], apiBaseUrl: string, disablePageLocales: boolean) => string[]
globalLocaleRoutesLocaleRoutesConfig
localesLocale[]
localizedPathsLocalizedPathsMap
localizedRouteNamePrefixstring
new(options: RouteGeneratorOptions): RouteGenerator
noPrefixRedirectboolean
rawGlobalLocaleRoutesGlobalLocaleRoutes
resolveLocalizedPath(originalPath: string, localeCode: string) => string
routeLocalesRecord<string, string[]>
strategyStrategies
RouteGeneratorOptions — 11 members
MemberType
customRegexMatcher?string | RegExp | undefined
defaultLocaleCodestring
excludePatterns?(string | RegExp)[] | undefined
fallbackRedirectComponentPath?string | undefined
filesLocaleRoutes?GlobalLocaleRoutes
globalLocaleRoutesGlobalLocaleRoutes
localesLocale[]
localizedRouteNamePrefix?string | undefined
noPrefixRedirectboolean
routeLocales?Record<string, string[]> | undefined
strategyStrategies

Back to all packages · Integration guides

Released under the MIT License.