forked from memfreeme/memfree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multi language with next i18n
- Loading branch information
Showing
36 changed files
with
296 additions
and
206 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { notFound } from 'next/navigation'; | ||
import { getRequestConfig } from 'next-intl/server'; | ||
import { routing } from './routing'; | ||
|
||
export default getRequestConfig(async ({ locale }) => { | ||
if (!routing.locales.includes(locale as any)) notFound(); | ||
|
||
return { | ||
messages: (await import(`@/messages/${locale}.json`)).default, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineRouting } from 'next-intl/routing'; | ||
import { createSharedPathnamesNavigation } from 'next-intl/navigation'; | ||
|
||
export const routing = defineRouting({ | ||
locales: ['en', 'zh'], | ||
defaultLocale: 'en', | ||
localePrefix: 'as-needed', | ||
}); | ||
|
||
export const { Link, redirect, usePathname, useRouter } = | ||
createSharedPathnamesNavigation(routing); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"HomePage": { | ||
"hero": "Unlock Accurate Answers Faster", | ||
"hero2": "AI Search from Knowledge Base and Internet" | ||
}, | ||
"DemoQuestions": { | ||
"title1": "Search and Ask Indie Maker Questions", | ||
"question1": "How to get first 1000 users", | ||
"title2": "Search and Ask by Image", | ||
"question2": "What is the hybrid AI search https://www.memfree.me/memfree-hybrid-ai-search.webp", | ||
"title3": "Extract Text from Image", | ||
"question3": "Extract Text https://www.memfree.me/pricing-card.png", | ||
"title4": "Summarize and Ask Web Page and PDF", | ||
"question4": "Summarize the content of https://www.memfree.me/docs/index-bookmarks", | ||
"title5": "Get Top Hacker News Stories", | ||
"question5": "Get the top 3 Hacker News stories", | ||
"title6": "Search and Ask Twitter Questions", | ||
"question6": "Claude 3.5 Sonect VS GPT-4o", | ||
"title7": "Expalin and Write Code", | ||
"question7": "please use zustand and local storage implement a react user store hook, if user don't found in local storage, fetch from server. please write the TS." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"HomePage": { | ||
"hero": "更快 获取 准确的 答案", | ||
"hero2": "从个人知识库和互联网进行 AI 搜索" | ||
}, | ||
"DemoQuestions": { | ||
"title1": "搜索独立开发者问题", | ||
"question1": "How to get first 1000 users", | ||
"title2": "通过图像搜索", | ||
"question2": "什么是 Hybrid AI Search https://www.memfree.me/memfree-hybrid-ai-search.webp", | ||
"title3": "图像中提取文本", | ||
"question3": "提取文本 https://www.memfree.me/pricing-card.png", | ||
"title4": "总结询问网页和 PDF", | ||
"question4": "总结 https://www.memfree.me/docs/index-bookmarks 的内容", | ||
"title5": "获取 Hacker News 头条", | ||
"question5": "Get the top 3 Hacker News stories", | ||
"title6": "搜索 Twitter 问题", | ||
"question6": "Claude 3.5 Sonect VS GPT-4o", | ||
"title7": "代码解释和编写", | ||
"question7": "请使用 zustand 和本地存储实现一个 react 用户存储钩子,如果在本地存储中找不到用户,则从服务器获取。请用 TS 编写" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import createMiddleware from 'next-intl/middleware'; | ||
import { routing } from '@/i18n/routing'; | ||
|
||
export default createMiddleware(routing); | ||
|
||
export const config = { | ||
matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.