123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- import { store } from './store';
- const messages = {
- "en": {
- "code": "Please enter the verification code",
- "code.invalid": "Invalid verification code",
- "code.send": "The verification code has been sent",
- "continue": "Continue",
- "email": "Please enter your email",
- "email.failure": "Account and email do not match",
- "email.invalid": "Please enter a valid email address",
- "forget": "Forgot password?",
- "forget.failure": "Failed to reset the password",
- "forget.success": "Your password has been successfully reset. You can now use the new password to log in",
- "forget.title": "Your HumiHumi Verification Code",
- "newpass": "Please enter your new password",
- "nick": "Nickname",
- "nick.invalid": "Invalid nickname",
- "nick.placeholder": "2~14 characters",
- "password": "Enter password",
- "password.invalid": "Password must be 7 ~ 20 characters long",
- "password.placeholder": "7~20 characters",
- "repeat": "Please re-enter your password",
- "repeat.invalid": "The passwords entered do not match",
- "sign-forget": "Set a new password",
- "sign-in": "Log In",
- "sign-in.invalid": "Invalid username or password, please try again",
- "sign-up": "Create Account",
- "sign-up.invalid": "Failed to create an account, please try again",
- "title": "HumiHumi",
- "to-in": "Log In",
- "to-up": "Create one",
- "username": "Please enter your username",
- "username-email": "Username/Email",
- "username.forget": "Enter username",
- "username.in": "Enter username\n\nCreate one",
- "username.invalid.in": "Invalid username",
- "username.invalid.up": "Invalid username or already taken by someone else",
- "username.placeholder": "5~14 characters",
- "username.up": "Create username\n\nLog in",
- "welcome.forget": "ฅ●ω●ฅ Welcome to\nHumi Kingdom\nLet's change the password~",
- "welcome.in": "ฅ●ω●ฅ Welcome back to\nHumi Kingdom\nLet's continue exploring~",
- "welcome.up": "ฅ●ω●ฅ Welcome to\nHumi Kingdom\nLet's start exploring~"
- },
- "jp": {
- "code": "認証コードを入力して下さい",
- "code.invalid": "認証コードが間違っています",
- "code.send": "認証コードが紐付けしたメールアドレスに送信いたしました",
- "continue": "続ける",
- "email": "メールアドレスを入力して下さい",
- "email.failure": "メールアドレスが間違っています",
- "email.invalid": "紐付けしたメールアドレスを入力して下さい",
- "forget": "忘れた?",
- "forget.failure": "パスワードをリセットできません",
- "forget.success": "パスワードをリセットしました",
- "forget.title": "HumiHumiの認証コードです",
- "newpass": "パスワードを入力",
- "nick": "ニックネームを入力",
- "nick.invalid": "ニックネームが無効です",
- "nick.placeholder": "2~14文字",
- "password": "パスワードを入力",
- "password.invalid": "パスワードは7文字以上20文字以下で入力してください",
- "password.placeholder": "7~20文字",
- "repeat": "パスワードを再入力",
- "repeat.invalid": "再度入力したパスワードが設定したパスワードと一致しません",
- "sign-forget": "新たなパスワードを設置する",
- "sign-in": "ログイン",
- "sign-in.invalid": "ユーザー名またはパスワードが間違っています、もう一度お試しください",
- "sign-up": "アカウントを作成する",
- "sign-up.invalid": "アカウントの作成に失敗しました、もう一度お試しください",
- "title": "HumiHumi",
- "to-in": "ログイン",
- "to-up": "登録",
- "username": "アカウントを入力",
- "username-email": "ユーザ名/E-mail",
- "username.forget": "ユーザー名を入力",
- "username.in": "ユーザー名を入力\n持ってない?\n登録",
- "username.invalid.in": "ユーザー名が無効です",
- "username.invalid.up": "ユーザー名が無効、または既に他の人に使用されています",
- "username.placeholder": "5~14文字",
- "username.up": "ユーザー名を作る\n持ってる?\nログイン",
- "welcome.forget": "ฅ●ω●ฅようこそHumi王国へ\nパスワードをリセットしましょう~",
- "welcome.in": "ฅ●ω●ฅHumi王国へお帰りなさい\n探索を続けましょう",
- "welcome.up": "ฅ●ω●ฅHumi王国へようこそ\n探索を始めましょう"
- },
- "zh": {
- "code": "请输入验证码",
- "code.invalid": "无效的验证码",
- "code.send": "验证码已发送到绑定的邮箱",
- "continue": "继续",
- "email": "请输入绑定的Email",
- "email.failure": "账号与Email不匹配",
- "email.invalid": "请输入有效的Email地址",
- "forget": "忘记密码?",
- "forget.failure": "密码重置失败",
- "forget.success": "密码已重置,您可以使用新密码登录了",
- "forget.title": "您的HumiHumi验证码",
- "newpass": "请输入您的新密码",
- "nick": "请输入您的昵称",
- "nick.invalid": "昵称无效",
- "nick.placeholder": "2~14个字符",
- "password": "请输入您的密码",
- "password.invalid": "密码长度需要7~20个字符",
- "password.placeholder": "7~20个字符",
- "repeat": "请再次输入您的密码",
- "repeat.invalid": "再次输入的密码与您设置的密码不一致",
- "sign-forget": "设置新密码",
- "sign-in": "登录",
- "sign-in.invalid": "用户名或密码错误,请重试",
- "sign-up": "创建账号",
- "sign-up.invalid": "账号创建失败,请重试",
- "title": "Humi虎咪",
- "to-in": "登录",
- "to-up": "注册",
- "username": "请输入您的账号",
- "username-email": "用户名/邮箱",
- "username.forget": "请输入您的账号",
- "username.in": "请输入您的账号\n还没有账号?\n注册",
- "username.invalid.in": "用户名无效",
- "username.invalid.up": "用户名无效或已被其他人使用",
- "username.placeholder": "5~14个字符",
- "username.up": "请创建您的账号\n已有账号?\n登录",
- "welcome.forget": "ฅ●ω●ฅ欢迎来到Humi王国\n让我们修改密码吧~",
- "welcome.in": "ฅ●ω●ฅ欢迎回到Humi王国\n让我们继续探索吧~",
- "welcome.up": "ฅ●ω●ฅ欢迎来到Humi王国\n让我们开始探索吧~"
- }
- };
- const message = (key) => {
- return messages[getLang()][key] || '';
- }
- const getLang = () => {
- let language = localStorage.getItem('language') || 'sys';
- if (language === 'sys') {
- language = navigator.language;
- let indexOf = language.indexOf('-');
- if (indexOf > -1)
- language = language.substring(0, indexOf);
- if (!messages[language])
- language = 'en';
- }
- return language;
- };
- export {
- message,
- getLang,
- }
|