mirror of
https://github.com/wg-easy/wg-easy.git
synced 2026-10-21 14:21:14 +00:00
use defineI18nLocaleDetector directly
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Edge / Build Docker (push) Has been cancelled
Edge / Build Docker-1 (push) Has been cancelled
Lint / Check Docs (push) Has been cancelled
Edge / Merge & Deploy Docker (push) Has been cancelled
Edge / Build & Deploy Docs (push) Has been cancelled
Lint / Lint (push) Has been cancelled
Lint / Lint-1 (push) Has been cancelled
Lint / Lint-2 (push) Has been cancelled
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Edge / Build Docker (push) Has been cancelled
Edge / Build Docker-1 (push) Has been cancelled
Lint / Check Docs (push) Has been cancelled
Edge / Merge & Deploy Docker (push) Has been cancelled
Edge / Build & Deploy Docs (push) Has been cancelled
Lint / Lint (push) Has been cancelled
Lint / Lint-1 (push) Has been cancelled
Lint / Lint-2 (push) Has been cancelled
This commit is contained in:
parent
3dfea018c3
commit
f731135564
1 changed files with 3 additions and 4 deletions
|
|
@ -3,11 +3,10 @@ import {
|
|||
tryHeaderLocale,
|
||||
tryQueryLocale,
|
||||
} from '@intlify/utils/h3';
|
||||
import type { H3Event } from 'h3';
|
||||
|
||||
// TODO: use defineI18nLocaleDetector
|
||||
import { defineI18nLocaleDetector } from '#imports';
|
||||
|
||||
export default (event: H3Event, config: { defaultLocale: string }) => {
|
||||
export default defineI18nLocaleDetector((event, config) => {
|
||||
const query = tryQueryLocale(event, { lang: '' });
|
||||
if (query) {
|
||||
return query.toString();
|
||||
|
|
@ -27,4 +26,4 @@ export default (event: H3Event, config: { defaultLocale: string }) => {
|
|||
}
|
||||
|
||||
return config.defaultLocale;
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue