12 lines
327 B
TypeScript
12 lines
327 B
TypeScript
import { useLocale } from './useLocale';
|
|
|
|
export const useLocalizedRoutes = () => {
|
|
const locale = useLocale();
|
|
|
|
const localizedPath = (path: string) => {
|
|
// Since prefix-free, return plain path. Locale is handled via session.
|
|
return path.startsWith('/') ? path : `/${path}`;
|
|
};
|
|
|
|
return { localizedPath };
|
|
}; |