Skip to content

Commit

Permalink
Core: Revert default i18n config
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Jan 8, 2025
1 parent 90a2057 commit 14b280c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-mangos-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fumadocs-core': patch
---

Revert default i18n config
19 changes: 2 additions & 17 deletions packages/core/src/search/orama/create-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,9 @@ type WithLocale<T> = T & {
async function getTokenizer(
locale: string,
): Promise<{ language: string } | { tokenizer: Tokenizer }> {
const mandarin = ['cn', 'zh'];
const language =
Object.keys(STEMMERS).find((lang) => STEMMERS[lang] === locale) ?? locale;

if (
mandarin.some((code) => locale === code || locale.startsWith(`${code}-`))
) {
const { createTokenizer } = await import(
'@orama/tokenizers/mandarin' as string
);

return {
tokenizer: await createTokenizer(),
};
}

return {
language,
language:
Object.keys(STEMMERS).find((lang) => STEMMERS[lang] === locale) ?? locale,
};
}

Expand Down

0 comments on commit 14b280c

Please sign in to comment.