ソースを参照

enhance(i18n): amplify tips

charlie 1 年間 前
コミット
32f913de6a

+ 2 - 2
packages/amplify/src/LSAuthenticator.tsx

@@ -5,8 +5,8 @@ export function LSAuthenticator({ termsLink, children }: any) {
     <Authenticator
       formFields={{
         signUp: {
-          email: { order: 1 },
-          username: { order: 2 },
+          email: { order: 1, isRequired: true },
+          username: { order: 2, isRequired: true },
           password: { order: 3 },
           confirm_password: { order: 4 },
         },

+ 6 - 1
packages/amplify/src/amplify.ts

@@ -7,14 +7,19 @@ import { dict } from 'aws-amplify-react/lib-esm/AmplifyI18n'
 dict.zh['Reset Password'] = '重置密码'
 dict.zh['Enter your email'] = '请输入邮箱'
 dict.zh['Enter your password'] = '请输入密码'
+dict.zh['Enter your Username'] = '请输入用户名'
 dict.zh['Confirm Password'] = '确认密码'
 dict.zh['Please confirm your Password'] = '请确认密码'
 dict.zh['Incorrect username or password.'] = '用户名或者密码不正确。如果您的邮箱未验证,请尝试使用用户名(非邮箱)登录,以保证再次邮箱验证流程。'
+dict.zh['User already exists'] = '用户名已经存在'
+dict.zh['Username or Email'] = '用户名或邮箱'
+dict.zh['Enter your Username or Email'] = '请输入用户名或邮箱'
 
 // @ts-ignore attach defaults
 dict.en = {
   'Incorrect username or password.': 'Incorrect username or password!   ' +
-    'For unconfirmed users, please input your username instead of Email to receive the code.'
+    'For unconfirmed users, please input your username instead of Email to receive the code.',
+  'User already exists': 'Username already exists'
 }
 
 const fixesMapping = {