From 6e5ec622f8ed699dca7be4902d603c82ae89d050 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 8 Jun 2021 22:22:23 +0800 Subject: [PATCH] feat: add i18n on sign-in page Signed-off-by: Wing-Kam Wong --- .../pages/user/authentication/signin.vue | 42 +++++++++++-------- packages/nc-gui/static/lang/en.json | 16 ++++++- packages/nc-gui/static/lang/ja.json | 16 ++++++- packages/nc-gui/static/lang/zh.json | 16 ++++++- 4 files changed, 70 insertions(+), 20 deletions(-) diff --git a/packages/nc-gui/pages/user/authentication/signin.vue b/packages/nc-gui/pages/user/authentication/signin.vue index 04aea64521..75af9762f0 100644 --- a/packages/nc-gui/pages/user/authentication/signin.vue +++ b/packages/nc-gui/pages/user/authentication/signin.vue @@ -26,7 +26,8 @@ -

SIGN IN

+ +

{{ $t('signin.title') }}

@@ -37,17 +38,18 @@ - + - + + - +

- Forgot your password ? + {{ $t('signin.forget_password') }}

@@ -77,9 +79,10 @@


- -

Don't have an account ? - Sign Up + +

{{ $t('signin.footer_text_1') }} + + {{ $t('signin.footer_text_2') }}

@@ -208,12 +211,16 @@ export default { formRules: { email: [ - v => !!v || 'E-mail is required', - v => /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || 'E-mail must be valid' + // E-mail is required + v => !!v || this.$t('signin.form.rules.email_1'), + // E-mail must be valid + v => /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || this.$t('signin.form.rules.email_2') ], password: [ - v => !!v || 'Password is required', - v => (v && v.length >= 8) || 'You password must be atleast 8 characters' + // Password is required + v => !!v || this.$t('signin.form.rules.password_1'), + // You password must be atleast 8 characters + v => (v && v.length >= 8) || this.$t('signin.form.rules.password_2') ], }, formUtil: { @@ -341,9 +348,9 @@ export default { }, head() { return { - title: 'Log In | Noco', + title: this.$t('signin.head.title'), meta: [ - {hid: 'Log In To Noco', name: 'Log In To Noco', content: 'Log In To Noco'} + {hid: this.$t('signin.head.meta.hid'), name: this.$t('signin.head.meta.name'), content: this.$t('signin.head.meta.content')} ] } @@ -364,6 +371,7 @@ export default { * * @author Naveen MR * @author Pranav C Balan + * @author Wing-Kam Wong * * @license GNU AGPL version 3 or any later version * @@ -381,4 +389,4 @@ export default { * along with this program. If not, see . * */ ---> +--> \ No newline at end of file diff --git a/packages/nc-gui/static/lang/en.json b/packages/nc-gui/static/lang/en.json index 593d98e118..34250b1c58 100644 --- a/packages/nc-gui/static/lang/en.json +++ b/packages/nc-gui/static/lang/en.json @@ -23,5 +23,19 @@ "home.show_community_message_2": "Book a Free DEMO", "home.show_community_message_3": "Get your questions answered", "home.show_community_message_4": "Follow NocoDB", - "home.search.no_result": "Your search for {search} found no results" + "home.search.no_result": "Your search for {search} found no results", + "signin.title": "SIGN IN", + "signin.input_1": "Enter your work email", + "signin.input_2": "Enter your password", + "signin.forget_password": "Forgot your password ?", + "signin.footer_text_1": "Don't have an account ?", + "signin.footer_text_2": "Sign Up", + "signin.form.rules.email_1": "E-mail is required", + "signin.form.rules.email_2": "E-mail must be valid", + "signin.form.rules.password_1": "Password is required", + "signin.form.rules.password_2": "You password must be atleast 8 characters", + "signin.head.title": "Log In | Noco", + "signin.head.meta.hid": "Log In To Noco", + "signin.head.meta.name": "Log In To Noco", + "signin.head.meta.content": "Log In To Noco" } diff --git a/packages/nc-gui/static/lang/ja.json b/packages/nc-gui/static/lang/ja.json index 1be007c814..f3ceed4dd3 100644 --- a/packages/nc-gui/static/lang/ja.json +++ b/packages/nc-gui/static/lang/ja.json @@ -23,5 +23,19 @@ "home.show_community_message_2": "Book a Free DEMO", "home.show_community_message_3": "Get your questions answered", "home.show_community_message_4": "Follow NocoDB", - "home.search.no_result": "Your search for {search} found no results" + "home.search.no_result": "Your search for {search} found no results", + "signin.title": "SIGN IN", + "signin.input_1": "Enter your work email", + "signin.input_2": "Enter your password", + "signin.forget_password": "Forgot your password ?", + "signin.footer_text_1": "Don't have an account ?", + "signin.footer_text_2": "Sign Up", + "signin.form.rules.email_1": "E-mail is required", + "signin.form.rules.email_2": "E-mail must be valid", + "signin.form.rules.password_1": "Password is required", + "signin.form.rules.password_2": "You password must be atleast 8 characters", + "signin.head.title": "Log In | Noco", + "signin.head.meta.hid": "Log In To Noco", + "signin.head.meta.name": "Log In To Noco", + "signin.head.meta.content": "Log In To Noco" } diff --git a/packages/nc-gui/static/lang/zh.json b/packages/nc-gui/static/lang/zh.json index 2261901460..6d6e38d2b0 100644 --- a/packages/nc-gui/static/lang/zh.json +++ b/packages/nc-gui/static/lang/zh.json @@ -23,6 +23,20 @@ "home.show_community_message_2": "Book a Free DEMO", "home.show_community_message_3": "Get your questions answered", "home.show_community_message_4": "Follow NocoDB", - "home.search.no_result": "Your search for {search} found no results" + "home.search.no_result": "Your search for {search} found no results", + "signin.title": "SIGN IN", + "signin.input_1": "Enter your work email", + "signin.input_2": "Enter your password", + "signin.forget_password": "Forgot your password ?", + "signin.footer_text_1": "Don't have an account ?", + "signin.footer_text_2": "Sign Up", + "signin.form.rules.email_1": "E-mail is required", + "signin.form.rules.email_2": "E-mail must be valid", + "signin.form.rules.password_1": "Password is required", + "signin.form.rules.password_2": "You password must be atleast 8 characters", + "signin.head.title": "Log In | Noco", + "signin.head.meta.hid": "Log In To Noco", + "signin.head.meta.name": "Log In To Noco", + "signin.head.meta.content": "Log In To Noco" } \ No newline at end of file