mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
refactor: Creation d'un provider et d'un systeme de middleware
This commit is contained in:
12
Front-End/src/hooks/useLocale.js
Normal file
12
Front-End/src/hooks/useLocale.js
Normal file
@ -0,0 +1,12 @@
|
||||
'use client';
|
||||
|
||||
import { headers } from 'next/headers';
|
||||
|
||||
export function useLocale() {
|
||||
try {
|
||||
const headersList = headers();
|
||||
return headersList.get('x-locale') || 'fr';
|
||||
} catch {
|
||||
return 'fr';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user