MCPcopy Create free account
hub / github.com/anomalyco/opencode / route

Function route

packages/console/app/src/lib/language.ts:207–215  ·  view source on GitHub ↗
(locale: Locale, pathname: string)

Source from the content-addressed store, hash-verified

205}
206
207export function route(locale: Locale, pathname: string) {
208 const next = strip(pathname)
209 if (next.startsWith("/docs")) return docs(locale, next)
210 if (next.startsWith("/auth")) return next
211 if (next.startsWith("/workspace")) return next
212 if (locale === "en") return next
213 if (next === "/") return `/${locale}`
214 return `/${locale}${next}`
215}
216
217export function label(locale: Locale) {
218 return LABEL[locale]

Callers 5

GETFunction · 0.90
GETFunction · 0.90
redirectToLocalizedDataFunction · 0.90
getMainRoutesFunction · 0.50
getDocsRoutesFunction · 0.50

Calls 2

docsFunction · 0.85
stripFunction · 0.70

Tested by

no test coverage detected