mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-04 23:17:34 +08:00
feature: add /user_api/mails with filter params address and keyword (#639)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { LocaleMessages } from "./type";
|
||||
import zh from "./zh";
|
||||
import en from "./en";
|
||||
import { HonoCustomType } from "../types";
|
||||
import { Context } from "hono";
|
||||
|
||||
export default {
|
||||
getMessages: (
|
||||
@@ -10,6 +12,17 @@ export default {
|
||||
if (locale === "en") return en;
|
||||
if (locale === "zh") return zh;
|
||||
|
||||
// fallback language
|
||||
return en;
|
||||
},
|
||||
getMessagesbyContext: (
|
||||
c: Context<HonoCustomType>
|
||||
): LocaleMessages => {
|
||||
const locale = c.get("lang") || c.env.DEFAULT_LANG;
|
||||
// multi-language support
|
||||
if (locale === "en") return en;
|
||||
if (locale === "zh") return zh;
|
||||
|
||||
// fallback language
|
||||
return en;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user