From 925e413423bde098fa018de9e741a0836985f252 Mon Sep 17 00:00:00 2001 From: rathanak-0080 <148197234+rathanak-0080@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:05:17 +0700 Subject: [PATCH] Add translation keys from ID repo (#48) * Add translation keys from ID repo * Add khmer translation * Add default path --------- Co-authored-by: Sreang Rathanak Co-authored-by: Sreang Rathanak Signed-off-by: Sreang Rathanak --- .../resources/application-default.properties | 2 +- signup-ui/public/locales/en.json | 36 ++++++++++++++++++- signup-ui/public/locales/km.json | 36 ++++++++++++++++++- .../AccountRegistrationStatusLayout.tsx | 2 +- .../src/pages/SignUpPage/Phone/Phone.tsx | 2 +- .../SignUpPage/PhoneStatus/PhoneStatus.tsx | 2 +- .../src/pages/SignUpPage/SignUpPopover.tsx | 2 +- signup-ui/src/utils/link.ts | 4 +-- 8 files changed, 77 insertions(+), 9 deletions(-) diff --git a/signup-service/src/main/resources/application-default.properties b/signup-service/src/main/resources/application-default.properties index 0a32ab4c..70d65ba8 100644 --- a/signup-service/src/main/resources/application-default.properties +++ b/signup-service/src/main/resources/application-default.properties @@ -3,7 +3,7 @@ mosip.signup.supported.challenge-type=OTP mosip.signup.supported.challenge-format-types={'alpha-numeric'} mosip.signup.id-schema.version=0.2 -mosip.signup.identifier.regex=\\+855[1-9]\\d{7,8} +mosip.signup.identifier.regex=^\\+855[1-9]\\d{7,8}$ mosip.signup.identifier.prefix=+855 mosip.signup.supported-languages={'khm','eng'} mosip.signup.password.pattern=^.{8,}$ diff --git a/signup-ui/public/locales/en.json b/signup-ui/public/locales/en.json index 7e7e223a..22ddcc68 100644 --- a/signup-ui/public/locales/en.json +++ b/signup-ui/public/locales/en.json @@ -67,6 +67,40 @@ "already-registered": "Already Registered", "timed_out": "Timedout", "timeout_transaction": "Transaction Timeout", - "request_limit": "Request Limit" + "request_limit": "Request Limit", + "IDR-IDC-001": "Missing Input Parameter", + "IDR-IDC-002": "Invalid Input Parameter", + "IDR-IDC-003": "Invalid Request", + "IDR-IDC-004": "Unknown error occurred", + "IDR-IDC-005": "Input Data Validation Failed", + "IDR-IDC-006": "Error occured while performing DB operations", + "IDR-IDC-007": "No Record(s) found", + "IDR-IDC-008": "4XX - Client Error occured", + "IDR-IDC-009": "5XX - Server Error occured", + "IDR-IDC-010": "Connection timed out", + "IDR-IDC-011": "Authorization Failed", + "IDR-IDC-012": "Record already exists in DB", + "IDR-IDC-013": "Update count limit for the attributes exceeded", + "IDR-IDC-014": "Handle record already exists in DB", + "IDR-IDS-001": "Identity Element hash does not match", + "IDR-IDS-002": "Biometric/Document hash does not match", + "IDR-IDS-003": "Failed to either encrypt/decrypt message using Kernel Crypto Manager", + "IDR-IDS-004": "Failed to store/retrieve files in Object Store", + "IDR-IDS-005": "Failed to process Id Object using kernel Id Object validator", + "IDR-IDS-006": "File(s) not found in Object Store", + "IDR-IDS-007": "Failed to retrieve data from kernel Masterdata", + "IDR-IDS-008": "Failed to retrieve Identity Schema from kernel Syncdata service", + "IDR-IDS-009": "Failed to extract template from bio extractor service", + "IDR-IDS-010": "Failed to retrieve data from vid service", + "IDR-IDS-011": "Failed to generate UIN", + "IDR-VID-001": "VID", + "IDR-VID-002": "Failed to generate VID", + "IDR-VID-003": "Could not generate/regenerate VID as per policy", + "IDR-VID-004": "UIN", + "IDR-VID-005": "Failed to retrieve uin data using Identity Service", + "IDR-VID-006": "Uin hash does not match", + "IDR-IDS-012": "Authentication Failed", + "IDR-BIE-001": "Technical Error in Biometric Extraction", + "IDR-CFJ-001": "Credential Feeder job failed" } } diff --git a/signup-ui/public/locales/km.json b/signup-ui/public/locales/km.json index be506d3c..d82ffb6b 100644 --- a/signup-ui/public/locales/km.json +++ b/signup-ui/public/locales/km.json @@ -67,6 +67,40 @@ "already-registered": "បានចុះឈ្មោះរួចហើយ", "timed_out": "អស់ម៉ោង", "timeout_transaction": "ប្រតិបត្តិការផុតកំណត់", - "request_limit": "ចំនួនសំណើដល់កំណត់" + "request_limit": "ចំនួនសំណើដល់កំណត់", + "IDR-IDC-001": "រកមិនឃើញតម្លៃដែលបានបញ្ចូល", + "IDR-IDC-002": "តម្លៃដែលបានបញ្ចូលមិនត្រឹមត្រូវ", + "IDR-IDC-003": "សំណើរមិនត្រឹមត្រូវ", + "IDR-IDC-004": "មានកំហុសមួយបានកើតឡើង", + "IDR-IDC-005": "ការបញ្ជាក់ទិន្នន័យដែលបានបញ្ចូលបានបរាជ័យ", + "IDR-IDC-006": "កំហុសមួយបានកើតឡើងពេលធ្វើប្រតិបត្តិការនៅក្នុងមូលដ្ឋានទិន្នន័យ", + "IDR-IDC-007": "រកមិនឃើញកំណត់ត្រា", + "IDR-IDC-008": "4XX - កំហុសមួយបានកើតឡើងដោយសារអ្នកប្រើប្រាស់", + "IDR-IDC-009": "5XX - កំហុសមួយបានកើតឡើងដោយសារម៉ាស៉ីនមេ", + "IDR-IDC-010": "ការតភ្ជាប់បានបរាជ័យ", + "IDR-IDC-011": "ការត្រួតពិនិត្យបរាជ័យ", + "IDR-IDC-012": "កំណត់ត្រាមាននៅក្នុងមូលដ្ឋានទិន្នន័យរួចស្រាប់ហើយ", + "IDR-IDC-013": "ការធ្វើបច្ចុប្បន្នភាពលើសចំនួនកំណត់", + "IDR-IDC-014": "កំណត់ត្រា Handle មាននៅក្នុងមូលដ្ឋានទិន្នន័យរួចស្រាប់ហើយ", + "IDR-IDS-001": "អត្តសញ្ញាណមិនត្រឹមត្រូវ", + "IDR-IDS-002": "ជីវមាត្រមិនត្រឹមត្រូវ", + "IDR-IDS-003": "ការដោះការបំលែងកូដ ឬការបំលែងកូដដោយប្រើ Kernel Crypto Manager បានបរាជ័យ", + "IDR-IDS-004": "ការផ្ទុក ឬ ទាញយកឯកសារពី Object Store បានបរាជ័យ", + "IDR-IDS-005": "kernel Id Object validator មិនអាចកមណត់អត្តសញ្ញាណរបស់ Id Object", + "IDR-IDS-006": "រកមិនឃើញឯកសារនៅក្នុង Object Store", + "IDR-IDS-007": "ការទាញយកឯកសារពី kernel Masterdata បានបរាជ័យ", + "IDR-IDS-008": "ការទាញយក Id Schema ពី kernel Syncdata បានបរាជ័យ", + "IDR-IDS-009": "ការទាញយក template ពី bio extractor បានបរាជ័យ", + "IDR-IDS-010": "ការទាញយកទិន្នន័យពីលេខទូរសព្ទបានបរាជ័យ", + "IDR-IDS-011": "ការបង្កើត UIN បានបរាជ័យ", + "IDR-VID-001": "លេខទូរសព្ទ", + "IDR-VID-002": "ការបង្កើតលេខទូរសព្ទបានបរាជ័យ", + "IDR-VID-003": "មិនអាចបង្កើតលេខទូរសព្ទព្រោះខុសគោលការណ៍", + "IDR-VID-004": "UIN", + "IDR-VID-005": "មិនអាចទាញយកទិន្នន័យ uin ពី Identity Service", + "IDR-VID-006": "Uin មិនត្រឹមត្រូវ", + "IDR-IDS-012": "ការត្រួតពិនិត្យបានបរាជ័យ", + "IDR-BIE-001": "មានកំហុសបច្ចេកទេសពេលទាញយកទិន្នន័យជីវមាត្រ", + "IDR-CFJ-001": "ការបញ្ជាក់អត្តសញ្ញាណបានបរាជ័យ" } } diff --git a/signup-ui/src/pages/SignUpPage/AccountRegistrationStatus/components/AccountRegistrationStatusLayout.tsx b/signup-ui/src/pages/SignUpPage/AccountRegistrationStatus/components/AccountRegistrationStatusLayout.tsx index a2f00dc9..7e4535b6 100644 --- a/signup-ui/src/pages/SignUpPage/AccountRegistrationStatus/components/AccountRegistrationStatusLayout.tsx +++ b/signup-ui/src/pages/SignUpPage/AccountRegistrationStatus/components/AccountRegistrationStatusLayout.tsx @@ -23,7 +23,7 @@ export const AccountRegistrationStatusLayout = ({ const handleAction = (e: any) => { e.preventDefault(); - window.location.href = getSignInRedirectURL(settings?.response.configs["signin.redirect-url"], fromSignInHash); + window.location.href = getSignInRedirectURL(settings?.response.configs["signin.redirect-url"], fromSignInHash, "/signup"); }; return ( diff --git a/signup-ui/src/pages/SignUpPage/Phone/Phone.tsx b/signup-ui/src/pages/SignUpPage/Phone/Phone.tsx index fbc8ba06..ab558013 100644 --- a/signup-ui/src/pages/SignUpPage/Phone/Phone.tsx +++ b/signup-ui/src/pages/SignUpPage/Phone/Phone.tsx @@ -135,7 +135,7 @@ export const Phone = ({ settings, methods }: PhoneProps) => { {!!fromSignInHash && ( diff --git a/signup-ui/src/pages/SignUpPage/PhoneStatus/PhoneStatus.tsx b/signup-ui/src/pages/SignUpPage/PhoneStatus/PhoneStatus.tsx index 3f46197c..b3ebd1ee 100644 --- a/signup-ui/src/pages/SignUpPage/PhoneStatus/PhoneStatus.tsx +++ b/signup-ui/src/pages/SignUpPage/PhoneStatus/PhoneStatus.tsx @@ -44,7 +44,7 @@ export const PhoneStatus = ({ methods }: PhoneStatusProps) => { const handleChallengeVerificationErrorRedirect = (e: any) => { e.preventDefault(); - window.location.href = getSignInRedirectURL(settings?.response.configs["signin.redirect-url"], fromSignInHash); + window.location.href = getSignInRedirectURL(settings?.response.configs["signin.redirect-url"], fromSignInHash, "/signup"); }; const [challengeVerification] = useMutationState({ diff --git a/signup-ui/src/pages/SignUpPage/SignUpPopover.tsx b/signup-ui/src/pages/SignUpPage/SignUpPopover.tsx index 22a42938..47f8c513 100644 --- a/signup-ui/src/pages/SignUpPage/SignUpPopover.tsx +++ b/signup-ui/src/pages/SignUpPage/SignUpPopover.tsx @@ -33,7 +33,7 @@ export const SignUpPopover = () => { const handleAction = (e: any) => { e.preventDefault(); - window.location.href = getSignInRedirectURL(settings?.response.configs["signin.redirect-url"], fromSignInHash); + window.location.href = getSignInRedirectURL(settings?.response.configs["signin.redirect-url"], fromSignInHash, "/signup"); }; return ( diff --git a/signup-ui/src/utils/link.ts b/signup-ui/src/utils/link.ts index b0bcf301..b9c88477 100644 --- a/signup-ui/src/utils/link.ts +++ b/signup-ui/src/utils/link.ts @@ -1,10 +1,10 @@ import { Buffer } from "buffer"; -export const getSignInRedirectURL = (redirectUrl: string | undefined, hash: string): string => { +export const getSignInRedirectURL = (redirectUrl: string | undefined, hash: string, defaultPath: string): string => { if (!!hash) { const signInQueryParams = Buffer.from(hash ?? "", "base64")?.toString(); return redirectUrl + "?" + signInQueryParams; } - return "/"; + return defaultPath; };