Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injiver 829 error message translation #245

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/public/env.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ OVP_QR_HEADER: "INJI_OVP://",
DEFAULT_FAVICON: "favicon.ico",
INTERNET_CONNECTIVITY_CHECK_ENDPOINT: "https://dns.google/",
INTERNET_CONNECTIVITY_CHECK_TIMEOUT: "10000",
VERIFY_SERVICE_API_URL:"/v1/verify"
VERIFY_SERVICE_API_URL: "/v1/verify",
}
8 changes: 2 additions & 6 deletions ui/src/components/Home/VerificationSection/QrScanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ZOOM_STEP,
ScanSessionExpiryTime,
THROTTLE_FRAMES_PER_SEC,
AlertMessages,
} from "../../../utils/config";
import { useAppDispatch } from "../../../redux/hooks";
import {
Expand Down Expand Up @@ -142,12 +143,7 @@ function QrScanner() {
timer = setTimeout(() => {
dispatch(goToHomeScreen({}));
dispatch(
raiseAlert({
open: true,
message:
"The scan session has expired due to inactivity. Please initiate a new scan.",
severity: "error",
})
raiseAlert({ ...AlertMessages().scanSessionExpired, open: true })
);
}, ScanSessionExpiryTime);

Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "حجم الملف غير مدعوم. ",
"verificationMethodComingSoon": "قريباً",
"unsupportedFileType": "تنسيق الملف غير معتمد. ",
"pageNotFound": "الصفحة غير موجودة!!"
"pageNotFound": "الصفحة غير موجودة!!",
"scanSessionExpired": "انتهت صلاحية جلسة الفحص بسبب عدم النشاط. يرجى بدء فحص جديد."
},
"OvpErrors": {
"invalidScope": "النطاق غير صالح",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "نواجه مشكلة في معالجة طلبك. ",
"serverUnavailable": "الخدمة غير متوفرة حاليا. ",
"invalidVpToken": "أوراق الاعتماد لا تفي بالمتطلبات. ",
"unsupportedFormat": "تنسيقات VP غير مدعومة"
"unsupportedFormat": "تنسيقات VP غير مدعومة",
"invalidResources": "المورد المطلوب غير صالح.",
"invalidParams": "معلمات غير صالحة!!"
},
"CopyRight": {
"content": "2024 © موسيب - جميع الحقوق محفوظة."
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "File size not supported. The file size should be between 10 KB and 5 MB.",
"verificationMethodComingSoon": "Coming soon",
"unsupportedFileType": "Unsupported file format. Allowed file formats are: png, jpeg, jpg, pdf",
"pageNotFound": "Page Not Found!!"
"pageNotFound": "Page Not Found!!",
"scanSessionExpired": "The scan session has expired due to inactivity. Please initiate a new scan."
},
"OvpErrors": {
"invalidScope": "Invalid Scope",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "We're having trouble processing your request. Please try again later.",
"serverUnavailable": "The service is currently unavailable. Please try again later",
"invalidVpToken": "The credentials don't meet the requirements. Please check and try again.",
"unsupportedFormat": "VP Formats Not Supported"
"unsupportedFormat": "VP Formats Not Supported",
"invalidResources": "The requested resource is invalid.",
"invalidParams": "Invalid Parameters!!"
},
"CopyRight": {
"content": "2024 © MOSIP - All rights reserved."
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "El tamaño del archivo no es compatible. El tamaño del archivo debe estar entre 10 KB y 5 MB",
"verificationMethodComingSoon": "Muy pronto",
"unsupportedFileType": "Formato de archivo no compatible. Los formatos de archivo permitidos son: png, jpeg, jpg, pdf",
"pageNotFound": "¡¡Página no encontrada!!"
"pageNotFound": "¡¡Página no encontrada!!",
"scanSessionExpired": "La sesión de escaneo ha caducado debido a inactividad. Inicie un nuevo análisis."
},
"OvpErrors": {
"invalidScope": "Alcance no válido",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "Estamos teniendo problemas para procesar su solicitud. Vuelva a intentarlo más tarde",
"serverUnavailable": "El servicio no está disponible actualmente. Vuelva a intentarlo más tarde",
"invalidVpToken": "Las credenciales no cumplen con los requisitos. Verifique e inténtelo nuevamente",
"unsupportedFormat": "Formatos VP no admitidos"
"unsupportedFormat": "Formatos VP no admitidos",
"invalidResources": "El recurso solicitado no es válido.",
"invalidParams": "¡¡Parámetros no válidos!!"
},
"CopyRight": {
"content": "2024 © MOSIP - Todos los derechos reservados."
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "Taille de fichier non prise en charge. ",
"verificationMethodComingSoon": "À venir",
"unsupportedFileType": "Format de fichier non pris en charge. ",
"pageNotFound": "Page introuvable !!"
"pageNotFound": "Page introuvable !!",
"scanSessionExpired": "La session d'analyse a expiré pour cause d'inactivité. Veuillez lancer une nouvelle analyse."
},
"OvpErrors": {
"invalidScope": "Portée invalide",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "Nous rencontrons des difficultés pour traiter votre demande. ",
"serverUnavailable": "Le service est actuellement indisponible. ",
"invalidVpToken": "Les informations d'identification ne répondent pas aux exigences. ",
"unsupportedFormat": "Formats VP non pris en charge"
"unsupportedFormat": "Formats VP non pris en charge",
"invalidResources": "La ressource demandée n'est pas valide.",
"invalidParams": "Paramètres invalides !!"
},
"CopyRight": {
"content": "2024 © MOSIP - Tous droits réservés."
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "फ़ाइल का आकार समर्थित नहीं है. ",
"verificationMethodComingSoon": "जल्द आ रहा है",
"unsupportedFileType": "असमर्थित फ़ाइल स्वरूप। ",
"pageNotFound": "पृष्ठ नहीं मिला!!"
"pageNotFound": "पृष्ठ नहीं मिला!!",
"scanSessionExpired": "निष्क्रियता के कारण स्कैन सत्र समाप्त हो गया है। कृपया एक नया स्कैन आरंभ करें."
},
"OvpErrors": {
"invalidScope": "अमान्य दायरा",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "हमें आपका अनुरोध संसाधित करने में परेशानी हो रही है. ",
"serverUnavailable": "सेवा वर्तमान में अनुपलब्ध है. ",
"invalidVpToken": "क्रेडेंशियल आवश्यकताओं को पूरा नहीं करते. ",
"unsupportedFormat": "वीपी प्रारूप समर्थित नहीं हैं"
"unsupportedFormat": "वीपी प्रारूप समर्थित नहीं हैं",
"invalidResources": "अनुरोधित संसाधन अमान्य है.",
"invalidParams": "अमान्य मापदण्ड!!"
},
"CopyRight": {
"content": "2024 © MOSIP - सर्वाधिकार सुरक्षित।"
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "ទំហំឯកសារមិនត្រូវបានគាំទ្រ។ ទំហំឯកសារគួរមានចន្លោះពី 10 KB និង 5 MB",
"verificationMethodComingSoon": "មកដល់ឆាប់ៗនេះ",
"unsupportedFileType": "ទម្រង់ឯកសារមិនគាំទ្រ។ ទម្រង់ឯកសារដែលបានអនុញ្ញាតគឺ៖ png, jpeg, jpg, pdf",
"pageNotFound": "រកមិនឃើញទំព័រ!!"
"pageNotFound": "រកមិនឃើញទំព័រ!!",
"scanSessionExpired": "វគ្គស្កេនបានផុតកំណត់ដោយសារអសកម្ម។ សូមចាប់ផ្តើមការស្កេនថ្មី។"
},
"OvpErrors": {
"invalidScope": "វិសាលភាពមិនត្រឹមត្រូវ",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "យើងមានបញ្ហាក្នុងដំណើរការសំណើរបស់អ្នក។ សូមព្យាយាមម្តងទៀតពេលក្រោយ។",
"serverUnavailable": "សេវាកម្មបច្ចុប្បន្នមិនអាចប្រើបាន។ សូមព្យាយាមម្តងទៀតនៅពេលក្រោយ",
"invalidVpToken": "ព័ត៌មានបញ្ជាក់អត្តសញ្ញាណមិនបំពេញតាមតម្រូវការ។ សូមពិនិត្យ ហើយព្យាយាមម្តងទៀត។",
"unsupportedFormat": "ទម្រង់ VP មិនត្រូវបានគាំទ្រ"
"unsupportedFormat": "ទម្រង់ VP មិនត្រូវបានគាំទ្រ",
"invalidResources": "ធនធានដែលបានស្នើគឺមិនត្រឹមត្រូវ។",
"invalidParams": "ប៉ារ៉ាម៉ែត្រ​មិន​ត្រឹមត្រូវ!!"
},
"CopyRight": {
"content": "2024 © MOSIP - រក្សាសិទ្ធិគ្រប់យ៉ាង។"
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "ಫೈಲ್ ಗಾತ್ರವು ಬೆಂಬಲಿತವಾಗಿಲ್ಲ. ",
"verificationMethodComingSoon": "ಶೀಘ್ರದಲ್ಲೇ ಬರಲಿದೆ",
"unsupportedFileType": "ಬೆಂಬಲಿಸದ ಫೈಲ್ ಫಾರ್ಮ್ಯಾಟ್. ",
"pageNotFound": "ಪುಟ ಕಂಡುಬಂದಿಲ್ಲ!!"
"pageNotFound": "ಪುಟ ಕಂಡುಬಂದಿಲ್ಲ!!",
"scanSessionExpired": "ನಿಷ್ಕ್ರಿಯತೆಯಿಂದಾಗಿ ಸ್ಕ್ಯಾನ್ ಸೆಷನ್ ಅವಧಿ ಮೀರಿದೆ. ದಯವಿಟ್ಟು ಹೊಸ ಸ್ಕ್ಯಾನ್ ಅನ್ನು ಪ್ರಾರಂಭಿಸಿ."
},
"OvpErrors": {
"invalidScope": "ಅಮಾನ್ಯ ವ್ಯಾಪ್ತಿ",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "ನಿಮ್ಮ ವಿನಂತಿಯನ್ನು ಪ್ರಕ್ರಿಯೆಗೊಳಿಸುವಲ್ಲಿ ನಾವು ಸಮಸ್ಯೆಯನ್ನು ಎದುರಿಸುತ್ತಿದ್ದೇವೆ. ",
"serverUnavailable": "ಸೇವೆಯು ಪ್ರಸ್ತುತ ಲಭ್ಯವಿಲ್ಲ. ",
"invalidVpToken": "ರುಜುವಾತುಗಳು ಅವಶ್ಯಕತೆಗಳನ್ನು ಪೂರೈಸುವುದಿಲ್ಲ. ",
"unsupportedFormat": "VP ಫಾರ್ಮ್ಯಾಟ್‌ಗಳು ಬೆಂಬಲಿತವಾಗಿಲ್ಲ"
"unsupportedFormat": "VP ಫಾರ್ಮ್ಯಾಟ್‌ಗಳು ಬೆಂಬಲಿತವಾಗಿಲ್ಲ",
"invalidResources": "ವಿನಂತಿಸಿದ ಸಂಪನ್ಮೂಲವು ಅಮಾನ್ಯವಾಗಿದೆ.",
"invalidParams": "ಅಮಾನ್ಯ ಪ್ಯಾರಾಮೀಟರ್‌ಗಳು!!"
},
"CopyRight": {
"content": "2024 © MOSIP - ಎಲ್ಲಾ ಹಕ್ಕುಗಳನ್ನು ಕಾಯ್ದಿರಿಸಲಾಗಿದೆ."
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "Tamanho do arquivo não suportado. O tamanho do arquivo deve estar entre 10 KB e 5 MB.",
"verificationMethodComingSoon": "Em breve",
"unsupportedFileType": "Formato de arquivo não suportado. Os formatos de arquivo permitidos são: png, jpeg, jpg, pdf",
"pageNotFound": "Página não encontrada!!"
"pageNotFound": "Página não encontrada!!",
"scanSessionExpired": "A sessão de verificação expirou devido à inatividade. Por favor, inicie uma nova verificação."
},
"OvpErrors": {
"invalidScope": "Escopo inválido",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "Estamos com problemas para processar sua solicitação. Por favor, tente novamente mais tarde.",
"serverUnavailable": "O serviço não está disponível no momento. Tente novamente mais tarde.",
"invalidVpToken": "O serviço está indisponível no momento. Por favor, tente novamente mais tarde.",
"unsupportedFormat": "Formatos VP não suportados"
"unsupportedFormat": "Formatos VP não suportados",
"invalidResources": "O recurso solicitado é inválido.",
"invalidParams": "Parâmetros inválidos!!"
},
"CopyRight": {
"content": "2024 © MOSIP – Todos os direitos reservados."
Expand Down
7 changes: 5 additions & 2 deletions ui/src/locales/ta.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"unsupportedFileSize": "கோப்பு அளவு ஆதரிக்கப்படவில்லை. ",
"verificationMethodComingSoon": "விரைவில் வரும்",
"unsupportedFileType": "ஆதரிக்கப்படாத கோப்பு வடிவம். ",
"pageNotFound": "பக்கம் கிடைக்கவில்லை!!"
"pageNotFound": "பக்கம் கிடைக்கவில்லை!!",
"scanSessionExpired": "செயலற்ற தன்மை காரணமாக ஸ்கேன் அமர்வு காலாவதியானது. தயவுசெய்து புதிய ஸ்கேனைத் தொடங்கவும்."
},
"OvpErrors": {
"invalidScope": "தவறான நோக்கம்",
Expand All @@ -83,7 +84,9 @@
"internalServerError": "உங்கள் கோரிக்கையைச் செயல்படுத்துவதில் சிக்கல் உள்ளது. ",
"serverUnavailable": "சேவை தற்போது கிடைக்கவில்லை. ",
"invalidVpToken": "நற்சான்றிதழ்கள் தேவைகளைப் பூர்த்தி செய்யவில்லை. ",
"unsupportedFormat": "VP வடிவங்கள் ஆதரிக்கப்படவில்லை"
"unsupportedFormat": "VP வடிவங்கள் ஆதரிக்கப்படவில்லை",
"invalidResources": "கோரப்பட்ட ஆதாரம் தவறானது.",
"invalidParams": "தவறான அளவுருக்கள்!!"
},
"CopyRight": {
"content": "2024 © MOSIP - அனைத்து உரிமைகளும் பாதுகாக்கப்பட்டவை."
Expand Down
14 changes: 4 additions & 10 deletions ui/src/pages/OvpRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function OvpRedirect(props: any) {
const dispatch = useAppDispatch();

useEffect(() => {
let vpToken, presentationSubmission, error, errorDescription;
let vpToken, presentationSubmission, error;
try {
const params = new URLSearchParams(location.hash.substring(1));
const queryParams = new URLSearchParams(location.search.substring(1));
Expand All @@ -26,7 +26,6 @@ function OvpRedirect(props: any) {
: undefined;

error = queryParams.get("error");
errorDescription = queryParams.get("error_description");
}
catch (error) {
console.error("Error occurred while reading params in redirect url, Error: ", error);
Expand All @@ -37,15 +36,10 @@ function OvpRedirect(props: any) {
dispatch(verificationInit({ovp: {vpToken, presentationSubmission}}));
} else if (!!error) {
const OvpErrorMessages = OvpErrors();
dispatch(raiseAlert(
{
message: OvpErrorMessages[error]
?? errorDescription
?? "Something Went Wrong!!",
severity: "error"
}));
dispatch(raiseAlert({message: OvpErrorMessages.error ?? OvpErrorMessages[error] ?? OvpErrorMessages.resource_not_found, severity: "error"}));
} else {
dispatch(raiseAlert({message: "Invalid Parameters!!", severity: "error"}))
const OvpErrorMessages = OvpErrors();
dispatch(raiseAlert({message: OvpErrorMessages.invalid_params, severity: "error"}))
}
}
}, [location, navigate, dispatch]);
Expand Down
7 changes: 5 additions & 2 deletions ui/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export const AlertMessages =()=> {
unsupportedFileSize: {message: i18next.t("AlertMessages:unsupportedFileSize"), severity: "error"} as AlertInfo,
verificationMethodComingSoon: {message: i18next.t("AlertMessages:verificationMethodComingSoon"), severity: "warning"} as AlertInfo,
unsupportedFileType: {message: i18next.t("AlertMessages:unsupportedFileType"), severity: "error"} as AlertInfo,
pageNotFound: {message: i18next.t("AlertMessages:pageNotFound"), severity: "error"} as AlertInfo
pageNotFound: {message: i18next.t("AlertMessages:pageNotFound"), severity: "error"} as AlertInfo,
scanSessionExpired: {message: i18next.t("AlertMessages:scanSessionExpired"), severity: "error"} as AlertInfo
}
};

Expand All @@ -99,7 +100,9 @@ export const OvpErrors: any = () => {
internal_server_error: i18next.t("OvpErrors:internalServerError"),
server_unavailable: i18next.t("OvpErrors:serverUnavailable"),
invalid_vp_token: i18next.t("OvpErrors:invalidVpToken"),
unsupported_format: i18next.t("OvpErrors:unsupportedFormat")
unsupported_format: i18next.t("OvpErrors:unsupportedFormat"),
invalid_resource:i18next.t("OvpErrors:invalidResources"),
invalid_params:i18next.t("OvpErrors:invalidParams"),
};
};

Expand Down