From bed2a772329d3f503db4744297452c50417274f9 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 29 Jul 2024 20:32:59 +0530 Subject: [PATCH 01/28] feat: implement feature of multisupport language --- apps/OpenSign/package-lock.json | 93 ++++++++++++++++++- apps/OpenSign/package.json | 4 + .../public/locales/en/translation.json | 20 ++++ .../public/locales/fr/translation.json | 20 ++++ apps/OpenSign/src/i18n.js | 20 ++++ apps/OpenSign/src/index.js | 3 +- apps/OpenSign/src/pages/UserProfile.js | 53 +++++++++-- apps/OpenSign/src/script/PublicTemplate.js | 8 +- 8 files changed, 206 insertions(+), 15 deletions(-) create mode 100644 apps/OpenSign/public/locales/en/translation.json create mode 100644 apps/OpenSign/public/locales/fr/translation.json create mode 100644 apps/OpenSign/src/i18n.js diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index 7ba367ff7..bf1031f0b 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -15,6 +15,9 @@ "@reduxjs/toolkit": "^2.2.6", "axios": "^1.7.2", "file-saver": "^2.0.5", + "i18next": "^23.12.2", + "i18next-browser-languagedetector": "^8.0.0", + "i18next-http-backend": "^2.5.2", "jwt-decode": "^4.0.0", "moment": "^2.30.1", "nth-check": "^2.1.1", @@ -34,6 +37,7 @@ "react-dom": "^18.2.0", "react-gtm-module": "^2.0.11", "react-helmet": "^6.1.0", + "react-i18next": "^15.0.0", "react-konva": "^18.2.10", "react-pdf": "^9.1.0", "react-quill": "^2.0.0", @@ -2003,9 +2007,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", + "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -16579,6 +16583,14 @@ "node": ">= 12" } }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/htmlparser2": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", @@ -16739,6 +16751,52 @@ "resolved": "https://registry.npmjs.org/hyphen/-/hyphen-1.10.4.tgz", "integrity": "sha512-SejXzIpv9gOVdDWXd4suM1fdF1k2dxZGvuTdkOVLoazYfK7O4DykIQbdrvuyG+EaTNlXAGhMndtKrhykgbt0gg==" }, + "node_modules/i18next": { + "version": "23.12.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.12.2.tgz", + "integrity": "sha512-XIeh5V+bi8SJSWGL3jqbTEBW5oD6rbP5L+E7dVQh1MNTxxYef0x15rhJVcRb7oiuq4jLtgy2SD8eFlf6P2cmqg==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-browser-languagedetector": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.0.0.tgz", + "integrity": "sha512-zhXdJXTTCoG39QsrOCiOabnWj2jecouOqbchu3EfhtSHxIB5Uugnm9JaizenOy39h7ne3+fLikIjeW88+rgszw==", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-http-backend": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/i18next-http-backend/-/i18next-http-backend-2.5.2.tgz", + "integrity": "sha512-+K8HbDfrvc1/2X8jpb7RLhI9ZxBDpx3xogYkQwGKlWAUXLSEGXzgdt3EcUjLlBCdMwdQY+K+EUF6oh8oB6rwHw==", + "dependencies": { + "cross-fetch": "4.0.0" + } + }, + "node_modules/i18next-http-backend/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -24327,6 +24385,27 @@ "react": ">=16.3.0" } }, + "node_modules/react-i18next": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.0.tgz", + "integrity": "sha512-2O3IgF4zivg57Q6p6i+ChDgJ371IDcEWbuWC6gvoh5NbkDMs0Q+O7RPr4v61+Se32E0V+LmtwePAeqWZW0bi6g==", + "dependencies": { + "@babel/runtime": "^7.24.8", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 23.2.3", + "react": ">= 16.8.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -28410,6 +28489,14 @@ "node": ">= 6" } }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index 45295d609..4572be0b1 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -10,6 +10,9 @@ "@reduxjs/toolkit": "^2.2.6", "axios": "^1.7.2", "file-saver": "^2.0.5", + "i18next": "^23.12.2", + "i18next-browser-languagedetector": "^8.0.0", + "i18next-http-backend": "^2.5.2", "jwt-decode": "^4.0.0", "moment": "^2.30.1", "nth-check": "^2.1.1", @@ -29,6 +32,7 @@ "react-dom": "^18.2.0", "react-gtm-module": "^2.0.11", "react-helmet": "^6.1.0", + "react-i18next": "^15.0.0", "react-konva": "^18.2.10", "react-pdf": "^9.1.0", "react-quill": "^2.0.0", diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json new file mode 100644 index 000000000..61b9382ac --- /dev/null +++ b/apps/OpenSign/public/locales/en/translation.json @@ -0,0 +1,20 @@ +{ + "create-account": "Create account", + "login": "Login", + "language":"Language", + "name":"Name", + "phone":"Phone", + "email":"Email", + "company":"Company", + "job-title":"Job title", + "is-email-verified":"Is Email verified", + "public-profile":"Public profile", + "tagline":"Tagline ", + "has-requested-you-to-sign":"has requested you to sign", + "has-requested-you-to-review-and-sign":" has requested you to review and sign", + "ascending":"Ascending", + "Action":"Action", + "add":"add", + "add-new-folder":"ajouter un nouveau dossier" + } + \ No newline at end of file diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json new file mode 100644 index 000000000..7b0894916 --- /dev/null +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -0,0 +1,20 @@ +{ + "create account": "Créer un compte", + "login": "se connecter", + "language":"Langue", + "name":"Nom", + "phone":"Téléphone", + "email":"E-mail", + "company":"Entreprise", + "job-title":"Titre d'emploi", + "is-email-verified":"L'e-mail est-il vérifié", + "public-profile":"Profil public", + "tagline":"Slogan", + "has-requested-you-to-sign":" vous a demandé de signer", + "has-requested-you-to-review-and-sign":"vous a demandé de consulter et de signer", + "Ascending":"Ascendant", + "Action":"Action", + "add":"ajouter", + "add-new-folder":"add new folder" + } + \ No newline at end of file diff --git a/apps/OpenSign/src/i18n.js b/apps/OpenSign/src/i18n.js new file mode 100644 index 000000000..697dc3b08 --- /dev/null +++ b/apps/OpenSign/src/i18n.js @@ -0,0 +1,20 @@ +import i18n from "i18next"; +import { initReactI18next } from "react-i18next"; +import Backend from "i18next-http-backend"; +import LanguageDetector from "i18next-browser-languagedetector"; + +i18n + .use(Backend) + .use(LanguageDetector) + .use(initReactI18next) + .init({ + lng: "en", // Set English as the default language + fallbackLng: "en", // Fallback to English if no other language is detected + debug: true, + interpolation: { + escapeValue: false // Not needed for react as it escapes by default + }, + whitelist: ["en", "fr"] // List of allowed languages + }); + +export default i18n; diff --git a/apps/OpenSign/src/index.js b/apps/OpenSign/src/index.js index f11064560..4b6b18061 100644 --- a/apps/OpenSign/src/index.js +++ b/apps/OpenSign/src/index.js @@ -16,7 +16,8 @@ import { import DragElement from "./components/pdf/DragElement"; import TagManager from "react-gtm-module"; import Parse from "parse"; -import './polyfills' +import "./polyfills"; +import "./i18n"; const appId = process.env.REACT_APP_APPID ? process.env.REACT_APP_APPID : "opensign"; diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index df48555cf..d3228d5d8 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -16,9 +16,11 @@ import { import Upgrade from "../primitives/Upgrade"; import ModalUi from "../primitives/ModalUi"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; function UserProfile() { const navigate = useNavigate(); + const { t, i18n } = useTranslation(); let UserProfile = JSON.parse(localStorage.getItem("UserInformation")); let extendUser = JSON.parse(localStorage.getItem("Extand_Class")); const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); @@ -51,6 +53,12 @@ function UserProfile() { extendUser && extendUser?.[0]?.Tagline ); const [isTeam, setIsTeam] = useState(false); + const languages = [ + { value: "en", text: "English" }, + { value: "fr", text: "French" } + ]; + const [lang, setLang] = useState("en"); + useEffect(() => { getUserDetail(); }, []); @@ -303,6 +311,12 @@ function UserProfile() { setJobTitle(extendUser?.[0]?.JobTitle); setIsDisableDocId(extendUser?.[0]?.HeaderDocId); }; + // This function put query that helps to + // change the language + const handleChangeLang = (e) => { + setLang(e.target.value); + i18n.changeLanguage(e.target.value); + }; return ( @@ -360,7 +374,30 @@ function UserProfile() { editmode ? "py-1.5" : "py-2" }`} > - <span className="font-semibold">Name:</span>{" "} + <span className="font-semibold">{t("language")}:</span>{" "} + <select + value={lang} + onChange={handleChangeLang} + className="select select-bordered w-[30%] border-[1px] max-w-xs" + > + <option disabled selected> + select + </option> + {languages.map((item) => { + return ( + <option key={item.value} value={item.value}> + {item.text} + </option> + ); + })} + </select> + </li> + <li + className={`flex justify-between items-center border-t-[1px] border-gray-300 break-all ${ + editmode ? "py-1.5" : "py-2" + }`} + > + <span className="font-semibold">{t("name")}:</span>{" "} {editmode ? ( <input type="text" @@ -377,7 +414,7 @@ function UserProfile() { editmode ? "py-1.5" : "py-2" }`} > - <span className="font-semibold">Phone:</span>{" "} + <span className="font-semibold">{t("phone")}:</span>{" "} {editmode ? ( <input type="text" @@ -390,7 +427,7 @@ function UserProfile() { )} </li> <li className="flex justify-between items-center border-t-[1px] border-gray-300 py-2 break-all"> - <span className="font-semibold">Email:</span>{" "} + <span className="font-semibold">{t("email")}:</span>{" "} <span>{UserProfile && UserProfile.email}</span> </li> <li @@ -398,7 +435,7 @@ function UserProfile() { editmode ? "py-1.5" : "py-2" }`} > - <span className="font-semibold">Company:</span>{" "} + <span className="font-semibold">{t("company")}:</span>{" "} {editmode ? ( <input type="text" @@ -415,7 +452,7 @@ function UserProfile() { editmode ? "py-1.5" : "py-2" }`} > - <span className="font-semibold">Job title:</span>{" "} + <span className="font-semibold">{t("job-title")}:</span>{" "} {editmode ? ( <input type="text" @@ -428,7 +465,7 @@ function UserProfile() { )} </li> <li className="flex justify-between items-center border-t-[1px] border-gray-300 py-2 break-all"> - <span className="font-semibold">Is Email verified:</span>{" "} + <span className="font-semibold">{t("is-email-verified")}:</span>{" "} <span> {isEmailVerified ? ( "Verified" @@ -450,7 +487,7 @@ function UserProfile() { <> <li className="flex md:flex-row flex-col md:justify-between md:items-center border-t-[1px] border-gray-300 py-2 break-all"> <span className="font-semibold flex gap-1"> - Public profile :{" "} + {t("public-profile")} :{" "} <Tooltip maxWidth="max-w-[250px]" message={`This is your public URL. Copy or share it with the signer, and you will be able to see all your publicly set templates.`} @@ -486,7 +523,7 @@ function UserProfile() { </li> <li className="flex md:flex-row flex-col md:justify-between md:items-center border-t-[1px] border-gray-300 py-2 break-all"> <span className="font-semibold flex gap-1"> - Tagline :{" "} + {t("tagline")} :{" "} <Tooltip maxWidth="max-w-[250px]" message={`This Tagline will appear on your OpenSign public profile for ex. https://opensign.me/alex`} diff --git a/apps/OpenSign/src/script/PublicTemplate.js b/apps/OpenSign/src/script/PublicTemplate.js index 3ef08df4c..c76252f6b 100644 --- a/apps/OpenSign/src/script/PublicTemplate.js +++ b/apps/OpenSign/src/script/PublicTemplate.js @@ -18,9 +18,11 @@ const PublicScriptFileWrapper = ({ initialProps }) => { return <PdfRequestFiles {...props} />; }; -const appId = "legadranaxn"; -// "opensign"; -const serverUrl = "https://app.opensignlabs.com/api/app"; +const appId = + //"legadranaxn"; + "opensign"; +const serverUrl = "http://localhost:8080/app"; +//"https://app.opensignlabs.com/api/app"; // "https://staging-app.opensignlabs.com/api/app"; localStorage.setItem("baseUrl", `${serverUrl}/`); localStorage.setItem("parseAppId", appId); From 77cd52ca04cadddee6ee6dac98194172ea4e020e Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Tue, 30 Jul 2024 14:09:10 +0530 Subject: [PATCH 02/28] feat: appply multi-support language functionality on login,signup-page,sidebar menu --- .../public/locales/en/translation.json | 116 +++++++++++++++++- .../public/locales/fr/translation.json | 111 ++++++++++++++++- .../components/dashboard/DashboardButton.js | 6 +- .../src/components/dashboard/DashboardCard.js | 7 +- .../src/components/dashboard/GetDashboard.js | 2 +- apps/OpenSign/src/components/sidebar/Menu.js | 4 +- .../src/components/sidebar/SubMenu.js | 8 +- apps/OpenSign/src/pages/Form.js | 67 ++++------ apps/OpenSign/src/pages/Login.js | 31 ++--- apps/OpenSign/src/pages/Signup.js | 41 ++++--- apps/OpenSign/src/pages/UserProfile.js | 14 +-- .../src/primitives/GetReportDisplay.js | 6 +- apps/OpenSign/src/primitives/Upgrade.js | 4 +- 13 files changed, 322 insertions(+), 95 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 61b9382ac..0ec717b36 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -1,5 +1,5 @@ { - "create-account": "Create account", + "create-account": "Create Account", "login": "Login", "language":"Language", "name":"Name", @@ -15,6 +15,118 @@ "ascending":"Ascending", "Action":"Action", "add":"add", - "add-new-folder":"ajouter un nouveau dossier" + "add-new-folder":"ajouter un nouveau dossier", + "disable-documentId":"Disable DocumentId", + "edit":"Edit", + "change-password":"Change Password", + "save":"Save", + "cancel":"Cancel", + "upgrade-now":"Upgrade now", + "user":"User", + "public-profile-help": "This is your public URL. Copy or share it with the signer, and you will be able to see all your publicly set templates.", + "tagline-help":"This Tagline will appear on your OpenSign public profile for ex. https://opensign.me/alex", + "welcome":"Welcome Back!", + "Login-to-your-account":"Login to your account", + "password":"Password", + "forgot-password":"Forgot Password?", + "loading":"Loading...", + "sign-SSO":"Sign in with SSO", + "login-page":"Login Page", + "or":"OR", + "signup-page":"Signup page", + "password-length":"Password should be 8 characters long", + "password-case":"Password should contain uppercase letter, lowercase letter, digit", + "password-special-char":" Password should contain special character", + "agreee":"I agree to the", + "term":"Terms of Service", + "register":"Register", + "sidebar": { + "Dashboard": "Dashboard", + "Sign yourself": "Sign yourself", + "Request signatures":"Request signatures", + "Templates":"Templates", + "Templates-Children":{ + "Create template":"Create template", + "Manage templates": "Manage templates" + }, + "OpenSign™ Drive":"OpenSign™ Drive", + "Reports":"Reports", + "Reports-Children" :{ + "Need your sign": "Need your sign", + "In Progress": "In Progress", + "Completed":"Completed", + "Drafts": "Drafts", + "Declined": "Declined", + "Expired":"Expired", + "Contactbook":"Contactbook" + }, + "Settings": "Settings", + "Settings-Children":{ + "My Signature": "My Signature", + "API Token":"API Token", + "Webhook":"Webhook" + } + }, + "dashboard-card":{ + "Need your Signature":"Need your Signature", + "Out for signatures":"Out for Signatures" + }, + "report-name":{ + "Draft Documents":"Draft Documents", + "Need your sign":"Need your sign", + "In-progress documents":"In-progress documents", + "Completed Documents":"Completed Documents", + "Declined Documents":"Declined Documents", + "Expired Documents":"Expired Documents", + "Recently sent for signatures":"Recently sent for signatures", + "Recent signature requests":"Recent signature requests", + "Drafts":"Drafts", + "Contactbook":"Contactbook", + "Templates":"Templates" + }, + "report-heading":{ + "Sr.No":"Sr.No", + "Title":"Title", + "Email":"Email", + "Phone":"Phone", + "File":"File", + "Owner": "Owner", + "Signers":"Signers", + "Note": "Note", + "Folder": "Folder", + "Reason": "Reason" + + }, + "form-name":{ + "Sign Yourself":"Sign Yourself", + "Request Signatures":"Request Signatures", + "New Template":"New Template" + }, + "file-type":"pdf, png, jpg, jpeg", + "docx":"docx", + "file-selected":"file selected", + "template-title":"Template Title", + "document-title":"Document Title", + "description":"Description", + "time-to-complete":"Time To Complete (Days)", + "send-in-order":"Send In Order", + "send-in-order-help":{ + "p1":"Choose how you want the signing requests to be sent to the document signers:", + "p2":" Selecting this option will send the signing request to the first signer initially. Once the first signer completes their part, the next signer in the sequence will receive the request. This process continues until all signers have signed the document. This method ensures that the document is signed in a specific order.", + "p3":" Selecting this option will send the signing links to all signers simultaneously. Every signer can sign the document at their convenience, regardless of whether other signers have completed their signatures. This method is faster but does not enforce any signing order among the participants.", + "p4":" Select the option that best suits the needs of your document processing." + }, + "no":"No", + "auto-reminder":"Auto reminder", + "remind-once":" Remind once in every (Days)", + "next":"Next" + + + + + + + + } \ No newline at end of file diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 7b0894916..c97910054 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -1,5 +1,5 @@ { - "create account": "Créer un compte", + "create-account": "Créer un compte", "login": "se connecter", "language":"Langue", "name":"Nom", @@ -15,6 +15,111 @@ "Ascending":"Ascendant", "Action":"Action", "add":"ajouter", - "add-new-folder":"add new folder" - } + "add-new-folder":"add new folder", + "disable-documentId":"Désactiver l'ID de document", + "edit":"Modifier", + "change-password":"Changer le mot de passe", + "save":"Sauvegarder", + "cancel":"Annuler", + "upgrade-now":"Mettre à jour maintenant", + "user":"Utilisateur", + "public-profile-help":"Il s'agit de votre URL publique. Copiez-le ou partagez-le avec le signataire et vous pourrez voir tous vos modèles définis publiquement.", + "tagline-help":"Ce slogan apparaîtra sur votre profil public OpenSign par exemple. https://opensign.me/alex", + "welcome":"Content de te revoir!", + "Login-to-your-account" :"Connectez-vous à votre compte", + "password" :"Mot de passe", + "forgot-password":"Mot de passe oublié?", + "loading":"Chargement...", + "sign-SSO":"Connectez-vous avec SSO", + "login-page":"Page de connexion", + "or":"OU", + "signup-page":"Page d'inscription", + "password-length":"Le mot de passe doit être 8 Longs caractères", + "password-case":"Le mot de passe doit contenir lettre majuscule, lettre minuscule, chiffre", + "password-special-char":"Le mot de passe doit contenir un caractère spécial", + "agreee":"je suis d'accord avec le", + "term":"Conditions d'utilisation", + "register" :"Registre", + "sidebar": { + "Dashboard": "Tableau de bord", + "Sign yourself": "Signez-vous", + "Request signatures":"Demander des signatures", + "Templates":"Modèles", + "Templates-Children":{ + "Create template":"Créer un modèle", + "Manage templates": "Gérer les modèles" + }, + "OpenSign™ Drive":"Lecteur OpenSign™", + "Reports":"Rapports", + "Reports-Children" :{ + "Need your sign": "Besoin de votre signe", + "In Progress": "En cours", + "Completed":"Complété", + "Drafts": "Brouillons", + "Declined": "Diminué", + "Expired":"Expiré", + "Contactbook":"Carnet de contacts" + }, + "Settings": "Paramètres", + "Settings-Children":{ + "My Signature": "Ma signature", + "API Token":"Jeton API", + "Webhook":"Webhook" + } + }, + "dashboard-card":{ + "Need your Signature":"Besoin de votre signature", + "Out for signatures":"En quête de signatures" + }, + "report-name":{ + "Draft Documents":"Projets de documents", + "Need your sign":"Besoin de votre signe", + "In-progress documents":"Documents en cours", + "Completed Documents":"Documents complétés", + "Declined Documents":"Documents refusés", + "Expired Documents":"Documents expirés", + "Recently sent for signatures":"Récemment envoyé pour signature", + "Recent signature requests":"Demandes de signature récentes", + "Drafts":"Brouillons", + "Contactbook":"Carnet de contacts", + "Templates":"Modèles" + }, + "report-heading":{ + "Sr.No":"Sr. Non", + "Title":"Titre", + "Email":"E-mail", + "Phone":"Téléphone", + "File":"Déposer", + "Owner":"Propriétaire", + "Signers":"Signataires", + "Note": "Note", + "Folder":"Dossier", + "Reason": "Raison" + }, + "form-name":{ + "Sign Yourself":"Signez-vous", + "Request Signatures":"Demander des signatures", + "New Template":"Nouveau modèle" + }, + "file-type":"pdf, png, jpg, jpeg", + "docx":"docx", + "file-selected":"fichier sélectionné", + "template-title":"Titre du modèle", + "document-title":"Titre du document", + "description":"Description", + "time-to-complete":"Temps de réalisation (jours)", + "send-in-order":"Envoyer dans la commande", + "send-in-order-help":{ + "p1":"Choisissez la manière dont vous souhaitez que les demandes de signature soient envoyées aux signataires du document :", + "p2":"La sélection de cette option enverra initialement la demande de signature au premier signataire. Une fois que le premier signataire a terminé sa partie, le prochain signataire de la séquence recevra la demande. Ce processus se poursuit jusqu'à ce que tous les signataires aient signé le document. Cette méthode garantit que le document est signé dans un ordre spécifique.", + "p3":"La sélection de cette option enverra les liens de signature à tous les signataires simultanément. Chaque signataire peut signer le document à sa convenance, que d'autres signataires aient ou non complété leur signature. Cette méthode est plus rapide mais n’impose aucun ordre de signature entre les participants.", + "p4":"Sélectionnez l'option qui correspond le mieux aux besoins de votre traitement de documents." + }, + "no":"Non", + "auto-reminder":"Rappel automatique", + "remind-once":"Rappeler une fois tous les (jours)", + "next":"suivant" + + +} \ No newline at end of file diff --git a/apps/OpenSign/src/components/dashboard/DashboardButton.js b/apps/OpenSign/src/components/dashboard/DashboardButton.js index 1d78fac0e..078475525 100644 --- a/apps/OpenSign/src/components/dashboard/DashboardButton.js +++ b/apps/OpenSign/src/components/dashboard/DashboardButton.js @@ -1,9 +1,11 @@ import React from "react"; import { useNavigate } from "react-router-dom"; import { openInNewTab } from "../../constant/Utils"; +import { useTranslation } from "react-i18next"; const DashboardButton = (props) => { const navigate = useNavigate(); + const { t } = useTranslation(); function openReport() { if (props.Data && props.Data.Redirect_type) { @@ -35,7 +37,9 @@ const DashboardButton = (props) => { } text-[25px] lg:text-[30px]`} ></i> </span> - <div className=" text-lg ml-3 text-base-content">{props.Label}</div> + <div className=" text-lg ml-3 text-base-content"> + {t(`sidebar.${props.Label}`)} + </div> </div> </div> ); diff --git a/apps/OpenSign/src/components/dashboard/DashboardCard.js b/apps/OpenSign/src/components/dashboard/DashboardCard.js index f8017ac91..2cbe187b1 100644 --- a/apps/OpenSign/src/components/dashboard/DashboardCard.js +++ b/apps/OpenSign/src/components/dashboard/DashboardCard.js @@ -4,9 +4,11 @@ import Parse from "parse"; import getReplacedHashQuery from "../../constant/getReplacedHashQuery"; import { useNavigate } from "react-router-dom"; import Tooltip from "../../primitives/Tooltip"; +import { useTranslation } from "react-i18next"; const DashboardCard = (props) => { const navigate = useNavigate(); + const { t } = useTranslation(); const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); const [parseAppId] = useState(localStorage.getItem("parseAppId")); const [response, setresponse] = useState(""); @@ -321,6 +323,7 @@ const DashboardCard = (props) => { } } } + return ( <div onClick={() => openReport()} @@ -339,7 +342,9 @@ const DashboardCard = (props) => { ></i> </span> <div className="font-medium"> - <div className="text-base lg:text-lg"> {props.Label}</div> + <div className="text-base lg:text-lg"> + {t(`dashboard-card.${props.Label}`)} + </div> <div className="text-2xl font-light"> {loading ? <div className="loader-01"></div> : setFormat(response)} </div> diff --git a/apps/OpenSign/src/components/dashboard/GetDashboard.js b/apps/OpenSign/src/components/dashboard/GetDashboard.js index 545b79191..ab0c3885e 100644 --- a/apps/OpenSign/src/components/dashboard/GetDashboard.js +++ b/apps/OpenSign/src/components/dashboard/GetDashboard.js @@ -10,7 +10,7 @@ const buttonList = [ icon: "fa-light fa-pen-nib" }, { - label: "Request signature", + label: "Request signatures", redirectId: "8mZzFxbG1z", redirectType: "Form", icon: "fa-light fa-paper-plane" diff --git a/apps/OpenSign/src/components/sidebar/Menu.js b/apps/OpenSign/src/components/sidebar/Menu.js index c43326da1..c8cf57e8d 100644 --- a/apps/OpenSign/src/components/sidebar/Menu.js +++ b/apps/OpenSign/src/components/sidebar/Menu.js @@ -1,7 +1,9 @@ import React from "react"; +import { useTranslation } from "react-i18next"; import { NavLink } from "react-router-dom"; const Menu = ({ item, isOpen, closeSidebar }) => { + const { t } = useTranslation(); return ( <li key={item.title} role="none" className="my-0.5"> <NavLink @@ -20,7 +22,7 @@ const Menu = ({ item, isOpen, closeSidebar }) => { role="menuitem" > <i className={`${item.icon} text-[18px]`} aria-hidden="true"></i> - <span className="ml-3 lg:ml-4">{item.title}</span> + <span className="ml-3 lg:ml-4">{t(`sidebar.${item.title}`)}</span> </NavLink> </li> ); diff --git a/apps/OpenSign/src/components/sidebar/SubMenu.js b/apps/OpenSign/src/components/sidebar/SubMenu.js index 59ca38beb..2ad5e3dbe 100644 --- a/apps/OpenSign/src/components/sidebar/SubMenu.js +++ b/apps/OpenSign/src/components/sidebar/SubMenu.js @@ -1,7 +1,9 @@ import React from "react"; +import { useTranslation } from "react-i18next"; import { NavLink } from "react-router-dom"; const Submenu = ({ item, closeSidebar, toggleSubmenu, submenuOpen }) => { + const { t } = useTranslation(); const { title, icon, children } = item; return ( <li role="none" className="my-0.5"> @@ -14,7 +16,7 @@ const Submenu = ({ item, closeSidebar, toggleSubmenu, submenuOpen }) => { > <i className={`${icon} text-[18px]`}></i> <div className="flex justify-between items-center w-full"> - <span className="ml-3 lg:ml-4">{title}</span> + <span className="ml-3 lg:ml-4">{t(`sidebar.${item.title}`)}</span> <i className={`${ submenuOpen[item.title] @@ -48,7 +50,9 @@ const Submenu = ({ item, closeSidebar, toggleSubmenu, submenuOpen }) => { className={`${childItem.icon} text-[18px]`} aria-hidden="true" ></i> - <span className="ml-3 lg:ml-4">{childItem.title}</span> + <span className="ml-3 lg:ml-4"> + {t(`sidebar.${item.title}-Children.${childItem.title}`)} + </span> </NavLink> </li> ))} diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.js index 7b746611e..d06ba09a6 100644 --- a/apps/OpenSign/src/pages/Form.js +++ b/apps/OpenSign/src/pages/Form.js @@ -19,6 +19,7 @@ import ModalUi from "../primitives/ModalUi"; import { Tooltip } from "react-tooltip"; import Upgrade from "../primitives/Upgrade"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; // `Form` render all type of Form on this basis of their provided in path function Form() { @@ -37,6 +38,7 @@ function Form() { } const Forms = (props) => { + const { t } = useTranslation(); const maxFileSize = 20; const abortController = new AbortController(); const inputFileRef = useRef(null); @@ -616,7 +618,9 @@ const Forms = (props) => { </form> </ModalUi> <form onSubmit={handleSubmit}> - <h1 className="text-[20px] font-semibold mb-4">{props?.title}</h1> + <h1 className="text-[20px] font-semibold mb-4"> + {t(`form-name.${props?.title}`)} + </h1> {fileload && ( <div className="flex items-center gap-x-2"> <div className="h-2 rounded-full w-[200px] md:w-[400px] bg-gray-200"> @@ -637,7 +641,7 @@ const Forms = (props) => { )} <div className="text-xs"> <label className="block"> - {`File (pdf, png, jpg, jpeg${ + {`${t("report-heading.File")} (${t("file-type")} ${ isEnableSubscription ? ", docx)" : ")" }`} <span className="text-red-500 text-[13px]">*</span> @@ -646,7 +650,7 @@ const Forms = (props) => { <div className="flex gap-2 justify-center items-center"> <div className="flex justify-between items-center op-input op-input-bordered op-input-sm w-full h-full text-[13px]"> <div className="break-all"> - file selected: {getFileName(fileupload)} + {t("file-selected")}: {getFileName(fileupload)} </div> <div onClick={() => setFileUpload("")} @@ -688,8 +692,8 @@ const Forms = (props) => { <div className="text-xs mt-2"> <label className="block"> {props.title === "New Template" - ? "Template Title" - : "Document Title"} + ? t("template-title") + : t("document-title")} <span className="text-red-500 text-[13px]">*</span> </label> <input @@ -702,7 +706,7 @@ const Forms = (props) => { </div> {props.title === "New Template" && ( <div className="text-xs mt-2"> - <label className="block">Description</label> + <label className="block">{t("description")}</label> <input name="Description" className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -720,7 +724,8 @@ const Forms = (props) => { )} <div className="text-xs mt-2"> <label className="block"> - Note<span className="text-red-500 text-[13px]">*</span> + {t("report-heading.Note")} + <span className="text-red-500 text-[13px]">*</span> </label> <input name="Note" @@ -740,7 +745,7 @@ const Forms = (props) => { {props.title === "Request Signatures" && ( <div className="text-xs mt-2"> <label className="block"> - Time To Complete (Days) + {t("time-to-complete")} <span className="text-red-500 text-[13px]">*</span> </label> <input @@ -757,7 +762,7 @@ const Forms = (props) => { <> <div className="text-xs mt-2"> <label className="block"> - Send In Order + {t("send-in-order")} <a data-tooltip-id="sendInOrder-tooltip" className="ml-1"> <sup> <i className="fa-light fa-question rounded-full border-[#33bbff] text-[#33bbff] text-[13px] border-[1px] py-[1.5px] px-[4px]"></i> @@ -765,44 +770,21 @@ const Forms = (props) => { </a> <Tooltip id="sendInOrder-tooltip" className="z-50"> <div className="max-w-[200px] md:max-w-[450px]"> - <p className="font-bold">Send in Order</p> - <p> - Choose how you want the signing requests to be sent to - the document signers: - </p> + <p className="font-bold">{t("send-in-order")}</p> + <p>{t("send-in-order-help.p1")}</p> <p className="p-[5px]"> <ol className="list-disc"> <li> <span className="font-bold">Yes:</span> - <span> - Selecting this option will send the signing - request to the first signer initially. Once the - first signer completes their part, the next - signer in the sequence will receive the request. - This process continues until all signers have - signed the document. This method ensures that - the document is signed in a specific order. - </span> + <span>{t("send-in-order-help.p2")}</span> </li> <li> <span className="font-bold">No: </span> - <span> - Selecting this option will send the signing - links to all signers simultaneously. Every - signer can sign the document at their - convenience, regardless of whether other signers - have completed their signatures. This method is - faster but does not enforce any signing order - among the participants. - </span> + <span>{t("send-in-order-help.p3")}</span> </li> </ol> </p> - - <p> - Select the option that best suits the needs of your - document processing. - </p> + <p>{t("send-in-order-help.p4")}</p> </div> </Tooltip> </label> @@ -826,7 +808,7 @@ const Forms = (props) => { checked={formData.SendinOrder === "false"} onChange={handleStrInput} /> - <div className="text-center">No</div> + <div className="text-center">{t("no")}</div> </div> </div> {isEnableSubscription && ( @@ -838,7 +820,8 @@ const Forms = (props) => { : "font-semibold text-gray-300" } > - Auto reminder{" "} + {t("auto-reminder")} + {" "} {!isSubscribe && isEnableSubscription && <Upgrade />} </span> <label @@ -860,7 +843,7 @@ const Forms = (props) => { {formData?.autoreminder === true && ( <div className="text-xs mt-2"> <label className="block"> - Remind once in every (Days) + {t("remind-once")} <span className="text-red-500 text-[13px]">*</span> </label> <input @@ -883,13 +866,13 @@ const Forms = (props) => { type="submit" disabled={isSubmit} > - Next + {t("next")} </button> <div className="op-btn op-btn-ghost" onClick={() => handleCancel()} > - Cancel + {t("cancel")} </div> </div> </form> diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index a2cc612f6..4df8dd688 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -16,7 +16,9 @@ import { fetchAppInfo } from "../redux/reducers/infoReducer"; import { showTenant } from "../redux/reducers/ShowTenant"; import { fetchSubscription, getAppLogo, openInNewTab } from "../constant/Utils"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; function Login() { + const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -605,7 +607,7 @@ function Login() { }; return ( <div> - <Title title={"Login Page"} /> + <Title title={t("login-page")} /> {state.loading && ( <div aria-live="assertive" @@ -634,14 +636,14 @@ function Login() { <div className="grid grid-cols-1 md:grid-cols-2 gap-x-2"> <div> <form onSubmit={handleSubmit} aria-label="Login Form"> - <h1 className="text-[30px] mt-6">Welcome Back!</h1> + <h1 className="text-[30px] mt-6">{t("welcome")}</h1> <fieldset> <legend className="text-[12px] text-[#878787]"> - Login to your account + {t("Login-to-your-account")} </legend> <div className="w-full px-6 py-3 my-1 op-card bg-base-100 shadow-md outline outline-1 outline-slate-300/50"> <label className="block text-xs" htmlFor="email"> - Email + {t("email")} </label> <input id="email" @@ -657,7 +659,7 @@ function Login() { {!isLoginSSO && ( <> <label className="block text-xs" htmlFor="password"> - Password + {t("password")} </label> <div className="relative"> <input @@ -690,7 +692,7 @@ function Login() { to="/forgetpassword" className="text-[13px] op-link op-link-primary underline-offset-1 focus:outline-none ml-1" > - Forgot Password? + {t("forgot-password")} </NavLink> </div> </div> @@ -701,7 +703,7 @@ function Login() { className="op-btn op-btn-primary" disabled={state.loading} > - {state.loading ? "Loading..." : "Login"} + {state.loading ? t("loading") : t("login")} </button> {isEnableSubscription && ( <button @@ -716,13 +718,13 @@ function Login() { ) } > - Create Account + {t("create-account")} </button> )} </div> </form> {(appInfo.googleClietId || isEnableSubscription) && ( - <div className="op-divider my-4 text-sm">OR</div> + <div className="op-divider my-4 text-sm">{t("or")}</div> )} <div className="flex flex-col justify-center items-center gap-y-3"> {/* {appInfo?.fbAppId && ( @@ -746,7 +748,7 @@ function Login() { className="cursor-pointer border-[1px] border-gray-300 rounded px-[40px] py-2 font-semibold text-sm hover:border-[#d2e3fc] hover:bg-[#ecf3feb7]" onClick={() => handleSignInWithSSO()} > - Sign in with SSO + {t("sign-SSO")} </div> )} </div> @@ -778,7 +780,8 @@ function Login() { style={{ display: "flex" }} className="block text-xs text-gray-700 font-semibold" > - Company <span className="text-[red] text-[13px]">*</span> + {t("company")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="text" @@ -800,7 +803,7 @@ function Login() { style={{ display: "flex" }} className="block text-xs text-gray-700 font-semibold" > - Job Title + {t("job-title")} <span className="text-[red] text-[13px]">*</span> </label> <input @@ -823,14 +826,14 @@ function Login() { className="op-btn op-btn-primary" onClick={(e) => handleSubmitbtn(e)} > - Login + {t("login")} </button> <button type="button" className="op-btn op-btn-ghost" onClick={logOutUser} > - Cancel + {t("cancel")} </button> </div> </form> diff --git a/apps/OpenSign/src/pages/Signup.js b/apps/OpenSign/src/pages/Signup.js index 916360548..0b0a97fc2 100644 --- a/apps/OpenSign/src/pages/Signup.js +++ b/apps/OpenSign/src/pages/Signup.js @@ -13,8 +13,10 @@ import { showTenant } from "../redux/reducers/ShowTenant"; import { isEnableSubscription } from "../constant/const"; import { getAppLogo, openInNewTab } from "../constant/Utils"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const Signup = () => { const { width } = useWindowSize(); + const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -322,7 +324,7 @@ const Signup = () => { <Loader /> </div> )} - <Title title={"Signup page"} /> + <Title title={t("signup-page")} /> {appInfo && appInfo.applogo ? ( <div className="md:p-10 lg:p-16"> <div className="md:p-4 lg:p-10 p-4 bg-base-100 text-base-content op-card"> @@ -334,11 +336,12 @@ const Signup = () => { <div className="grid grid-cols-1 md:grid-cols-2 gap-x-2"> <div> <form onSubmit={handleSubmit}> - <h2 className="text-[30px] mt-6">Create Account !</h2> + <h2 className="text-[30px] mt-6">{t("create-account")}!</h2> <div className="w-full my-4 op-card bg-base-100 shadow-md outline outline-1 outline-slate-300/50"> <div className="px-6 py-4 text-xs"> <label className="block "> - Name <span className="text-[red] text-[13px]">*</span> + {t("name")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="text" @@ -349,7 +352,8 @@ const Signup = () => { /> <hr className="my-2 border-none" /> <label> - Email <span className="text-[red] text-[13px]">*</span> + {t("email")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input id="email" @@ -363,7 +367,8 @@ const Signup = () => { /> <hr className="my-2 border-none" /> <label> - Phone <span className="text-[red] text-[13px]">*</span> + {t("phone")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="tel" @@ -374,7 +379,7 @@ const Signup = () => { /> <hr className="my-2 border-none" /> <label> - Company{" "} + {t("company")}{" "} <span className="text-[red] text-[13px]">*</span> </label> <input @@ -386,7 +391,7 @@ const Signup = () => { /> <hr className="my-2 border-none" /> <label> - Job Title{" "} + {t("job-title")}{" "} <span className="text-[red] text-[13px]">*</span> </label> <input @@ -398,7 +403,7 @@ const Signup = () => { /> <hr className="my-2 border-none" /> <label> - Password{" "} + {t("password")}{" "} <span className="text-[red] text-[13px]">*</span> </label> <div className="relative"> @@ -428,16 +433,16 @@ const Signup = () => { lengthValid ? "text-green-600" : "text-red-600" }`} > - {lengthValid ? "✓" : "✗"} Password should be 8 - characters long + {lengthValid ? "✓" : "✗"} + {t("password-length")} </p> <p className={`${ caseDigitValid ? "text-green-600" : "text-red-600" }`} > - {caseDigitValid ? "✓" : "✗"} Password should contain - uppercase letter, lowercase letter, digit + {caseDigitValid ? "✓" : "✗"} + {t("password-case")} </p> <p className={`${ @@ -446,8 +451,8 @@ const Signup = () => { : "text-red-600" }`} > - {specialCharValid ? "✓" : "✗"} Password should - contain special character + {specialCharValid ? "✓" : "✗"}{" "} + {t("password-special-char")} </p> </div> )} @@ -464,7 +469,7 @@ const Signup = () => { className="text-xs cursor-pointer ml-1 mb-0" htmlFor="termsandcondition" > - I agree to the + {t("agreee")} </label> <span className="underline cursor-pointer ml-1" @@ -474,7 +479,7 @@ const Signup = () => { ) } > - Terms of Service + {t("term")} </span> <span>.</span> </div> @@ -486,7 +491,7 @@ const Signup = () => { className="op-btn op-btn-primary" disabled={state.loading} > - {state.loading ? "Loading..." : "Register"} + {state.loading ? t("loading") : t("register")} </button> <button type="button" @@ -496,7 +501,7 @@ const Signup = () => { navigate(location.search ? "/" + location.search : "/") } > - Login + {t("login")} </button> </div> </form> diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index d3228d5d8..0781094af 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -378,7 +378,7 @@ function UserProfile() { <select value={lang} onChange={handleChangeLang} - className="select select-bordered w-[30%] border-[1px] max-w-xs" + className="select select-bordered w-[30%] border-[1px] rounded-lg p-2 max-w-xs" > <option disabled selected> select @@ -490,7 +490,7 @@ function UserProfile() { {t("public-profile")} :{" "} <Tooltip maxWidth="max-w-[250px]" - message={`This is your public URL. Copy or share it with the signer, and you will be able to see all your publicly set templates.`} + message={t("public-profile-help")} /> </span> <div className="flex md:flex-row flex-col md:items-center"> @@ -526,7 +526,7 @@ function UserProfile() { {t("tagline")} :{" "} <Tooltip maxWidth="max-w-[250px]" - message={`This Tagline will appear on your OpenSign public profile for ex. https://opensign.me/alex`} + message={t("tagline-help")} /> </span> <div className="flex md:flex-row flex-col md:items-center"> @@ -558,7 +558,7 @@ function UserProfile() { isTeam ? "font-semibold" : "font-semibold text-gray-300" } > - Disable DocumentId :{" "} + {t("disable-documentId")} :{" "} <Tooltip url={ "https://docs.opensignlabs.com/docs/help/Settings/disabledocumentid" @@ -605,7 +605,7 @@ function UserProfile() { }} className="op-btn op-btn-primary" > - {editmode ? "Save" : "Edit"} + {editmode ? t("save") : t("edit")} </button> <button type="button" @@ -616,7 +616,7 @@ function UserProfile() { editmode ? "op-btn-ghost" : "op-btn-secondary" }`} > - {editmode ? "Cancel" : "Change Password"} + {editmode ? t("cancel") : t("change-password")} </button> </div> </div> @@ -682,7 +682,7 @@ function UserProfile() { onClick={() => navigate("/subscription")} className="op-btn op-btn-accent" > - Upgrade Now + {t("upgrade-now")} </button> </div> </div> diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index 533fbc671..fea0e0f82 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -27,8 +27,10 @@ import BulkSendUi from "../components/BulkSendUi"; import Loader from "./Loader"; import Select from "react-select"; import SubscribeCard from "./SubscribeCard"; +import { useTranslation } from "react-i18next"; const ReportTable = (props) => { + const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const isDashboard = @@ -1071,7 +1073,7 @@ const ReportTable = (props) => { )} <div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]"> <div className="font-light"> - {props.ReportName}{" "} + {t(`report-name.${props.ReportName}`)} {props.report_help && ( <span className="text-xs md:text-[13px] font-normal"> <Tooltip message={props.report_help} /> @@ -1104,7 +1106,7 @@ const ReportTable = (props) => { <tr className="border-y-[1px]"> {props.heading?.map((item, index) => ( <React.Fragment key={index}> - <th className="px-4 py-2">{item}</th> + <th className="px-4 py-2">{t(`report-heading.${item}`)}</th> </React.Fragment> ))} {props.ReportName === "Templates" && isEnableSubscription && ( diff --git a/apps/OpenSign/src/primitives/Upgrade.js b/apps/OpenSign/src/primitives/Upgrade.js index baaca3121..aa6100b7c 100644 --- a/apps/OpenSign/src/primitives/Upgrade.js +++ b/apps/OpenSign/src/primitives/Upgrade.js @@ -1,7 +1,9 @@ import React from "react"; import { openInNewTab } from "../constant/Utils"; +import { useTranslation } from "react-i18next"; function Upgrade({ message }) { + const { t } = useTranslation(); return ( <sup> <span @@ -11,7 +13,7 @@ function Upgrade({ message }) { }} className="op-link op-link-accent text-sm" > - {message ? message : "Upgrade now"} + {message ? message : t("upgrade-now")} </span> </sup> ); From 779d5df2644ffc8ad5cf2cd0ec33b8678e9880f8 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Tue, 30 Jul 2024 20:02:32 +0530 Subject: [PATCH 03/28] feat: appply multi-support language functionality on report, managesign, webhook,api token --- .../public/locales/en/translation.json | 71 ++++++++++++++++++- .../public/locales/fr/translation.json | 68 +++++++++++++++++- apps/OpenSign/src/components/AddSigner.js | 14 ++-- .../src/components/pdf/RenderAllPdfPage.js | 6 +- .../src/components/pdf/VerifyEmail.js | 16 +++-- .../components/shared/fields/CreateFolder.js | 13 ++-- .../components/shared/fields/SelectFolder.js | 31 ++++---- .../components/shared/fields/SignersInput.js | 15 ++-- apps/OpenSign/src/pages/GenerateToken.js | 27 +++---- apps/OpenSign/src/pages/Managesign.js | 18 ++--- apps/OpenSign/src/pages/SignyourselfPdf.js | 16 ++--- apps/OpenSign/src/pages/UserProfile.js | 5 +- apps/OpenSign/src/pages/Webhook.js | 22 +++--- .../src/primitives/GetReportDisplay.js | 2 +- 14 files changed, 234 insertions(+), 90 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 0ec717b36..5511ae483 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -95,8 +95,17 @@ "Note": "Note", "Folder": "Folder", "Reason": "Reason" - - }, + }, + "report-help":{ + "Draft Documents": "These are documents you have started but have not finalized for sending.", + "Need your sign":"This is a list of documents that are waiting for your signature", + "In-progress documents": "This is a list of documents you've sent to other parties for signature.", + "Completed Documents":"This is a list of documents that have been signed by all parties.", + "Declined Documents": "This is a list of documents that have been declined by one of the signers.", + "Expired Documents":"This is a list of documents that have reached their expiration date.", + "Contactbook":"This is a list of contacts/signers added by you. These will appear as suggestions when you try to add signers to a new document.", + "Templates" :"This is a list of templates that are available to you for creating documents. You can click the 'use' button to create a new document using a template, modify the document & add signers in the next step." + }, "form-name":{ "Sign Yourself":"Sign Yourself", "Request Signatures":"Request Signatures", @@ -119,7 +128,63 @@ "no":"No", "auto-reminder":"Auto reminder", "remind-once":" Remind once in every (Days)", - "next":"Next" + "next":"Next", + "select-folder":"Select Folder", + "OpenSign-drive":"OpenSign™ Drive", + "select-folder-help" :"If you do not select a folder, your signed document will be saved in the Main OpenSign drive folder.", + "no-data":"No data found", + "save-here":"Save Here", + "back":"Back", + "add-folder":"Add folder", + "create-folder":"Create Folder", + "parent-folder":"Parent Folder", + "create":"Create", + "Signers":"Signers", + "signers-help":"Begin typing a contact's name to see suggested signers from your saved contacts or add new ones. Arrange the signing order by adding signers in the desired sequence. Use the '+' button to include signers and the 'x' to remove them. Each signer will receive an email prompt to sign the document in the order listed.", + "add-signer":"Add Signer", + "contact-not-found":"Contact not found", + "add-yourself":"Add Yourself", + "submit":"Submit", + "reset":"Reset", + "my-signature":"My Signature", + "signature":"Signature", + "upload-image":" Upload image", + "clear":"Clear", + "upload-signature/Image":"Please upload signature/Image", + "initials":"Initials", + "API" :"API", + "api-token":"API Token", + "regenerate-token":"Regenerate Token", + "generate-token":"Generate Token", + "view-docs":"View Docs", + "generate-token-alert" :"Are you sure you want to regenerate token it will expire old token?", + "yes":"Yes", + "copied":"Copied", + "wrong-mssg":"Something went wrong.", + "token-generated":"Token generated successfully.", + "webhook":"Webhook", + "update-webhook":"Update Webhook", + "add-webhook":"Add Webhook", + "webhook-added" :"Webhook added successfully.", + "document-signature":{ + "loader":" This might take some time", + "pages":"Pages", + "document-signed":"Document signed", + "close":"Close", + "validation-alert":"Validation alert", + "validate-alert-mssg" :" The input does not meet the criteria set by the regular expression.", + "otp-verification":"OTP verification", + "enter-otp":"Enter OTP", + "verify":"Verify", + "resend":"Resend", + "verify-email":"Please verify your email !", + "send-otp":" Send OTP", + "otp-placeholder":"Enter OTP received over email", + "loading-doc":"Loading Document.." + } + + + diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index c97910054..a71bca04d 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -1,4 +1,4 @@ -{ + { "create-account": "Créer un compte", "login": "se connecter", "language":"Langue", @@ -96,6 +96,16 @@ "Folder":"Dossier", "Reason": "Raison" }, + "report-help":{ + "Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.", + "Need your sign": "Voici une liste de documents qui attendent votre signature", + "In-progress documents": "Il s'agit d'une liste de documents que vous avez envoyés à d'autres parties pour signature.", + "Completed Documents": "Il s'agit d'une liste de documents signés par toutes les parties.", + "Declined Documents": "Il s'agit d'une liste de documents qui ont été refusés par l'un des signataires.", + "Expired Documents": "Il s'agit d'une liste de documents qui ont atteint leur date d'expiration.", + "Contactbook": "Il s'agit d'une liste de contacts/signataires que vous avez ajoutés. Ceux-ci apparaîtront sous forme de suggestions lorsque vous tenterez d'ajouter des signataires à un nouveau document.", + "Templates" : "Il s'agit d'une liste de modèles à votre disposition pour créer des documents. Vous pouvez cliquer sur le bouton 'Utiliser' pour créer un nouveau document à l'aide d'un modèle, modifier le document et ajouter des signataires à l'étape suivante." + }, "form-name":{ "Sign Yourself":"Signez-vous", "Request Signatures":"Demander des signatures", @@ -118,8 +128,62 @@ "no":"Non", "auto-reminder":"Rappel automatique", "remind-once":"Rappeler une fois tous les (jours)", - "next":"suivant" + "next":"Suivant", + "select-folder" :"Sélectionner le dossier", + "OpenSign-drive":"Lecteur OpenSign™", + "select-folder-help" :"Si vous ne sélectionnez pas de dossier, votre document signé sera enregistré dans le dossier du lecteur principal OpenSign.", + "no-data" :"Aucune donnée disponible", + "save-here":"Enregistrer ici", + "back" :"Dos", + "add-folder" :"Ajouter le dossier", + "create-folder":"Créer le dossier", + "parent-folder" :"Dossier parent", + "create":"Créer", + "Signers" :"Signataires", + "signers-help" :"Commencez à saisir le nom d'un contact pour voir les signataires suggérés par vos contacts enregistrés ou en ajouter de nouveaux. Organisez l'ordre de signature en ajoutant des signataires dans l'ordre souhaité. Utilisez le bouton « + » pour inclure les signataires et le « x » pour les supprimer. Chaque signataire recevra un e-mail invité à signer le document dans l'ordre indiqué.", + "add-signer":"Ajouter un signataire", + "contact-not-found" :"Contact introuvable", + "add-yourself" :"Ajoutez-vous", + "submit" :"Soumettre", + "reset" :"Réinitialiser", + "my-signature" :"Ma signature", + "signature":"Signature", + "upload-image" :"Télécharger une image", + "clear" :"clair", + "upload-signature/Image" :"Veuillez télécharger la signature/l'image", + "initials" :"Initiales", + "API" :"API", + "api-token":"Jeton API", + "regenerate-token":"Régénérer le jeton", + "generate-token" :"Générer un jeton", + "view-docs" :"Afficher les documents" , + "generate-token-alert" :"Êtes-vous sûr de vouloir régénérer le jeton, il expirera à l'ancienne jeton?", + "yes" :"Oui", + "copied" :"Copié", + "wrong-mssg" :"Quelque chose s'est mal passé.", + "token-generated" :"Jeton généré avec succès.", + "webhook":"Webhook", + "update-webhook" :"Mettre à jour le webhook", + "add-webhook" :"Ajouter un webhook", + "webhook-added" :"Webhook ajouté avec succès.", + "document-signature":{ + "loader":"Cela pourrait prendre un certain temps", + "pages":"Pages", + "document-signed":"Document signé", + "close":"Close", + "validation-alert":"Alerte de validation", + "validate-alert-mssg" :"L'entrée ne répond pas aux critères définis par l'expression régulière.", + "otp-verification":"Vérification OTP", + "enter-otp":"Entrez OTP", + "verify":"Vérifier", + "resend":"Renvoyer", + "verify-email":"Veuillez vérifier votre email!", + "send-otp":"Envoyer OTP", + "otp-placeholder":"Saisissez l'OTP reçu par e-mail", + "loading-doc":"Chargement du document.." + } + } \ No newline at end of file diff --git a/apps/OpenSign/src/components/AddSigner.js b/apps/OpenSign/src/components/AddSigner.js index 3a3a8cf3b..9b85ebb13 100644 --- a/apps/OpenSign/src/components/AddSigner.js +++ b/apps/OpenSign/src/components/AddSigner.js @@ -1,8 +1,10 @@ import React, { useState, useEffect } from "react"; import Parse from "parse"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const AddSigner = (props) => { + const { t } = useTranslation(); const [name, setName] = useState(""); const [phone, setPhone] = useState(""); const [email, setEmail] = useState(""); @@ -214,14 +216,14 @@ const AddSigner = (props) => { className="op-checkbox op-checkbox-sm" /> <label htmlFor="addYourself" className="ml-2 mb-0"> - Add Yourself + {t("add-yourself")} </label> </div> )} <form onSubmit={handleSubmit}> <div className="mb-3"> <label htmlFor="name" className="block text-xs font-semibold"> - Name + {t("name")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -236,7 +238,7 @@ const AddSigner = (props) => { </div> <div className="mb-3"> <label htmlFor="email" className="block text-xs font-semibold"> - Email + {t("email")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -251,7 +253,7 @@ const AddSigner = (props) => { </div> <div className="mb-3"> <label htmlFor="phone" className="block text-xs font-semibold"> - Phone + {t("phone")} </label> <input type="text" @@ -264,14 +266,14 @@ const AddSigner = (props) => { </div> <div className="mt-4 flex gap-x-2 justify-start"> <button type="submit" className="op-btn op-btn-primary"> - Submit + {t("submit")} </button> <button type="button" onClick={() => handleReset()} className="op-btn op-btn-secondary" > - Reset + {t("reset")} </button> </div> </form> diff --git a/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js b/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js index f8b76adcc..68ac073ed 100644 --- a/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js +++ b/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js @@ -1,4 +1,5 @@ import React, { useEffect, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; import { Document, Page } from "react-pdf"; import { useSelector } from "react-redux"; @@ -13,6 +14,7 @@ function RenderAllPdfPage({ signerObjectId, containerWH }) { + const { t } = useTranslation(); const [signPageNumber, setSignPageNumber] = useState([]); const [bookmarkColor, setBookmarkColor] = useState(""); //set all number of pages after load pdf @@ -67,14 +69,14 @@ function RenderAllPdfPage({ return ( <div ref={pageContainer} className="hidden w-[20%] bg-base-100 md:block"> <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"> - Pages + {t("document-signature.pages")} </div> <div className={`flex h-[90%] flex-col items-center m-2 autoSignScroll hide-scrollbar max-h-[100vh] `} > <Document - loading={"Loading Document.."} + loading={t("document-signature.loading-doc")} onLoadSuccess={onDocumentLoad} file={signPdfUrl} > diff --git a/apps/OpenSign/src/components/pdf/VerifyEmail.js b/apps/OpenSign/src/components/pdf/VerifyEmail.js index 59607f844..b001dfa67 100644 --- a/apps/OpenSign/src/components/pdf/VerifyEmail.js +++ b/apps/OpenSign/src/components/pdf/VerifyEmail.js @@ -1,12 +1,14 @@ import React from "react"; import Loader from "../../primitives/Loader"; +import { useTranslation } from "react-i18next"; function VerifyEmail(props) { + const { t } = useTranslation(); return ( <dialog className="op-modal op-modal-open absolute z-[1999]"> <div className="md:w-[40%] w-[80%] op-modal-box p-0 overflow-y-auto hide-scrollbar text-sm"> <h3 className="font-bold text-lg pt-[15px] px-[20px] text-base-content"> - OTP verification + {t("document-signature.otp-verification")} </h3> {props.isVerifyModal ? ( <form @@ -16,26 +18,26 @@ function VerifyEmail(props) { }} > <div className="px-6 py-3 text-base-content"> - <label className="mb-2">Enter OTP</label> + <label className="mb-2">{t("enter-otp")}</label> <input required type="tel" pattern="[0-9]{4}" className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs" - placeholder="Enter OTP received over email" + placeholder={t("otp-placeholder")} value={props.otp} onChange={(e) => props.setOtp(e.target.value)} /> </div> <div className="px-6 my-3"> <button type="submit" className="op-btn op-btn-primary"> - Verify + {t("document-signature.verify")} </button> <button className="op-btn op-btn-secondary ml-2" onClick={(e) => props.handleResend(e)} > - Resend + {t("document-signature.resend")} </button> </div> </form> @@ -45,7 +47,7 @@ function VerifyEmail(props) { </div> ) : ( <div className="px-6 py-3 text-base-content"> - <p className="mb-2 text-sm">Please verify your email !</p> + <p className="mb-2 text-sm">{t("verify-email")}</p> <div className="px-0 mt-3"> <button className="op-btn op-btn-primary" @@ -54,7 +56,7 @@ function VerifyEmail(props) { props.handleVerifyBtn(); }} > - Send OTP + {t("document-signature.send-otp")} </button> </div> </div> diff --git a/apps/OpenSign/src/components/shared/fields/CreateFolder.js b/apps/OpenSign/src/components/shared/fields/CreateFolder.js index f9ffcc9b1..20c253996 100644 --- a/apps/OpenSign/src/components/shared/fields/CreateFolder.js +++ b/apps/OpenSign/src/components/shared/fields/CreateFolder.js @@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react"; import Parse from "parse"; import Alert from "../../../primitives/Alert"; import Loader from "../../../primitives/Loader"; +import { useTranslation } from "react-i18next"; const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { const folderPtr = { @@ -9,6 +10,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { className: folderCls, objectId: parentFolderId }; + const { t } = useTranslation(); const [name, setName] = useState(""); const [folderList, setFolderList] = useState([]); const [isAlert, setIsAlert] = useState(false); @@ -120,10 +122,13 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { <Loader /> </div> )} - <h1 className="text-base font-semibold mt-[0.4rem]">Create Folder</h1> + <h1 className="text-base font-semibold mt-[0.4rem]"> + {t("create-folder")} + </h1> <div className="text-xs mt-2"> <label className="block"> - Name<span className="text-red-500 text-[13px]">*</span> + {t("name")} + <span className="text-red-500 text-[13px]">*</span> </label> <input className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -133,7 +138,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { /> </div> <div className="text-xs mt-2"> - <label className="block">Parent Folder</label> + <label className="block">{t("parent-folder")}</label> <select value={selectedParent} onChange={handleOptions} @@ -155,7 +160,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { className="op-btn op-btn-primary op-btn-sm mt-3" > <i className="fa-light fa-plus"></i> - <span>Create</span> + <span>{t("create")}</span> </button> </div> </div> diff --git a/apps/OpenSign/src/components/shared/fields/SelectFolder.js b/apps/OpenSign/src/components/shared/fields/SelectFolder.js index b1293a87f..8b21262b9 100644 --- a/apps/OpenSign/src/components/shared/fields/SelectFolder.js +++ b/apps/OpenSign/src/components/shared/fields/SelectFolder.js @@ -3,8 +3,10 @@ import Parse from "parse"; import CreateFolder from "./CreateFolder"; import ModalUi from "../../../primitives/ModalUi"; import Tooltip from "../../../primitives/Tooltip"; +import { useTranslation } from "react-i18next"; const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { + const { t } = useTranslation(); const [isOpen, SetIsOpen] = useState(false); const [clickFolder, setClickFolder] = useState(""); const [selectFolder, setSelectedFolder] = useState({}); @@ -169,7 +171,7 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { <div className="text-xs mt-2 "> <div> <label className="block"> - Select Folder + {t("select-folder")} {required && <span className="text-red-500 text-[13px]">*</span>} </label> </div> @@ -192,12 +194,12 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { <p> {selectFolder && selectFolder.Name ? selectFolder.Name - : "OpenSign™ Drive"} + : t("OpenSign-drive")} </p> <div className="text-black text-sm"> <i className="fa-light fa-pencil cursor-pointer" - title="Select Folder" + title={t("select-folder")} aria-hidden="true" ></i> </div> @@ -208,15 +210,11 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { </div> </div> <div className="absolute top-2 right-1 cursor-pointer"> - <Tooltip - message={ - "If you do not select a folder, your signed document will be saved in the Main OpenSign drive folder." - } - /> + <Tooltip message={t("select-folder-help")} /> </div> </div> <ModalUi - title={"Select Folder"} + title={t("select-folder")} isOpen={isOpen} handleClose={handleCancel} > @@ -227,7 +225,7 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { title="OpenSign™ Drive" onClick={(e) => removeTabListItem(e)} > - OpenSign™ Drive /{" "} + {t("OpenSign-drive")} /{" "} </span> {tabList && tabList.map((tab, i) => ( @@ -283,7 +281,7 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { )) : !isLoader && ( <div className="text-base-content text-center my-2"> - No data found + {t("no-data")} </div> )} </div> @@ -305,27 +303,28 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { <div className="flex justify-between items-center py-[.75rem] px-[1.25rem]"> <div className="op-btn op-btn-seconday op-btn-sm" - title="Save Here" + title={t("save-here")} onClick={handleCreate} > {isAdd ? ( <> <i className="fa-light fa-arrow-left" aria-hidden="true"></i> - <span className="text-xs">Back</span> + <span className="text-xs">{t("back")}</span> </> ) : ( <> <i className="fa-light fa-square-plus" aria-hidden="true"></i> - <span className="">Add folder</span> + <span className="">{t("add-folder")}</span> </> )} </div> <div className="op-btn op-btn-primary op-btn-sm" - title="Save Here" + title={t("save-here")} onClick={handleSubmit} > - <i className="fa-light fa-save" aria-hidden="true"></i>Save here + <i className="fa-light fa-save" aria-hidden="true"></i> + {t("save-here")} </div> </div> </ModalUi> diff --git a/apps/OpenSign/src/components/shared/fields/SignersInput.js b/apps/OpenSign/src/components/shared/fields/SignersInput.js index a19cc49f4..1ed5109a3 100644 --- a/apps/OpenSign/src/components/shared/fields/SignersInput.js +++ b/apps/OpenSign/src/components/shared/fields/SignersInput.js @@ -4,6 +4,7 @@ import AddSigner from "../../AddSigner"; import Parse from "parse"; import Tooltip from "../../../primitives/Tooltip"; import { createPortal } from "react-dom"; +import { useTranslation } from "react-i18next"; function arrayMove(array, from, to) { array = array.slice(); array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]); @@ -32,6 +33,7 @@ const AddSignerModal = ({ isOpen, children }) => { */ const SignersInput = (props) => { + const { t } = useTranslation(); const [state, setState] = useState(undefined); // const [editFormData, setEditFormData] = useState([]); const [selected, setSelected] = useState([]); @@ -120,15 +122,10 @@ const SignersInput = (props) => { return ( <div className="text-xs mt-2 "> <label className="block relative"> - Signers + {t("Signers")} {props.required && <span className="text-red-500 text-[13px]">*</span>} <span className="absolute ml-1 text-xs z-30"> - <Tooltip - id={"signer-tooltip"} - message={ - "Begin typing a contact's name to see suggested signers from your saved contacts or add new ones. Arrange the signing order by adding signers in the desired sequence. Use the '+' button to include signers and the 'x' to remove them. Each signer will receive an email prompt to sign the document in the order listed." - } - /> + <Tooltip id={"signer-tooltip"} message={t("signers-help")} /> </span> </label> <div className="flex gap-x-[5px]"> @@ -142,7 +139,7 @@ const SignersInput = (props) => { onChange={onChange} closeMenuOnSelect={false} required={props.required} - noOptionsMessage={() => "Contact not found"} + noOptionsMessage={() => t("contact-not-found")} unstyled classNames={{ control: () => @@ -171,7 +168,7 @@ const SignersInput = (props) => { </div> <AddSignerModal isOpen={modalIsOpen}> <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]"> - Add Signer + {t("add-signer")} </h3> <button onClick={handleModalCloseClick} diff --git a/apps/OpenSign/src/pages/GenerateToken.js b/apps/OpenSign/src/pages/GenerateToken.js index 4b1a31927..c65984325 100644 --- a/apps/OpenSign/src/pages/GenerateToken.js +++ b/apps/OpenSign/src/pages/GenerateToken.js @@ -9,6 +9,7 @@ import Tooltip from "../primitives/Tooltip"; import Loader from "../primitives/Loader"; import SubscribeCard from "../primitives/SubscribeCard"; import Tour from "reactour"; +import { useTranslation } from "react-i18next"; const tourSteps = [ { selector: '[data-tut="apisubscribe"]', @@ -17,6 +18,7 @@ const tourSteps = [ ]; function GenerateToken() { + const { t } = useTranslation(); const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); const [parseAppId] = useState(localStorage.getItem("parseAppId")); const [apiToken, SetApiToken] = useState(""); @@ -70,13 +72,13 @@ function GenerateToken() { const res = await axios.post(url, {}, { headers: headers }); if (res) { SetApiToken(res.data.result.token); - setIsAlert({ type: "success", msg: "Token generated successfully." }); + setIsAlert({ type: "success", msg: t("token-generated") }); } else { console.error("Error while generating Token"); - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("wrong-mssg") }); } } catch (error) { - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("wrong-mssg") }); console.log("while generating Token", error); } finally { setIsLoader(false); @@ -89,7 +91,7 @@ function GenerateToken() { const copytoclipboard = (text) => { copytoData(text); - setIsAlert({ type: "success", msg: "Copied" }); + setIsAlert({ type: "success", msg: t("copied") }); setTimeout(() => { setIsAlert({ type: "success", msg: "" }); }, 1500); // Reset copied state after 1.5 seconds @@ -112,7 +114,7 @@ function GenerateToken() { <> <div className="bg-base-100 text-base-content flex flex-col justify-center shadow-md rounded-box mb-3"> <h1 className={"ml-4 mt-3 mb-2 font-semibold"}> - OpenSign™ API{" "} + OpenSign™ {t("API")}{" "} <Tooltip url={ "https://docs.opensignlabs.com/docs/API-docs/opensign-api-v-1" @@ -123,7 +125,7 @@ function GenerateToken() { <ul className="w-full flex flex-col p-2 text-sm"> <li className="flex flex-col md:flex-row justify-between items-center border-y-[1px] border-gray-300 break-all py-2"> <div className="w-full md:w-[70%] flex-col md:flex-row text-xs md:text-[15px] flex items-center gap-x-5"> - <span className="ml-1">API Token:</span>{" "} + <span className="ml-1">{t("api-token")}:</span>{" "} <span id="token" className={`${ @@ -150,7 +152,7 @@ function GenerateToken() { onClick={apiToken ? handleModal : handleSubmit} className="op-btn op-btn-primary" > - {apiToken ? "Regenerate Token" : "Generate Token"} + {apiToken ? t("regenerate-token") : t("generate-token")} </button> </li> </ul> @@ -164,18 +166,17 @@ function GenerateToken() { } className="op-btn op-btn-secondary mt-2 mb-3 px-8" > - View Docs + {t("view-docs")} </button> </div> <ModalUi isOpen={isModal} - title={apiToken ? "Regenerate Token" : "Generate Token"} + title={apiToken ? t("regenerate-token") : t("generate-token")} handleClose={handleModal} > <div className="m-[20px]"> <div className="text-lg font-normal text-base-content"> - Are you sure you want to regenerate token it will expire old - token? + {t("generate-token-alert")} </div> <hr className="bg-[#ccc] mt-4" /> <div className="flex items-center mt-3 gap-2 text-white"> @@ -183,13 +184,13 @@ function GenerateToken() { onClick={handleSubmit} className="op-btn op-btn-primary ml-[2px]" > - Yes + {t("yes")} </button> <button onClick={handleModal} className="op-btn op-btn-secondary" > - No + {t("no")} </button> </div> </div> diff --git a/apps/OpenSign/src/pages/Managesign.js b/apps/OpenSign/src/pages/Managesign.js index ba540ad1a..f5a0a8cfe 100644 --- a/apps/OpenSign/src/pages/Managesign.js +++ b/apps/OpenSign/src/pages/Managesign.js @@ -7,7 +7,9 @@ import Parse from "parse"; import { SaveFileSize } from "../constant/saveFileSize"; import Alert from "../primitives/Alert"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const ManageSign = () => { + const { t } = useTranslation(); const [penColor, setPenColor] = useState("blue"); const [initialPen, setInitialPen] = useState("blue"); const [image, setImage] = useState(); @@ -245,12 +247,12 @@ const ManageSign = () => { <div className="relative w-full"> <div className="ml-[5px] my-[20px] md:m-[20px]"> <div className="text-[20px] font-semibold m-[10px] md:m-0 mb-2"> - My Signature + {t("my-signature")} </div> <div className="flex flex-col md:flex-row gap-0 md:gap-[12px]"> <div className="relative"> <span className="font-medium select-none flex mb-[10px] pl-[10px]"> - Signature + {t("signature")} </span> <input type="file" @@ -330,14 +332,14 @@ const ManageSign = () => { className="op-link" onClick={() => handleUploadBtn()} > - Upload image + {t("upload-image")} </div> <div type="button" className="op-link" onClick={() => handleClear()} > - Clear + {t("clear")} </div> </div> </div> @@ -345,14 +347,14 @@ const ManageSign = () => { {warning && ( <span className="customwarning signWarning text-[12px] w-[220px] md:w-[300px]"> <i className="fa-light fa-exclamation-circle text-[#fab005] text-[15px] mr-[4px]"></i> - Please upload signature/Image + {t("upload-signature/Image")} </span> )} </div> </div> <div className="relative"> <span className="font-medium select-none flex mb-[10px] pl-[10px]"> - Initials + {t("initials")} </span> <div> {isInitials ? ( @@ -425,7 +427,7 @@ const ManageSign = () => { className="op-link text-sm md:text-base mr-1" onClick={() => handleClearInitials()} > - Clear + {t("clear")} </div> </div> </div> @@ -437,7 +439,7 @@ const ManageSign = () => { className="op-btn op-btn-primary" onClick={(e) => handleSubmit(e)} > - save + {t("save")} </button> </div> </div> diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index d52286f31..a91188bbd 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -51,8 +51,10 @@ import TextFontSetting from "../components/pdf/TextFontSetting"; import VerifyEmail from "../components/pdf/VerifyEmail"; import PdfZoom from "../components/pdf/PdfZoom"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; //For signYourself inProgress section signer can add sign and complete doc sign. function SignYourSelf() { + const { t } = useTranslation(); const [pdfDetails, setPdfDetails] = useState([]); const [isSignPad, setIsSignPad] = useState(false); const [allPages, setAllPages] = useState(null); @@ -1175,7 +1177,7 @@ function SignYourSelf() { <div className="absolute h-[100vh] w-full z-[999] flex flex-col justify-center items-center bg-[#e6f2f2] bg-opacity-80"> <Loader /> <span style={{ fontSize: "13px", fontWeight: "bold" }}> - This might take some time + {t("document-signature.loader")} </span> </div> )} @@ -1249,7 +1251,7 @@ function SignYourSelf() { {/* this modal is used show this document is already sign */} <ModalUi isOpen={showAlreadySignDoc.status} - title={"Document signed"} + title={t("document-signature.document-signed")} handleClose={() => { setShowAlreadySignDoc({ status: false }); }} @@ -1262,7 +1264,7 @@ function SignYourSelf() { className="op-btn op-btn-ghost shadow-md" onClick={() => setShowAlreadySignDoc({ status: false })} > - Close + {t("close")} </button> </div> </ModalUi> @@ -1417,15 +1419,13 @@ function SignYourSelf() { )} <ModalUi isOpen={validateAlert} - title={"Validation alert"} + title={t("validation-alert")} handleClose={() => { setValidateAlert(false); }} > <div className="p-[20px] h-full"> - <p> - The input does not meet the criteria set by the regular expression. - </p> + <p>{t("document-signature.validate-alert-mssg")}</p> <div className="h-[1px] w-full my-[15px] bg-[#9f9f9f]"></div> <button @@ -1433,7 +1433,7 @@ function SignYourSelf() { type="button" className="op-btn op-btn-ghost shadow-md" > - Close + {t("close")} </button> </div> </ModalUi> diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index 0781094af..8accaa439 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -406,7 +406,10 @@ function UserProfile() { onChange={(e) => SetName(e.target.value)} /> ) : ( - <span>{localStorage.getItem("username")}</span> + <span> + {/* {localStorage.getItem("username")} */} + <p>{t("greeting", { name })}</p> + </span> )} </li> <li diff --git a/apps/OpenSign/src/pages/Webhook.js b/apps/OpenSign/src/pages/Webhook.js index 9b6668dad..3a9cf49e0 100644 --- a/apps/OpenSign/src/pages/Webhook.js +++ b/apps/OpenSign/src/pages/Webhook.js @@ -10,6 +10,7 @@ import Tooltip from "../primitives/Tooltip"; import Loader from "../primitives/Loader"; import SubscribeCard from "../primitives/SubscribeCard"; import Tour from "reactour"; +import { useTranslation } from "react-i18next"; const tourSteps = [ { selector: '[data-tut="webhooksubscribe"]', @@ -17,6 +18,7 @@ const tourSteps = [ } ]; function Webhook() { + const { t } = useTranslation(); const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); const [parseAppId] = useState(localStorage.getItem("parseAppId")); const [webhook, setWebhook] = useState(); @@ -66,13 +68,13 @@ function Webhook() { const res = await axios.post(url, params, { headers: headers }); if (res.data && res.data.result && res.data.result.Webhook) { setWebhook(res.data.result.Webhook); - setIsAlert({ type: "success", msg: "Webhook added successfully." }); + setIsAlert({ type: "success", msg: t("webhook-added") }); } else { console.error("Error while generating webhook"); - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("wrong-mssg") }); } } catch (error) { - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("wrong-mssg") }); console.log("err while generating webhook", error); } finally { setIsLoader(false); @@ -107,7 +109,7 @@ function Webhook() { <> <div className="bg-base-100 text-base-content flex flex-col justify-center shadow-md rounded-box mb-3"> <h1 className={"ml-4 mt-3 mb-2 font-semibold"}> - OpenSign™ Webhook{" "} + OpenSign™ {t("webhook")}{" "} <Tooltip url={"https://docs.opensignlabs.com/docs/API-docs/get-webhook"} isSubscribe={true} @@ -116,7 +118,7 @@ function Webhook() { <ul className={"w-full flex flex-col p-2 text-sm"}> <li className="flex flex-col md:flex-row justify-between items-center border-y-[1px] border-gray-300 break-all py-2"> <div className="w-[70%] flex-col md:flex-row flex items-center gap-5"> - <span className="">Webhook:</span>{" "} + <span className="">{t("webhook")}:</span>{" "} <span id="token" className=" md:text-end cursor-pointer"> {webhook ? webhook : "_____"} </span> @@ -126,7 +128,7 @@ function Webhook() { onClick={handleModal} className="op-btn op-btn-primary" > - {webhook ? "Update Webhook" : "Add Webhook"} + {webhook ? t("update-webhook") : t("add-webhook")} </button> </li> </ul> @@ -140,7 +142,7 @@ function Webhook() { } className="op-btn op-btn-secondary mt-2 mb-3 px-7" > - View Docs + {t("view-docs")} </button> </div> <ModalUi @@ -151,7 +153,7 @@ function Webhook() { {error && <Alert type="danger">{error}</Alert>} <div className="m-[20px]"> <div className="text-lg font-normal text-base-content"> - <label className="text-sm ml-2">Webhook</label> + <label className="text-sm ml-2">{t("webhook")}</label> <input value={webhook} onChange={(e) => setWebhook(e.target.value)} @@ -165,13 +167,13 @@ function Webhook() { onClick={handleSubmit} className="op-btn op-btn-primary ml-[2px]" > - Yes + {t("yes")} </button> <button onClick={handleModal} className="op-btn op-btn-secondary" > - No + {t("no")} </button> </div> </div> diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index fea0e0f82..dde156ee3 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -1076,7 +1076,7 @@ const ReportTable = (props) => { {t(`report-name.${props.ReportName}`)} {props.report_help && ( <span className="text-xs md:text-[13px] font-normal"> - <Tooltip message={props.report_help} /> + <Tooltip message={t(`report-help.${props.ReportName}`)} /> </span> )} </div> From c6e93cd3c80023c5ded468a7a64cb07bb952908a Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 31 Jul 2024 21:26:08 +0530 Subject: [PATCH 04/28] feat: apply multisupport language for signing flow in signyour-self, template , placeholder --- .../public/locales/en/translation.json | 264 +++++++++++++-- .../public/locales/fr/translation.json | 301 +++++++++++++++--- apps/OpenSign/src/components/AddSigner.js | 6 +- apps/OpenSign/src/components/AddTeam.js | 10 +- apps/OpenSign/src/components/AddUser.js | 12 +- apps/OpenSign/src/components/BulkSendUi.js | 20 +- apps/OpenSign/src/components/Header.js | 17 +- .../src/components/opensigndrive/DriveBody.js | 4 +- .../src/components/pdf/AddRoleModal.js | 10 +- .../src/components/pdf/DraftDocument.js | 4 +- .../components/pdf/DropdownWidgetOption.js | 23 +- .../src/components/pdf/EditTemplate.js | 23 +- apps/OpenSign/src/components/pdf/EmailBody.js | 8 +- .../src/components/pdf/EmailComponent.js | 30 +- apps/OpenSign/src/components/pdf/PdfHeader.js | 59 ++-- apps/OpenSign/src/components/pdf/PdfZoom.js | 8 +- .../src/components/pdf/PlaceholderCopy.js | 11 +- .../src/components/pdf/PlaceholderType.js | 25 +- apps/OpenSign/src/components/pdf/PrevNext.js | 8 +- .../src/components/pdf/RenderAllPdfPage.js | 4 +- apps/OpenSign/src/components/pdf/SignPad.js | 24 +- apps/OpenSign/src/components/pdf/Signedby.js | 4 +- .../src/components/pdf/SignerListPlace.js | 42 +-- .../src/components/pdf/VerifyEmail.js | 8 +- .../src/components/pdf/WidgetComponent.js | 8 +- .../OpenSign/src/components/pdf/WidgetList.js | 5 +- .../src/components/pdf/WidgetNameModal.js | 18 +- .../components/shared/fields/SelectSigners.js | 14 +- .../components/shared/fields/SignersInput.js | 2 +- apps/OpenSign/src/constant/Utils.js | 5 +- apps/OpenSign/src/pages/GenerateToken.js | 4 +- apps/OpenSign/src/pages/GuestLogin.js | 4 +- apps/OpenSign/src/pages/Opensigndrive.js | 6 +- apps/OpenSign/src/pages/PdfRequestFiles.js | 27 +- apps/OpenSign/src/pages/PlaceHolderSign.js | 84 +++-- apps/OpenSign/src/pages/SignyourselfPdf.js | 53 +-- apps/OpenSign/src/pages/TeamList.js | 54 ++-- .../OpenSign/src/pages/TemplatePlaceholder.js | 64 ++-- apps/OpenSign/src/pages/UserList.js | 53 +-- apps/OpenSign/src/pages/Webhook.js | 4 +- apps/OpenSign/src/primitives/AddContact.js | 18 +- .../src/primitives/GetReportDisplay.js | 197 ++++++------ apps/OpenSign/src/primitives/LinkUserModal.js | 8 +- 43 files changed, 1005 insertions(+), 548 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 5511ae483..f85308bc1 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -7,14 +7,16 @@ "email":"Email", "company":"Company", "job-title":"Job title", + "profile":"Profile", + "log-out":"Log Out", "is-email-verified":"Is Email verified", "public-profile":"Public profile", "tagline":"Tagline ", "has-requested-you-to-sign":"has requested you to sign", "has-requested-you-to-review-and-sign":" has requested you to review and sign", "ascending":"Ascending", - "Action":"Action", - "add":"add", + "action":"Action", + "add":"Add", "add-new-folder":"ajouter un nouveau dossier", "disable-documentId":"Disable DocumentId", "edit":"Edit", @@ -22,14 +24,18 @@ "save":"Save", "cancel":"Cancel", "upgrade-now":"Upgrade now", + "pro":"PRO", + "team":"TEAM", "user":"User", - "public-profile-help": "This is your public URL. Copy or share it with the signer, and you will be able to see all your publicly set templates.", + "docs":"Docs", + "public-profile-help":"This is your public URL. Copy or share it with the signer, and you will be able to see all your publicly set templates.", "tagline-help":"This Tagline will appear on your OpenSign public profile for ex. https://opensign.me/alex", "welcome":"Welcome Back!", "Login-to-your-account":"Login to your account", "password":"Password", "forgot-password":"Forgot Password?", "loading":"Loading...", + "of":"of", "sign-SSO":"Sign in with SSO", "login-page":"Login Page", "or":"OR", @@ -51,7 +57,7 @@ }, "OpenSign™ Drive":"OpenSign™ Drive", "Reports":"Reports", - "Reports-Children" :{ + "Reports-Children" :{ "Need your sign": "Need your sign", "In Progress": "In Progress", "Completed":"Completed", @@ -64,7 +70,9 @@ "Settings-Children":{ "My Signature": "My Signature", "API Token":"API Token", - "Webhook":"Webhook" + "Webhook":"Webhook", + "Teams":"Teams", + "Users":"Users" } }, "dashboard-card":{ @@ -82,19 +90,39 @@ "Recent signature requests":"Recent signature requests", "Drafts":"Drafts", "Contactbook":"Contactbook", - "Templates":"Templates" + "Templates":"Templates", + "Teams":"Teams", + "Users":"Users" }, + "btnLabel":{ + "sign":"sign", + "Resend":"Resend", + "Revoke":"Revoke", + "Delete":"Delete", + "Use":"Use", + "Quick send":"Quick send", + "Edit":"Edit", + "Share with team":"Share with team", + "Share":"Share", + "View":"View", + "option":"option" + }, "report-heading":{ "Sr.No":"Sr.No", "Title":"Title", "Email":"Email", "Phone":"Phone", "File":"File", - "Owner": "Owner", + "Owner": "Owner", "Signers":"Signers", "Note": "Note", "Folder": "Folder", - "Reason": "Reason" + "Reason": "Reason", + "Parent Team":"Parent Team", + "Active":"Active", + "Role":"Role", + "Team":"Team", + "Name":"Name" }, "report-help":{ "Draft Documents": "These are documents you have started but have not finalized for sending.", @@ -121,9 +149,9 @@ "send-in-order":"Send In Order", "send-in-order-help":{ "p1":"Choose how you want the signing requests to be sent to the document signers:", - "p2":" Selecting this option will send the signing request to the first signer initially. Once the first signer completes their part, the next signer in the sequence will receive the request. This process continues until all signers have signed the document. This method ensures that the document is signed in a specific order.", - "p3":" Selecting this option will send the signing links to all signers simultaneously. Every signer can sign the document at their convenience, regardless of whether other signers have completed their signatures. This method is faster but does not enforce any signing order among the participants.", - "p4":" Select the option that best suits the needs of your document processing." + "p2":"Selecting this option will send the signing request to the first signer initially. Once the first signer completes their part, the next signer in the sequence will receive the request. This process continues until all signers have signed the document. This method ensures that the document is signed in a specific order.", + "p3":"Selecting this option will send the signing links to all signers simultaneously. Every signer can sign the document at their convenience, regardless of whether other signers have completed their signatures. This method is faster but does not enforce any signing order among the participants.", + "p4":"Select the option that best suits the needs of your document processing." }, "no":"No", "auto-reminder":"Auto reminder", @@ -139,7 +167,7 @@ "create-folder":"Create Folder", "parent-folder":"Parent Folder", "create":"Create", - "Signers":"Signers", + "signers":"Signers", "signers-help":"Begin typing a contact's name to see suggested signers from your saved contacts or add new ones. Arrange the signing order by adding signers in the desired sequence. Use the '+' button to include signers and the 'x' to remove them. Each signer will receive an email prompt to sign the document in the order listed.", "add-signer":"Add Signer", "contact-not-found":"Contact not found", @@ -160,13 +188,82 @@ "generate-token-alert" :"Are you sure you want to regenerate token it will expire old token?", "yes":"Yes", "copied":"Copied", - "wrong-mssg":"Something went wrong.", + "something-went-wrong-mssg":"Something went wrong, please try again later.", "token-generated":"Token generated successfully.", "webhook":"Webhook", "update-webhook":"Update Webhook", "add-webhook":"Add Webhook", "webhook-added" :"Webhook added successfully.", - "document-signature":{ + "team-disabled":"Team disabled", + "Team enabled":"Team enabled", + "are-you-sure": "Are you sure you want to", + "disable":"disable", + "enable":"enable", + "this-team":" this team?", + "edit-team":"Edit Team", + "name-of-team":"Name of Team", + "prev":"Prev", + "no-data-avaliable":"No Data Available", + "add-team":"Add Team", + "page-not-found":"Page Not Found", + "users-from-teams":"users from Teams", + "user-status":"User status", + "activate" :"activate", + "deactivate":"deactivate", + "this-user":" this user", + "delete-user":"Delete User", + "delete":"delete", + "add-user":"Add User", + "password-generateed" :"Password will only be generated once; make sure to copy it.", + "Team status":"Team status", + "user-deactivated":"User deactivated.", + "user-activated":"User activated.", + "public":"Public", + "download":"Download", + "view":"View", + "make-template-public":"Make template public", + "make-template-private":"Make template private", + "make-template-public-alert" :"Are you sure you want to make this template public?", + "make-template-private-alert" :"Are you sure you want to make this template private? This will remove it from your public profile.", + "public-role":"Public role", + "public-url":"Public URL", + "public-url-copy-mssg" :" Here’s your public URL: Copy it or share it with the signer, and you will be able to see all your publicly set templates.", + "add-public-url-alert" :"Please add your public URL, and you will be able to make a public template.", + "share-with-alert":"You cannot share a template if any roles already have contacts assigned. Please remove all contact assignments from the roles before sharing the template.", + "share-with":"Share with", + "team-not-found":"Team not found", + "roles":"Roles", + "delete-document":"Delete Document", + "delete-document-alert" :"Are you sure you want to delete this document?", + "quick-send":"Quick send", + "add-new":"Add new", + "send":"Send" , + "quick-send-alert-1":"All roles in this document are currently linked to contacts. To quick send copies of this template to multiple signers, please ensure that at least one role is not linked to any contact." , + "quick-send-alert-2" :"Please ensure there's at least one signature widget added for all recipients.", + "quick-send-alert-3":"Please add at least one role to this template in order to 'quick send' copies of it to multiple signers.", + "quick-send-alert-4":"Quick send reached limit.", + "copy-link":"Copy link", + "copy":"Copy", + "revoke-document":"Revoke document", + "revoke-document-alert":"Are you sure you want to revoke this document?", + "resend-mail":"Resend Mail", + "resend-mail-help":"You can use following variables which will get replaced with their actual values:- {{document_title}}, {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.", + "subject":"Subject", + "body":"Body", + "add-contact":"Add Contact", + "add-signer-alert":"Contact already exist!", + "record-delete-alert": "Record deleted successfully!", + "record-revoke-alert" : "Record revoked successfully!", + "mail-sent-alert": "Mail sent successfully.", + "document-sent-alert" : "Document sent successfully!", + "template-share-alert" :"Template Shared successfully.", + "template-public-alert-1" :"You have successfully made the template public.", + "template-public-alert-2" :"You have successfully made the template private.", + "template-public-alert-3" :"You need to select a role for the public signers.", + "template-public-alert-4": "Please ensure there's at least one signature widget added for all signers.", + "template-public-alert-5" : "Since this template has send-in-order enabled, the public role must be positioned at the top.", + "template-public-alert-6" :"Please attach signers to all roles except for the public role user.", + "template-public-alert-7" : "Please assign at least one public role to make this template public.", "loader":" This might take some time", "pages":"Pages", "document-signed":"Document signed", @@ -180,18 +277,129 @@ "verify-email":"Please verify your email !", "send-otp":" Send OTP", "otp-placeholder":"Enter OTP received over email", - "loading-doc":"Loading Document.." - } - - - - + "loading-doc":"Loading Document..", + "widgets-name":{ + "signature":"signature", + "stamp":"stamp", + "initials":"initials", + "name":"name", + "job title":"job title", + "company":"company", + "date":"date", + "text":"text", + "text input":"text input", + "checkbox":"checkbox", + "dropdown":"dropdown", + "radio button":"radio button", + "image": "image", + "email":"email" + }, + "fields":"Fields", + "recipients":"Recipients", + "please-add":"Please add a", + "signed-by":"Signed By", + "more":"more", + "sent":"sent", + "print":"Print", + "certificate":"Certificate", + "decline":"Decline", + "finish":"Finish", + "mail":"Mail", + "sign-now":"Sign Now", + "successfully-signed":"Successfully signed!", + "email-mssg":" Recipients added here will get a copy of the signed document.", + "email-error-1":" please provide correct email address", + "email-error-2" :"You can only send to ten recipients at a time.", + "upload-stamp-image":"Upload stamp image", + "draw":"Draw", + "type":"Type", + "my-initials":"My Initials", + "upload":"Upload", + "initial-teb":"Initials", + "signature-tab":"Signature", + "your-signature":"Your signature", + "copy-to-all-pages":"Copy to all pages", + "apply":"Apply", + "copy-type":{ + "All pages":"All pages", + "All pages but last":"All pages but last", + "All pages but first":"All pages but first" + }, + "options":"options", + "minimun-check":"Minimun check", + "maximum-check":"Maximum check", + "default-value":"Default value", + "select":"Select", + "read-only":"Is read only", + "hide-labels":"Hide labels", + "checkbox":"Checkbox", + "alert":"Alert", + "zoom-in":"Zoom in", + "zoom-out":"Zoom out", + "document-signed-alert":"Congratulations! 🎉 This document has been successfully signed by you!", + "otp-sent-alert":"OTP sent on your email", + "fields-required":"Fields required", + "signature-widget-alert-1" :"Please ensure there's at least one signature widget added", + "signature-widget-alert-2" : "Please ensure all field is accurately filled and meets all requirements.", + "encrypted-pdf-alert" :"Currently encrypted pdf files are not supported.", + "user-not-exist":"User does not exist", + "template-signature-field":"Please add at least one signature field for all roles.", + "template-role-alert":"Please add roles first", + "create-document":"Create Document", + "template-created-alert":"Do you want to create a document using the template you just created ?", + "signers-alert":"signers alert", + "template-creation-alert-1":"Please select signer for add placeholder!", + "ok":"Ok", + "radio-group":"Radio group", + "dropdown-options":"Dropdown options", + "add-role":"Add Role", + "role-ex":" e.g: Customer, Hr, Director, Manager, Student, etc", + "add/choose-signer":"Add/Choose Signer", + "choose-from-contacts":"Choose from contacts", + "select-signer" :" Please select signer", + "edit-template":"Edit Template", + "widget-info":"Widget info", + "validation":"Validation", + "invalid-default-value":"invalid default value", + "hint":"Hint", + "color":"color", + "role-help":{ + "p1":"What are template roles?", + "p2":"Begin by specifying each role needed for the completion of the document. Think about the parties involved in the signing process and what their responsibilities are. Common roles include HR for internal documents, Customer for agreements or Vendor for business agreements.", + "p3":"Why pre-attach users to some roles?", + "p4":"For roles that consistently involve the same individual (e.g., the CEO's signature on employee offer letters), you can pre-attach a user to a role within the template. This step is optional but recommended for efficiency and consistency across documents.", + "p5":"When do i specify the user attached to each role?", + "p6":"When you create a document from your template, you'll be prompted to attach users to each defined role. If a role already has a user attached, this will be pre-filled, but you can modify it as needed before sending out the document." + }, + "add-recipients":"Add recipients", + "loading-mssg": "This might take some time", + "send-mail": "Send Mail", + "placeholder-alert-1":"Please ensure there's at least one signature widget added for all recipients.", + "placeholder-alert-2":"Please confirm that you have filled the text field.", + "placeholder-alert-3":" Are you sure you want to send out this document for signatures?", + "placeholder-alert-4":"You have successfully sent mails to all recipients!", + "placeholder-alert-5":"Do you want to sign documents right now ?", + "placeholder-alert-6" :"Please setup mail adapter to send mail!", + "placeholder-alert-7" :"Please select signer for add placeholder!", + "email-subject":"email subject", + "email-body":"email body", + "email-placeholder":"add body of email", + "reset-to-default" :"Reset to default", + "cutomize-email":"Cutomize Email", + "upgrade-to-customize-email":"Upgrade to customize Email", + "sign-url":"Sign url", + "Mails Sent":"Mails Sent", + "document-alert":"Document Alert", + "owner-subscription-expired":"Owner's subscription has expired.", + "subscription-expired":"Subscription Expired", + "alert-message":"Alert message", + "document-decline":"Document decline", + "decline-alert-1":"Are you sure want to decline this document ?", + "decline-alert-2":"You have declined this document!", + "decline-alert-3":"You can not sign this document as it has been declined/revoked.", + "sign here":"Sign here", + "guest-email-alert" :"verification code is sent to your email", + "get-otp-alert" :"you will get a OTP via Email" + - - - - - - - } - \ No newline at end of file +} \ No newline at end of file diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index a71bca04d..8405706c7 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -7,29 +7,35 @@ "email":"E-mail", "company":"Entreprise", "job-title":"Titre d'emploi", + "profile":"Profil", "is-email-verified":"L'e-mail est-il vérifié", + "log-out" :"Déconnexion", "public-profile":"Profil public", "tagline":"Slogan", "has-requested-you-to-sign":" vous a demandé de signer", "has-requested-you-to-review-and-sign":"vous a demandé de consulter et de signer", - "Ascending":"Ascendant", - "Action":"Action", + "ascending":"Ascendant", + "action":"Action", "add":"ajouter", - "add-new-folder":"add new folder", + "add-new-folder":"ajouter un nouveau dossier", "disable-documentId":"Désactiver l'ID de document", "edit":"Modifier", "change-password":"Changer le mot de passe", "save":"Sauvegarder", "cancel":"Annuler", "upgrade-now":"Mettre à jour maintenant", + "pro":"PRO", + "team":"ÉQUIPE", + "docs":"Documents", "user":"Utilisateur", "public-profile-help":"Il s'agit de votre URL publique. Copiez-le ou partagez-le avec le signataire et vous pourrez voir tous vos modèles définis publiquement.", "tagline-help":"Ce slogan apparaîtra sur votre profil public OpenSign par exemple. https://opensign.me/alex", "welcome":"Content de te revoir!", - "Login-to-your-account" :"Connectez-vous à votre compte", + "Login-to-your-account" :"Se connecter à son compte", "password" :"Mot de passe", "forgot-password":"Mot de passe oublié?", "loading":"Chargement...", + "of":"de", "sign-SSO":"Connectez-vous avec SSO", "login-page":"Page de connexion", "or":"OU", @@ -42,7 +48,7 @@ "register" :"Registre", "sidebar": { "Dashboard": "Tableau de bord", - "Sign yourself": "Signez-vous", + "Sign yourself": "signez vous-même", "Request signatures":"Demander des signatures", "Templates":"Modèles", "Templates-Children":{ @@ -51,20 +57,22 @@ }, "OpenSign™ Drive":"Lecteur OpenSign™", "Reports":"Rapports", - "Reports-Children" :{ - "Need your sign": "Besoin de votre signe", + "Reports-Children" :{ + "Need your sign": "Besoin de signer", "In Progress": "En cours", "Completed":"Complété", "Drafts": "Brouillons", - "Declined": "Diminué", + "Declined": "a refusé", "Expired":"Expiré", "Contactbook":"Carnet de contacts" }, "Settings": "Paramètres", "Settings-Children":{ - "My Signature": "Ma signature", + "My Signature": "Ma signature", "API Token":"Jeton API", - "Webhook":"Webhook" + "Webhook":"Webhook", + "Teams":"Équipes", + "Users":"Utilisateurs" } }, "dashboard-card":{ @@ -82,20 +90,40 @@ "Recent signature requests":"Demandes de signature récentes", "Drafts":"Brouillons", "Contactbook":"Carnet de contacts", - "Templates":"Modèles" + "Templates":"Modèles", + "Teams":"Teams", + "Users":"Utilisateurs" }, "report-heading":{ "Sr.No":"Sr. Non", "Title":"Titre", "Email":"E-mail", "Phone":"Téléphone", - "File":"Déposer", + "File":"Fichier", "Owner":"Propriétaire", "Signers":"Signataires", "Note": "Note", "Folder":"Dossier", - "Reason": "Raison" + "Reason": "Raison", + "Parent Team":"Équipe de parents", + "Active":"Actif", + "Role":"Rôle", + "Team":"Équipe", + "Name":"Nom" }, + "btnLabel":{ + "sign":"signe", + "Resend":"Renvoyer", + "Revoke":"Révoquer", + "Delete":"Supprimer", + "Use":"Utiliser", + "Quick send":"Envoi rapide", + "Edit":"Modifier", + "Share with team":"Partager avec l'équipe", + "Share":"Partager", + "View":"Voir", + "option":"option" + }, "report-help":{ "Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.", "Need your sign": "Voici une liste de documents qui attendent votre signature", @@ -107,7 +135,7 @@ "Templates" : "Il s'agit d'une liste de modèles à votre disposition pour créer des documents. Vous pouvez cliquer sur le bouton 'Utiliser' pour créer un nouveau document à l'aide d'un modèle, modifier le document et ajouter des signataires à l'étape suivante." }, "form-name":{ - "Sign Yourself":"Signez-vous", + "Sign Yourself":"signez vous-même", "Request Signatures":"Demander des signatures", "New Template":"Nouveau modèle" }, @@ -132,58 +160,249 @@ "select-folder" :"Sélectionner le dossier", "OpenSign-drive":"Lecteur OpenSign™", "select-folder-help" :"Si vous ne sélectionnez pas de dossier, votre document signé sera enregistré dans le dossier du lecteur principal OpenSign.", - "no-data" :"Aucune donnée disponible", + "no-data" :"Aucune donnée disponible", "save-here":"Enregistrer ici", - "back" :"Dos", + "back" :"Retour", "add-folder" :"Ajouter le dossier", "create-folder":"Créer le dossier", "parent-folder" :"Dossier parent", "create":"Créer", - "Signers" :"Signataires", + "signers" :"Signataires", "signers-help" :"Commencez à saisir le nom d'un contact pour voir les signataires suggérés par vos contacts enregistrés ou en ajouter de nouveaux. Organisez l'ordre de signature en ajoutant des signataires dans l'ordre souhaité. Utilisez le bouton « + » pour inclure les signataires et le « x » pour les supprimer. Chaque signataire recevra un e-mail invité à signer le document dans l'ordre indiqué.", "add-signer":"Ajouter un signataire", "contact-not-found" :"Contact introuvable", - "add-yourself" :"Ajoutez-vous", + "add-yourself":"Ajoutez-vous", "submit" :"Soumettre", "reset" :"Réinitialiser", - "my-signature" :"Ma signature", + "my-signature":"Ma signature", "signature":"Signature", "upload-image" :"Télécharger une image", - "clear" :"clair", - "upload-signature/Image" :"Veuillez télécharger la signature/l'image", + "clear" :"Vider", + "upload-signature/Image" :"télécharger-signature/Image", "initials" :"Initiales", "API" :"API", "api-token":"Jeton API", "regenerate-token":"Régénérer le jeton", "generate-token" :"Générer un jeton", "view-docs" :"Afficher les documents" , - "generate-token-alert" :"Êtes-vous sûr de vouloir régénérer le jeton, il expirera à l'ancienne jeton?", + "generate-token-alert":"Êtes-vous sûr de vouloir régénérer le jeton, il expirera à l'ancienne jeton?", "yes" :"Oui", "copied" :"Copié", - "wrong-mssg" :"Quelque chose s'est mal passé.", - "token-generated" :"Jeton généré avec succès.", + "wrong-mssg":"Quelque chose c'est mal passé. Merci d'essayer plus tard.", + "token-generated":"Jeton généré avec succès.", "webhook":"Webhook", "update-webhook" :"Mettre à jour le webhook", "add-webhook" :"Ajouter un webhook", "webhook-added" :"Webhook ajouté avec succès.", + "team-disabled":"Équipe: Désactivée", + "team-enabled":"Équipe activée", + "are-you-sure":"Êtes-vous sûr de vouloir", + "disable":"désactiver", + "enable":"activer", + "this-team":"cette équipe?", + "edit-team" :"Modifier l'équipe", + "name-of-team":"Nom de l'équipe", + "prev" :"précédent", + "no-data-avaliable" :"pas de données disponibles", + "add-team":"Ajouter une équipe", + "page-not-found" :"Page non trouvée", + "users-from-teams" :"utilisateurs de Teams", + "user-status":"Statut de l'utilisateur", + "activate" :"Activer", + "deactivate":"désactiver", + "this-user":"cet utilisateur ", + "delete-user":"Supprimer l'utilisateur", + "delete" :"supprimer", + "add-user":"Ajouter un utilisateur", + "password-generateed" :"Le mot de passe ne sera généré qu'une seule fois ; assurez-vous de le copier.", + "Team status" :"Statut de l'équipe", + "user-deactivated":"Utilisateur désactivé.", + "user-activated":"Activé par l'utilisateur.", + "public" :"Public", + "download" :"Téléchargement", + "view":"voir", + "make-template-public" :"Rendre le modèle public", + "make-template-private" :"Rendre le modèle privé", + "make-template-public-alert" :"Êtes-vous sûr de vouloir rendre ce modèle public ?", + "make-template-private-alert":"Êtes-vous sûr de vouloir rendre ce modèle privé ? Cela le supprimera de votre profil public.", + "public-role" :"Rôle public", + "public-url" :"URL publique", + "public-url-copy-mssg":"Voici votre URL publique : copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.", + "add-public-url-alert":"Veuillez ajouter votre URL publique et vous pourra rendre public modèle.", + "share-with-alert":"Vous ne pouvez pas partager un modèle si des contacts sont déjà attribués à des rôles. Veuillez supprimer toutes les attributions de contacts des rôles avant de partager le modèle.", + "share-with":"Partager avec", + "team-not-found" :"Équipe introuvable", + "roles":"Les rôles", + "delete-document" :"Supprimer un document", + "delete-document-alert" :"Êtes-vous sûr de vouloir supprimer ce document ?", + "quick-send" :"Envoi rapide", + "add-new" :"Ajouter un nouveau", + "send" :"envoyer", + "quick-send-alert-1":"Tous les rôles dans ce document sont actuellement liés à des contacts. Pour envoyer rapidement des copies de ce modèle à plusieurs signataires, veuillez vous assurer qu'au moins un rôle n'est lié à aucun contact.", + "quick-send-alert-2":"Veuillez vous assurer qu'au moins un widget de signature est ajouté pour tous les destinataires.", + "quick-send-alert-3":"Veuillez ajouter au moins un rôle à ce modèle afin d'en « envoyer rapidement » des copies à plusieurs signataires.", + "quick-send-alert-4":"L'envoi rapide a atteint la limite.", + "copy-link" :"Copier le lien", + "copy":"Copier", + "revoke-document":"Révoquer le document", + "revoke-document-alert" :"Êtes-vous sûr de vouloir révoquer ce document ?", + "resend-mail":"Renvoyer le courrier", + "resend-mail-help" :"Vous pouvez utiliser les variables suivantes qui seront remplacées par leurs valeurs réelles : - {{document_title}}, {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email} }, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.", + "subject":"Sujet", + "body":"Corps", + "add-contact":"Ajouter le contact", + "add-signer-alert":"Le contact existe déjà !", + "record-delete-alert":"Enregistrement supprimé avec succès !", + "record-revoke-alert":" Enregistrement révoqué avec succès ! ", + "mail-sent-alert":"Courriel envoyé avec succès.", + "document-sent-alert":"Document envoyé avec succès !", + "template-share-alert":"Modèle partagé avec succès.", + "template-public-alert-1":"Vous avez rendu le modèle public avec succès.", + "template-public-alert-2":"Vous avez réussi à rendre le modèle privé.", + "template-public-alert-3":"Vous devez sélectionner un rôle pour les signataires publics.", + "template-public-alert-4" :"Veuillez vous assurer qu'au moins un widget de signature est ajouté pour tous les signataires.", + "template-public-alert-5" :"Étant donné que l'envoi dans l'ordre est activé sur ce modèle, le rôle public doit être positionné en haut.", + "template-public-alert-6" :"Veuillez associer des signataires à tous les rôles, à l'exception du rôle d'utilisateur public.", + "template-public-alert-7" :"Veuillez attribuer au moins un rôle public pour rendre ce modèle public.", + "loader":"Cela pourrait prendre un certain temps", + "pages":"Pages", + "document-signed":"Document signé", + "close":"Fermer", + "validation-alert":"Alerte de validation", + "validate-alert-mssg" :"L'entrée ne répond pas aux critères définis par l'expression régulière.", + "otp-verification":"Vérification OTP", + "enter-otp":"Entrez OTP", + "verify":"Vérifier", + "resend":"Renvoyer", + "verify-email":"Veuillez vérifier votre email!", + "send-otp":"envoyer un code à usage unique", + "otp-placeholder":"Saisissez l'OTP reçu par e-mail", + "loading-doc":"Chargement du document..", + "widgets-name":{ + "signature":"signature", + "stamp":"estampiller", + "initials":"initiales", + "name":"nom", + "job title":"titre d'emploi", + "company":"entreprise", + "date":"date", + "text":"texte", + "text input":"saisie de texte", + "checkbox":"checkbocase à cocher", + "dropdown":"dérouler", + "radio button":"bouton radio", + "image": "image", + "email":"e-mail" + }, + "fields" : "Des champs", + "recipients":"Destinataires", + "please-add" :"Veuillez ajouter un", + "signed-by" :"Signé par", + "more":"plus", + "sent":"Envoyé", + "print":"imprimer", + "certificate":"Certificat", + "decline":"refusé", + "finish":"terminé", + "mail":"Mail", + "sign-now":"Signez maintenant", + "successfully-signed" :"Signé avec succès !", + "email-mssg" :"Les destinataires ajoutés ici recevront une copie du document signé.", + "email-error-1" :"veuillez fournir une adresse e-mail correcte", + "email-error-2" :"Vous ne pouvez envoyer qu'à dix destinataires à la fois.", + "upload-stamp-image":"Télécharger l'image du tampon", + "draw":"Dessiner", + "type":"Type", + "my-initials" :"Mes initiales", + "upload" :"Télécharger", + "initial-teb":"Initiales", + "signature-tab":"Signature", + "your-signature" :"Votre signature", + "copy-to-all-pages" :"Copier sur toutes les pages", + "apply" :"Appliquer", + "copy-type":{ + "All pages":"Toutes les pages", + "All pages but last": "Toutes les pages sauf la dernière", + "All pages but first":"Toutes les pages sauf la première" + }, + "options": "Possibilités", + "minimun-check" :"Vérification minimale", + "maximum-check" :"Contrôle maximum", + "default-value" :"Valeur par défaut", + "select":"Sélectionner", + "read-only" :"Est en lecture seule", + "hide-labels":"Masquer les étiquettes", + "checkbox":"Case à cocher", + "alert":"Alerte", + "zoom-in":"Agrandir", + "zoom-out" :"Dézoomer", + "document-signed-alert" :"Félicitations ! 🎉 Ce document a été signé avec succès par vous !", + "otp-sent-alert" :"OTP envoyé sur votre email", + "fields-required" :"Champs obligatoires", + "signature-widget-alert-1" :"Veuillez vous assurer qu'au moins un widget de signature a été ajouté", + "signature-widget-alert-2" :"Veuillez vous assurer que tous les champs sont remplis avec précision et répondent à toutes les exigences.", + "encrypted-pdf-alert" :"Les fichiers PDF actuellement cryptés ne sont pas pris en charge.", + "user-not-exist" :"L'utilisateur n'existe pas", + "template-signature-field":"Veuillez ajouter au moins un champ de signature pour tous les rôles.", + "template-role-alert":"Veuillez d'abord ajouter des rôles", + "create-document" :"Créer un document", + "template-created-alert":"Voulez-vous créer un document en utilisant le modèle que vous vient de créer ?", + "signers-alert" :"alerte des signataires", + "template-creation-alert-1" :"Veuillez sélectionner le signataire pour ajouter un espace réservé !", + "ok":"D'accord", + "radio-group" :"Groupe de radio", + "dropdown-options":"Options déroulantes", + "add-role" :"Ajouter un rôle", + "role-ex" :"Ex : Client, RH, Directeur, Manager, Étudiant, etc.", + "add/choose-signer":"Ajouter/Choisir un signataire", + "choose-from-contacts":"Choisissez parmi les contacts", + "select-signer":"Veuillez sélectionner le signataire", + "edit-template" :"Modifier le modèle", + "widget-info" :"Informations sur les widgets", + "validation" : "Validation", + "invalid-default-value" :"valeur par défaut invalide", + "hint":"Indice", + "color":"couleur", + "role-help":{ + "p1":"Que sont les rôles modèles ?", + "p2":"Commencez par spécifier chaque rôle nécessaire à la finalisation du document. Pensez aux parties impliquées dans le processus de signature et à leurs responsabilités. Les rôles courants incluent les RH pour les documents internes, le Client pour les accords ou le Fournisseur pour les accords commerciaux.", + "p3":"Pourquoi pré-attacher les utilisateurs à certains rôles ?", + "p4":"Pour les rôles qui impliquent systématiquement la même personne (par exemple, la signature du PDG sur les lettres d'offre des employés), vous pouvez pré-attacher un utilisateur à un rôle dans le modèle. Cette étape est facultative mais recommandée pour des raisons d'efficacité et de cohérence entre les documents.", + "p5":"Quand dois-je spécifier l'utilisateur attaché à chaque rôle ?", + "p6":"Lorsque vous créez un document à partir de votre modèle, vous serez invité à attacher des utilisateurs à chaque rôle défini. Si un rôle est déjà associé à un utilisateur, celui-ci sera pré-rempli, mais vous pourrez le modifier si nécessaire avant d'envoyer le document." + }, + "add-recipients":"Ajouter des destinataires", + "loading-mssg" :"Cela pourrait prendre du temps", + "send-mail" :"Envoyer un mail", + "placeholder-alert-1" :"Veuillez vous assurer qu'au moins un widget de signature est ajouté pour tous les destinataires.", + "placeholder-alert-2" :"Veuillez confirmer que vous avez rempli le champ de texte.", + "placeholder-alert-3" :"Etes-vous sûr de vouloir envoyer ce document pour signature ? ", + "placeholder-alert-4" :"Vous avez envoyé avec succès des mails à tous les", + "placeholder-alert-5" :"Voulez-vous signer des documents maintenant ?", + "placeholder-alert-6" :"Veuillez configurer l'adaptateur de messagerie pour envoyer du courrier !", + "placeholder-alert-7" :"Veuillez sélectionner le signataire pour ajouter un espace réservé !", + "email-subject":"Sujet du courriel", + "email-body":"corps de l'e-mail", + "email-placeholder" :"ajouter le corps de l'e-mail", + "reset-to-default" :"Réinitialiser aux valeurs par défaut", + "cutomize-email":"Personnaliser l'e-mail", + "upgrade-to-customize-email":"Mise à niveau pour personnaliser l'e-mail", + "sign-url" :"Signer l'URL", + "Mails Sent" :"Mails envoyés", + "document-alert" :"Alerte document", + "owner-subscription-expired":"L'abonnement du propriétaire a expiré.", + "subscription-expired" :"Abonnement expiré", + "alert-message" :"Message d'alerte", + "document-decline" :"Document-refus", + "decline-alert-1":"Etes-vous sûr de vouloir refuser ce document ?", + "decline-alert-2": "Vous avez refusé ce document !", + "decline-alert-3": "Vous ne pouvez pas signer ce document car il a été refusé/révoqué.", + "sign here":"Signer ici", + "guest-email-alert" :"le code de vérification a été envoyé sur votre e-mail", + "get-otp-alert":"vous recevrez un mot de passe à usage unique par e-mail" + - "document-signature":{ - "loader":"Cela pourrait prendre un certain temps", - "pages":"Pages", - "document-signed":"Document signé", - "close":"Close", - "validation-alert":"Alerte de validation", - "validate-alert-mssg" :"L'entrée ne répond pas aux critères définis par l'expression régulière.", - "otp-verification":"Vérification OTP", - "enter-otp":"Entrez OTP", - "verify":"Vérifier", - "resend":"Renvoyer", - "verify-email":"Veuillez vérifier votre email!", - "send-otp":"Envoyer OTP", - "otp-placeholder":"Saisissez l'OTP reçu par e-mail", - "loading-doc":"Chargement du document.." - } - + } \ No newline at end of file diff --git a/apps/OpenSign/src/components/AddSigner.js b/apps/OpenSign/src/components/AddSigner.js index 9b85ebb13..4b1e0e9c1 100644 --- a/apps/OpenSign/src/components/AddSigner.js +++ b/apps/OpenSign/src/components/AddSigner.js @@ -169,17 +169,17 @@ const AddSigner = (props) => { } } } else { - alert("Contact already exist!"); + alert(t("add-signer-alert")); setIsLoader(false); } } catch (err) { console.log("err in fetch contact", err); setIsLoader(false); - alert("something went wrong, please try again later"); + alert(t("something-went-wrong-mssg")); } } else { setIsLoader(false); - alert("something went wrong, please try again later"); + alert(t("something-went-wrong-mssg")); } }; diff --git a/apps/OpenSign/src/components/AddTeam.js b/apps/OpenSign/src/components/AddTeam.js index a76ac98f5..088e13edd 100644 --- a/apps/OpenSign/src/components/AddTeam.js +++ b/apps/OpenSign/src/components/AddTeam.js @@ -2,8 +2,10 @@ import React, { useEffect, useState } from "react"; import Parse from "parse"; import Title from "./Title"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const AddTeam = (props) => { + const { t } = useTranslation(); const [formdata, setFormdata] = useState({ name: "", team: "" @@ -140,7 +142,7 @@ const AddTeam = (props) => { htmlFor="name" className="block text-xs text-gray-700 font-semibold" > - Name + {t("name")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -157,7 +159,7 @@ const AddTeam = (props) => { htmlFor="phone" className="block text-xs text-gray-700 font-semibold" > - Parent Team + {t("report-heading.Parent Team")} </label> <select value={formdata.team} @@ -175,14 +177,14 @@ const AddTeam = (props) => { </div> <div className="flex items-center mt-3 gap-2 text-white"> <button type="submit" className="op-btn op-btn-primary"> - Submit + {t("submit")} </button> <div type="button" onClick={() => handleReset()} className="op-btn op-btn-secondary" > - Reset + {t("reset")} </div> </div> </form> diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js index 2413ad30f..68ff280cf 100644 --- a/apps/OpenSign/src/components/AddUser.js +++ b/apps/OpenSign/src/components/AddUser.js @@ -4,6 +4,7 @@ import Title from "./Title"; import Loader from "../primitives/Loader"; import { copytoData } from "../constant/Utils"; import { isEnableSubscription } from "../constant/const"; +import { useTranslation } from "react-i18next"; function generatePassword(length) { const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; @@ -17,6 +18,7 @@ function generatePassword(length) { } const AddUser = (props) => { + const { t } = useTranslation(); const [formdata, setFormdata] = useState({ name: "", phone: "", @@ -260,7 +262,7 @@ const AddUser = (props) => { htmlFor="name" className="block text-xs text-gray-700 font-semibold" > - Name + {t("name")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -277,7 +279,7 @@ const AddUser = (props) => { htmlFor="email" className="block text-xs text-gray-700 font-semibold" > - Email + {t("email")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -294,7 +296,7 @@ const AddUser = (props) => { htmlFor="email" className="block text-xs text-gray-700 font-semibold" > - Password + {t("password")} </label> <div className="flex justify-between items-center op-input op-input-bordered op-input-sm text-base-content w-full h-full text-[13px]"> <div className="break-all">{formdata?.password}</div> @@ -304,7 +306,7 @@ const AddUser = (props) => { ></i> </div> <div className="text-[12px] ml-2 mb-0 text-[red] select-none"> - Password will only be generated once; make sure to copy it. + {t("password-generateed")} </div> </div> <div className="mb-3"> @@ -312,7 +314,7 @@ const AddUser = (props) => { htmlFor="phone" className="block text-xs text-gray-700 font-semibold" > - Phone + {t("phone")} {/* <span className="text-[red] text-[13px]"> *</span> */} </label> <input diff --git a/apps/OpenSign/src/components/BulkSendUi.js b/apps/OpenSign/src/components/BulkSendUi.js index 3a737d3d9..dfeea9921 100644 --- a/apps/OpenSign/src/components/BulkSendUi.js +++ b/apps/OpenSign/src/components/BulkSendUi.js @@ -2,8 +2,10 @@ import React, { useState, useEffect, useRef } from "react"; import axios from "axios"; import SuggestionInput from "./shared/fields/SuggestionInput"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const BulkSendUi = (props) => { + const { t } = useTranslation(); const [forms, setForms] = useState([]); const [formId, setFormId] = useState(2); const formRef = useRef(null); @@ -96,7 +98,7 @@ const BulkSendUi = (props) => { setScrollOnNextUpdate(true); } else { // If the limit has been reached, throw an error with the appropriate message - alert("Quick send reached limit."); + alert(t("quick-send-alert-4")); } }; @@ -244,36 +246,32 @@ const BulkSendUi = (props) => { onClick={handleAddForm} className="op-btn op-btn-primary focus:outline-none" > - <i className="fa-light fa-plus"></i> <span>Add new</span> + <i className="fa-light fa-plus"></i>{" "} + <span>{t("add-new")}</span> </button> <button type="submit" className="op-btn op-btn-secondary focus:outline-none" > <i className="fa-light fa-paper-plane"></i>{" "} - <span>Send</span> + <span>{t("send")}</span> </button> </div> </form> ) : ( <div className="text-black p-3 bg-white w-full text-sm md:text-base flex justify-center items-center"> - All roles in this document are currently linked to contacts. To - 'quick send' copies of this template to multiple - signers, please ensure that at least one role is not linked to - any contact. + {t("quick-send-alert-1")} </div> )} </> ) : ( <div className="text-black p-3 bg-white w-full text-sm md:text-base flex justify-center items-center"> - Please ensure there's at least one signature widget added for - all recipients. + {t("quick-send-alert-2")} </div> ) ) : ( <div className="text-black p-3 bg-white w-full text-sm md:text-base flex justify-center items-center"> - Please add at least one role to this template in order to 'quick - send' copies of it to multiple signers. + {t("quick-send-alert-3")} </div> )} </> diff --git a/apps/OpenSign/src/components/Header.js b/apps/OpenSign/src/components/Header.js index edfb32b68..31968315b 100644 --- a/apps/OpenSign/src/components/Header.js +++ b/apps/OpenSign/src/components/Header.js @@ -11,8 +11,10 @@ import { openInNewTab } from "../constant/Utils"; import { isEnableSubscription, isStaging } from "../constant/const"; +import { useTranslation } from "react-i18next"; const Header = ({ showSidebar }) => { + const { t } = useTranslation(); const navigate = useNavigate(); const { width } = useWindowSize(); let username = localStorage.getItem("username"); @@ -126,18 +128,18 @@ const Header = ({ showSidebar }) => { className="text-xs md:text-sm shadow op-btn op-btn-outline op-btn-sm md:op-btn-md op-btn-accent" onClick={() => navigate("/subscription")} > - Upgrade Now + {t("upgrade-now")} </button> </div> )} {!isTeam && isPro && ( <div className="w-[35px] h-[35px] bg-white rounded-full ring-[1px] ring-offset-2 ring-[#002862] text-[#002862] overflow-hidden font-semibold flex items-center justify-center"> - PRO + {t("pro")} </div> )} {isTeam && ( <div className="w-[35px] h-[35px] bg-white rounded-full ring-[1px] text-[13px] ring-offset-2 ring-[#002862] text-[#002862] overflow-hidden font-semibold flex items-center justify-center"> - TEAM + {t("team")} </div> )} <div> @@ -182,7 +184,7 @@ const Header = ({ showSidebar }) => { > <li onClick={() => openInNewTab("https://docs.opensignlabs.com")}> <span> - <i className="fa-light fa-book"></i> Docs + <i className="fa-light fa-book"></i> {t("docs")} </span> </li> <li @@ -192,7 +194,7 @@ const Header = ({ showSidebar }) => { }} > <span> - <i className="fa-light fa-user"></i> Profile + <i className="fa-light fa-user"></i> {t("profile")} </span> </li> <li @@ -202,7 +204,7 @@ const Header = ({ showSidebar }) => { }} > <span> - <i className="fa-light fa-lock"></i> Change Password + <i className="fa-light fa-lock"></i> {t("change-password")} </span> </li> <li @@ -216,7 +218,8 @@ const Header = ({ showSidebar }) => { </li> <li onClick={closeDropdown}> <span> - <i className="fa-light fa-arrow-right-from-bracket"></i> Log Out + <i className="fa-light fa-arrow-right-from-bracket"></i>{" "} + {t("log-out")} </span> </li> </ul> diff --git a/apps/OpenSign/src/components/opensigndrive/DriveBody.js b/apps/OpenSign/src/components/opensigndrive/DriveBody.js index 6d12575a1..68398be9c 100644 --- a/apps/OpenSign/src/components/opensigndrive/DriveBody.js +++ b/apps/OpenSign/src/components/opensigndrive/DriveBody.js @@ -8,8 +8,10 @@ import Table from "react-bootstrap/Table"; import * as HoverCard from "@radix-ui/react-hover-card"; import ModalUi from "../../primitives/ModalUi"; import FolderModal from "../shared/fields/FolderModal"; +import { useTranslation } from "react-i18next"; function DriveBody(props) { + const { t } = useTranslation(); const [rename, setRename] = useState(""); const [renameValue, setRenameValue] = useState(""); const inputRef = useRef(null); @@ -42,7 +44,7 @@ function DriveBody(props) { props.setFolderName((prev) => [...prev, folderData]); props.setIsLoading({ isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }); props.setDocId(data.objectId); props.setPdfData([]); diff --git a/apps/OpenSign/src/components/pdf/AddRoleModal.js b/apps/OpenSign/src/components/pdf/AddRoleModal.js index 1da6f8a98..5edfd2e0e 100644 --- a/apps/OpenSign/src/components/pdf/AddRoleModal.js +++ b/apps/OpenSign/src/components/pdf/AddRoleModal.js @@ -1,10 +1,12 @@ import React from "react"; import ModalUi from "../../primitives/ModalUi"; +import { useTranslation } from "react-i18next"; const AddRoleModal = (props) => { + const { t } = useTranslation(); return ( <ModalUi - title={"Add Role"} + title={t("add-role")} isOpen={props.isModalRole} handleClose={props.handleCloseRoleModal} > @@ -21,19 +23,19 @@ const AddRoleModal = (props) => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs mt-1" /> <p className="text-[gray] text-[11px] mt-[5px] mb-[10px] ml-[10px]"> - e.g: Customer, Hr, Director, Manager, Student, etc... + {t("role-ex")}.. </p> <div> <div className="h-[1px] w-full bg-[#9f9f9f] mb-[10px]"></div> <button type="submit" className="op-btn op-btn-primary"> - Add + {t("add")} </button> <button onClick={props.handleCloseRoleModal} type="button" className="op-btn op-btn-ghost ml-2" > - Close + {t("close")} </button> </div> </form> diff --git a/apps/OpenSign/src/components/pdf/DraftDocument.js b/apps/OpenSign/src/components/pdf/DraftDocument.js index 8b4f63b87..461e33a7b 100644 --- a/apps/OpenSign/src/components/pdf/DraftDocument.js +++ b/apps/OpenSign/src/components/pdf/DraftDocument.js @@ -3,16 +3,18 @@ import LoaderWithMsg from "../../primitives/LoaderWithMsg"; import { contractDocument } from "../../constant/Utils"; import HandleError from "../../primitives/HandleError"; import { useLocation, useNavigate } from "react-router-dom"; +import { useTranslation } from "react-i18next"; function useQuery() { return new URLSearchParams(useLocation().search); } function DraftDocument() { + const { t } = useTranslation(); const navigate = useNavigate(); const query = useQuery(); const docId = query.get("docId"); const [isLoading, setIsLoading] = useState({ isLoader: true, - message: "This might take some time" + message: t("loading-mssg") }); useEffect(() => { getDocumentDetails(); diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js index d796f8769..45d9e497c 100644 --- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js +++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js @@ -3,7 +3,9 @@ import { isEnableSubscription } from "../../constant/const"; import ModalUi from "../../primitives/ModalUi"; import { radioButtonWidget } from "../../constant/Utils"; import Upgrade from "../../primitives/Upgrade"; +import { useTranslation } from "react-i18next"; function DropdownWidgetOption(props) { + const { t } = useTranslation(); const [dropdownOptionList, setDropdownOptionList] = useState([ "option-1", "option-2" @@ -155,7 +157,8 @@ function DropdownWidgetOption(props) { > <div> <label className="text-[13px] font-semibold"> - Name<span className="text-[red] text-[13px]"> *</span> + {t("name")} + <span className="text-[red] text-[13px]"> *</span> </label> <input required @@ -166,7 +169,7 @@ function DropdownWidgetOption(props) { /> <label className="text-[13px] font-semibold mt-[5px]"> - Options + {t("options")} </label> <div className="flex flex-col"> {dropdownOptionList.map((option, index) => ( @@ -222,7 +225,7 @@ function DropdownWidgetOption(props) { !props.isSubscribe ? "text-[gray]" : "" } text-[13px] font-semibold`} > - Minimun check + {t("minimun-check")} </label> {!props.isSubscribe && isEnableSubscription && ( <Upgrade /> @@ -245,7 +248,7 @@ function DropdownWidgetOption(props) { !props.isSubscribe ? "text-[gray]" : "" } text-[13px] font-semibold`} > - Maximum check + {t("maximum-check")} </label> <input required @@ -268,7 +271,7 @@ function DropdownWidgetOption(props) { {["dropdown", radioButtonWidget].includes(props.type) && ( <> <label className="text-[13px] font-semibold mt-[5px]"> - Default value + {t("default-value")} </label> <select onChange={(e) => setDefaultValue(e.target.value)} @@ -278,7 +281,7 @@ function DropdownWidgetOption(props) { placeholder="select default value" > <option value="" disabled hidden className="text-[13px]"> - Select... + {t("select")}... </option> {dropdownOptionList.map((data, ind) => { return ( @@ -325,7 +328,7 @@ function DropdownWidgetOption(props) { onChange={(e) => setIsReadOnly(e.target.checked)} /> <label className="ml-1 mb-0" htmlFor="isreadonly"> - Is read only + {t("read-only")} </label> </div> )} @@ -339,7 +342,7 @@ function DropdownWidgetOption(props) { /> <label className="ml-1 mb-0" htmlFor="ishidelabel"> - Hide labels + {t("hide-labels")} </label> </div> </div> @@ -358,7 +361,7 @@ function DropdownWidgetOption(props) { type="submit" className="op-btn op-btn-primary" > - Save + {t("save")} </button> {props.currWidgetsDetails?.options?.values?.length > 0 && ( <button @@ -369,7 +372,7 @@ function DropdownWidgetOption(props) { resetState(); }} > - Cancel + {t("cancel")} </button> )} </form> diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.js b/apps/OpenSign/src/components/pdf/EditTemplate.js index 480de22b5..4b381a480 100644 --- a/apps/OpenSign/src/components/pdf/EditTemplate.js +++ b/apps/OpenSign/src/components/pdf/EditTemplate.js @@ -2,9 +2,11 @@ import React, { useState, useEffect } from "react"; import { checkIsSubscribed, getFileName } from "../../constant/Utils"; import Upgrade from "../../primitives/Upgrade"; import { isEnableSubscription } from "../../constant/const"; +import { useTranslation } from "react-i18next"; // import SelectFolder from "../../premitives/SelectFolder"; const EditTemplate = ({ template, onSuccess }) => { + const { t } = useTranslation(); // const [folder, setFolder] = useState({ ObjectId: "", Name: "" }); const [formData, setFormData] = useState({ Name: template?.Name || "", @@ -62,7 +64,7 @@ const EditTemplate = ({ template, onSuccess }) => { <form onSubmit={handleSubmit}> <div className="mb-[0.35rem]"> <label htmlFor="name" className="text-[13px]"> - File + {t("report-heading.File")} </label> <div className="op-input op-input-bordered op-input-sm focus:outline-none py-2 font-semibold w-full text-xs"> {getFileName(template.URL)} @@ -70,7 +72,7 @@ const EditTemplate = ({ template, onSuccess }) => { </div> <div className="mb-[0.35rem]"> <label htmlFor="name" className="text-[13px]"> - Name + {t("name")} <span className="text-[13px] text-[red]"> *</span> </label> <input @@ -84,7 +86,7 @@ const EditTemplate = ({ template, onSuccess }) => { </div> <div className="mb-[0.35rem]"> <label htmlFor="Note" className="text-[13px]"> - Note + {t("report-heading.Note")} </label> <input type="text" @@ -97,7 +99,7 @@ const EditTemplate = ({ template, onSuccess }) => { </div> <div className="mb-[0.35rem]"> <label htmlFor="Description" className="text-[13px]"> - Description + {t("description")} </label> <input type="text" @@ -109,7 +111,7 @@ const EditTemplate = ({ template, onSuccess }) => { /> </div> <div className="mb-[0.35rem]"> - <label className="text-[13px]">Send In Order</label> + <label className="text-[13px]">{t("send-in-order")}</label> <div className="flex items-center gap-[8px] ml-[8px] mb-[5px]"> <input type="radio" @@ -119,7 +121,7 @@ const EditTemplate = ({ template, onSuccess }) => { checked={formData.SendinOrder === "true"} onChange={handleStrInput} /> - <div className="text-[12px]">Yes</div> + <div className="text-[12px]">{t("yes")}</div> </div> <div className="flex items-center gap-[8px] ml-[8px] mb-[5px]"> <input @@ -130,7 +132,7 @@ const EditTemplate = ({ template, onSuccess }) => { checked={formData.SendinOrder === "false"} onChange={handleStrInput} /> - <div className="text-[12px]">No</div> + <div className="text-[12px]">{t("no")}</div> </div> </div> {isEnableSubscription && ( @@ -140,7 +142,8 @@ const EditTemplate = ({ template, onSuccess }) => { isSubscribe ? "font-semibold" : "font-semibold text-gray-300" } > - Auto reminder{" "} + {t("auto-reminder")} + {" "} {!isSubscribe && isEnableSubscription && <Upgrade />} </span> <label @@ -162,7 +165,7 @@ const EditTemplate = ({ template, onSuccess }) => { {isSubscribe && formData?.AutomaticReminders === true && ( <div className="text-xs mt-2"> <label className="block"> - Remind once in every (Days) + {t("remind-once")} <span className="text-red-500 text-[13px]">*</span> </label> <input @@ -177,7 +180,7 @@ const EditTemplate = ({ template, onSuccess }) => { )} <div className="mt-[1rem] flex justify-start"> <button type="submit" className="op-btn op-btn-primary"> - Submit + {t("submit")} </button> </div> </form> diff --git a/apps/OpenSign/src/components/pdf/EmailBody.js b/apps/OpenSign/src/components/pdf/EmailBody.js index d4639e098..8df4e951d 100644 --- a/apps/OpenSign/src/components/pdf/EmailBody.js +++ b/apps/OpenSign/src/components/pdf/EmailBody.js @@ -3,13 +3,15 @@ import Tooltip from "../../primitives/Tooltip"; import ReactQuill from "react-quill"; import "react-quill/dist/quill.snow.css"; import EditorToolbar, { module1, formats } from "./EditorToolbar"; +import { useTranslation } from "react-i18next"; export function EmailBody(props) { + const { t } = useTranslation(); return ( <form className="flex flex-col text-base-content text-lg font-normal"> <div className="m-2 md:m-10 p-3 md:p-10 shadow-md hover:shadow-lg border-[1px] border-indigo-800 rounded-md"> <label className="text-sm ml-2"> - Subject <Tooltip message={"email subject"} /> + {t("subject")} <Tooltip message={t("email-subject")} /> </label> <input required @@ -19,7 +21,7 @@ export function EmailBody(props) { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> <label className="text-sm ml-2 mt-3"> - Body <Tooltip message={"email body"} /> + {t("body")} <Tooltip message={t("email-body")} /> </label> <div className="px-3 py-2 w-full focus:outline-none text-xs"> <EditorToolbar containerId="toolbar1" /> @@ -27,7 +29,7 @@ export function EmailBody(props) { theme="snow" value={props.requestBody} // value={typedText} - placeholder="add body of email " + placeholder={t("email-placeholder")} // readOnly={loading} // onChangeSelection={handleTextSelection} // Listen for text selection ref={props.editorRef} diff --git a/apps/OpenSign/src/components/pdf/EmailComponent.js b/apps/OpenSign/src/components/pdf/EmailComponent.js index 2ee4a9a7e..330d657b3 100644 --- a/apps/OpenSign/src/components/pdf/EmailComponent.js +++ b/apps/OpenSign/src/components/pdf/EmailComponent.js @@ -6,6 +6,7 @@ import { themeColor, emailRegex } from "../../constant/const"; import printModule from "print-js"; import Loader from "../../primitives/Loader"; import ModalUi from "../../primitives/ModalUi"; +import { useTranslation } from "react-i18next"; function EmailComponent({ isEmail, @@ -18,6 +19,7 @@ function EmailComponent({ extUserId, activeMailAdapter }) { + const { t } = useTranslation(); const [emailList, setEmailList] = useState([]); const [emailValue, setEmailValue] = useState(""); const [isLoading, setIsLoading] = useState(false); @@ -68,7 +70,7 @@ function EmailComponent({ setIsEmail(false); setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); } } @@ -88,7 +90,7 @@ function EmailComponent({ setIsEmail(false); setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); setEmailValue(""); setEmailList([]); @@ -97,7 +99,7 @@ function EmailComponent({ setIsEmail(false); setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); setEmailValue(""); setEmailList([]); @@ -184,13 +186,13 @@ function EmailComponent({ <div className="absolute w-full h-full flex flex-col justify-center items-center z-[20] bg-[#e6f2f2]/70"> <Loader /> <span className="text-[12px] text-base-content"> - This might take some time + {t("loader")} </span> </div> )} <div className="flex justify-between items-center py-[10px] px-[20px] border-b-[1px] border-base-content"> <span className="text-base-content font-semibold"> - Successfully signed! + {t("successfully-signed")} </span> <div className="flex flex-row"> {!isAndroid && ( @@ -199,7 +201,7 @@ function EmailComponent({ className="op-btn op-btn-neutral op-btn-sm text-[15px]" > <i className="fa-light fa-print" aria-hidden="true"></i> - Print + {t("print")} </button> )} <button @@ -207,13 +209,13 @@ function EmailComponent({ onClick={() => handleDownloadPdf()} > <i className="fa-light fa-download" aria-hidden="true"></i> - Download + {t("download")} </button> </div> </div> <div className="h-full p-[20px]"> <p className="font-medium text-[15px] mb-[5px] text-base-content align-baseline"> - Recipients added here will get a copy of the signed document. + {t("email-mssg")} </p> {emailList.length > 0 ? ( <div className="p-0 border-[1.5px] op-border-primary rounded w-full text-[15px]"> @@ -265,7 +267,7 @@ function EmailComponent({ )} {emailErr && ( <p className="text-xs text-[red] ml-1.5 mt-0.5"> - please provide correct email address + {t("email-error-1")} </p> )} <button @@ -278,10 +280,8 @@ function EmailComponent({ </button> <div className="bg-[#e3e2e1] mt-[10px] p-[5px] rounded"> - <span className="font-bold">Note: </span> - <span className="text-[15px]"> - You can only send to ten recipients at a time. - </span> + <span className="font-bold">{t("report-heading.Note")}: </span> + <span className="text-[15px]">{t("email-error-2")}</span> </div> <hr className="w-full my-[15px] bg-base-content" /> <button @@ -289,7 +289,7 @@ function EmailComponent({ className="op-btn op-btn-secondary" onClick={() => emailList.length > 0 && sendEmail()} > - Send + {t("send")} </button> <button type="button" @@ -300,7 +300,7 @@ function EmailComponent({ setEmailList([]); }} > - Close + {t("close")} </button> </div> </ModalUi> diff --git a/apps/OpenSign/src/components/pdf/PdfHeader.js b/apps/OpenSign/src/components/pdf/PdfHeader.js index c12085814..b685b2cdd 100644 --- a/apps/OpenSign/src/components/pdf/PdfHeader.js +++ b/apps/OpenSign/src/components/pdf/PdfHeader.js @@ -9,6 +9,7 @@ import "../../styles/signature.css"; import * as DropdownMenu from "@radix-ui/react-dropdown-menu"; import ModalUi from "../../primitives/ModalUi"; import Loader from "../../primitives/Loader"; +import { useTranslation } from "react-i18next"; function Header({ isPdfRequestFiles, @@ -35,6 +36,7 @@ function Header({ setIsEditTemplate, isPublicTemplate }) { + const { t } = useTranslation(); const filterPrefill = signerPos && signerPos?.filter((data) => data.Role !== "prefill"); const isMobile = window.innerWidth < 767; @@ -97,7 +99,7 @@ function Header({ className="fa-light fa-arrow-down mr-[3px]" aria-hidden="true" ></i> - Download + {t("download")} </div> </DropdownMenu.Item> {isCompleted && ( @@ -115,7 +117,7 @@ function Header({ className="fa-light fa-award mr-[3px]" aria-hidden="true" ></i> - Certificate + {t("certificate")} </div> </DropdownMenu.Item> )} @@ -129,7 +131,7 @@ function Header({ className="fa-light fa-envelope mr-[3px]" aria-hidden="true" ></i> - Mail + {t("mail")} </div> </DropdownMenu.Item> )} @@ -144,7 +146,7 @@ function Header({ className="fa-light fa-print mr-[3px]" aria-hidden="true" ></i> - Print + {t("print")} </div> </DropdownMenu.Item> </DropdownMenu.Content> @@ -191,7 +193,7 @@ function Header({ }} className="border-none font-[650] text-[14px] op-link op-link-primary no-underline" > - Finish + {t("finish")} </div> )} <DropdownMenu.Root> @@ -222,7 +224,7 @@ function Header({ className="fa-light fa-arrow-down mr-[3px]" aria-hidden="true" ></i> - <span className="font-[500]">Download</span> + <span className="font-[500]">{t("download")}</span> </DropdownMenu.Item> </DropdownMenu.Content> </DropdownMenu.Portal> @@ -249,13 +251,14 @@ function Header({ <div> {filterPrefill.length === 0 ? ( <span className="text-[13px] text-[#f5405e]"> - Add {signersdata.length - filterPrefill.length}{" "} - recipients signature + {t("add")} {signersdata.length - filterPrefill.length}{" "} + {t("recipients")} {t("widgets-name.signature")} </span> ) : ( <span className="text-[13px] text-[#f5405e]"> - Add {signersdata.length - filterPrefill.length} more - recipients signature + {t("add")} {signersdata.length - filterPrefill.length}{" "} + {t("more")} + {t("recipients")} {t("widgets-name.signature")} </span> )} </div> @@ -275,7 +278,7 @@ function Header({ type="button" className="op-btn op-btn-ghost op-btn-sm mr-[3px]" > - Back + {t("back")} </button> <button disabled={isMailSend && true} @@ -286,8 +289,8 @@ function Header({ {completeBtnTitle ? completeBtnTitle : isMailSend - ? "Sent" - : "Send"} + ? t("sent") + : t("send")} </button> </div> </> @@ -303,7 +306,7 @@ function Header({ className="fa-light fa-print py-[3px]" aria-hidden="true" ></i> - <span className="hidden lg:block">Print</span> + <span className="hidden lg:block">{t("print")}</span> </button> {isCompleted && ( <button @@ -317,7 +320,7 @@ function Header({ className="fa-light fa-award py-[3px]" aria-hidden="true" ></i> - <span className="hidden lg:block">Certificate</span> + <span className="hidden lg:block">{t("certificate")}</span> </button> )} <button @@ -331,7 +334,7 @@ function Header({ className="fa-light fa-download py-[3px]" aria-hidden="true" ></i> - <span className="hidden lg:block">Download</span> + <span className="hidden lg:block">{t("download")}</span> </button> </div> ) : ( @@ -341,7 +344,7 @@ function Header({ type="button" className="op-btn op-btn-ghost op-btn-sm mr-[3px]" > - Back + {t("back")} </button> {currentSigner && ( <> @@ -349,14 +352,14 @@ function Header({ className="op-btn op-btn-secondary op-btn-sm mr-[3px] shadow" onClick={() => handleDeclinePdfAlert()} > - Decline + {t("decline")} </button> <button type="button" className="op-btn op-btn-primary op-btn-sm mr-[3px] shadow" onClick={() => embedWidgetsData()} > - Finish + {t("finish")} </button> <button type="button" @@ -366,7 +369,7 @@ function Header({ } > <i className="fa-light fa-arrow-down font-semibold lg:hidden"></i> - <span className="hidden lg:block">Download</span> + <span className="hidden lg:block">{t("download")}</span> </button> </> )} @@ -383,7 +386,9 @@ function Header({ className="op-btn op-btn-secondary op-btn-sm gap-0 font-medium text-[12px] mr-[3px] shadow" > <i className="fa-light fa-award" aria-hidden="true"></i> - <span className="hidden lg:block ml-1">Certificate</span> + <span className="hidden lg:block ml-1"> + {t("certificate")} + </span> </button> )} <button @@ -392,7 +397,7 @@ function Header({ className="op-btn op-btn-neutral op-btn-sm gap-0 font-medium text-[12px] mr-[3px] shadow" > <i className="fa-light fa-print" aria-hidden="true"></i> - <span className="hidden lg:block ml-1">Print</span> + <span className="hidden lg:block ml-1">{t("print")}</span> </button> <button type="button" @@ -402,7 +407,7 @@ function Header({ } > <i className="fa-light fa-download" aria-hidden="true"></i> - <span className="hidden lg:block ml-1">Download</span> + <span className="hidden lg:block ml-1">{t("download")}</span> </button> <button type="button" @@ -410,7 +415,7 @@ function Header({ onClick={() => setIsEmail(true)} > <i className="fa-light fa-envelope" aria-hidden="true"></i> - <span className="hidden lg:block ml-1">Mail</span> + <span className="hidden lg:block ml-1">{t("mail")}</span> </button> </div> ) : isPublicTemplate ? ( @@ -423,7 +428,7 @@ function Header({ embedWidgetsData(); }} > - Sign Now + {t("sign-now")} </button> </div> </> @@ -434,7 +439,7 @@ function Header({ type="button" className="op-btn op-btn-ghost op-btn-sm mr-[3px]" > - Back + {t("back")} </button> <button type="button" @@ -445,7 +450,7 @@ function Header({ } }} > - Finish + {t("finish")} </button> </div> )} diff --git a/apps/OpenSign/src/components/pdf/PdfZoom.js b/apps/OpenSign/src/components/pdf/PdfZoom.js index eaacbbf04..c12868e01 100644 --- a/apps/OpenSign/src/components/pdf/PdfZoom.js +++ b/apps/OpenSign/src/components/pdf/PdfZoom.js @@ -1,6 +1,8 @@ import React from "react"; +import { useTranslation } from "react-i18next"; function PdfZoom(props) { + const { t } = useTranslation(); const onClickZoomIn = () => { props.setScale(props.scale + 0.1 * props.scale); props.setZoomPercent(props.zoomPercent + 10); @@ -25,14 +27,14 @@ function PdfZoom(props) { <span className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px] cursor-pointer" onClick={onClickZoomIn} - title="Zoom in" + title={t("zoom-in")} > <i className="fa-light fa-magnifying-glass-plus text-gray-500 2xl:text-[30px]"></i> </span> <span className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px] cursor-pointer" onClick={handleReset} - title="Reset" + title={t("reset")} > <i className="fa-light fa-magnifying-glass-arrows-rotate text-gray-500 2xl:text-[30px]"></i> </span> @@ -42,7 +44,7 @@ function PdfZoom(props) { style={{ cursor: props.zoomPercent > 0 ? "pointer" : "default" }} - title="Zoom out" + title={t("zoom-out")} > <i className="fa-light fa-magnifying-glass-minus text-gray-500 2xl:text-[30px]"></i> </span> diff --git a/apps/OpenSign/src/components/pdf/PlaceholderCopy.js b/apps/OpenSign/src/components/pdf/PlaceholderCopy.js index a7cdf26f8..64c85c413 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderCopy.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderCopy.js @@ -1,8 +1,10 @@ import React, { useState } from "react"; import ModalUi from "../../primitives/ModalUi"; import { randomId, textWidget } from "../../constant/Utils"; +import { useTranslation } from "react-i18next"; function PlaceholderCopy(props) { + const { t } = useTranslation(); const copyType = ["All pages", "All pages but last", "All pages but first"]; const [selectCopyType, setSelectCopyType] = useState(""); //function for get copy placeholder position @@ -188,7 +190,7 @@ function PlaceholderCopy(props) { return ( <ModalUi isOpen={props.isPageCopy} - title={"Copy to all pages"} + title={t("copy-to-all-pages")} handleClose={() => handleUniqueId()} > <div className="h-full p-[20px] text-base-content"> @@ -203,8 +205,7 @@ function PlaceholderCopy(props) { onChange={() => setSelectCopyType(data)} checked={selectCopyType === data} /> - - {data} + {t(`copy-type.${data}`)} </label> </div> ); @@ -220,14 +221,14 @@ function PlaceholderCopy(props) { disabled={!selectCopyType} className="op-btn op-btn-primary" > - Apply + {t("apply")} </button> <button type="button" className="op-btn op-btn-ghost" onClick={() => handleUniqueId()} > - Cancel + {t("cancel")} </button> </div> </ModalUi> diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index 546e83a65..1e1531f18 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -14,12 +14,15 @@ import "react-datepicker/dist/react-datepicker.css"; import "../../styles/signature.css"; import RegexParser from "regex-parser"; import { emailRegex } from "../../constant/const"; +import { useTranslation } from "react-i18next"; const textWidgetCls = "w-full h-full md:min-w-full md:min-h-full z-[999] text-[12px] rounded-[2px] border-[1px] border-[#007bff] overflow-hidden resize-none outline-none text-base-content item-center whitespace-pre-wrap"; const selectWidgetCls = "w-full h-full absolute left-0 top-0 border-[1px] border-[#007bff] rounded-[2px] focus:outline-none text-base-content"; function PlaceholderType(props) { + const { t } = useTranslation(); const type = props?.pos?.type; + const widgetTypeTraslation = t(`widgets-name.${props?.pos?.type}`); const [selectOption, setSelectOption] = useState(""); const [validatePlaceholder, setValidatePlaceholder] = useState(""); const inputRef = useRef(null); @@ -311,7 +314,7 @@ function PlaceholderType(props) { props?.handleUserName( props?.data?.Id, props?.data?.Role, - props?.pos?.type + widgetTypeTraslation )} </div> ); @@ -329,7 +332,7 @@ function PlaceholderType(props) { props?.handleUserName( props?.data?.Id, props?.data?.Role, - props?.pos?.type + widgetTypeTraslation )} </div> ); @@ -424,7 +427,7 @@ function PlaceholderType(props) { overflow: "hidden" }} > - <span>{type}</span> + <span>{widgetTypeTraslation}</span> </div> ); case "dropdown": @@ -461,7 +464,9 @@ function PlaceholderType(props) { </select> ) : ( <div className="text-[12px] overflow-hidden"> - {props.pos?.options?.name ? props.pos.options.name : type} + {props.pos?.options?.name + ? props.pos.options.name + : widgetTypeTraslation} </div> ); case "initials": @@ -478,7 +483,7 @@ function PlaceholderType(props) { props?.handleUserName( props?.data?.Id, props?.data?.Role, - props?.pos?.type + widgetTypeTraslation )} </div> ); @@ -524,7 +529,7 @@ function PlaceholderType(props) { overflow: "hidden" }} > - <span>{type}</span> + <span>{widgetTypeTraslation}</span> </div> ); case "company": @@ -568,7 +573,7 @@ function PlaceholderType(props) { fontFamily: "Arial, sans-serif" }} > - <span>{type}</span> + <span>{widgetTypeTraslation}</span> </div> ); case "job title": @@ -612,7 +617,7 @@ function PlaceholderType(props) { overflow: "hidden" }} > - <span>{type}</span> + <span>{widgetTypeTraslation}</span> </div> ); case "date": @@ -699,7 +704,7 @@ function PlaceholderType(props) { props?.handleUserName( props?.data?.Id, props?.data?.Role, - props?.pos?.type + widgetTypeTraslation )} </div> ); @@ -746,7 +751,7 @@ function PlaceholderType(props) { overflow: "hidden" }} > - <span>{type}</span> + <span>{widgetTypeTraslation}</span> </div> ); case radioButtonWidget: diff --git a/apps/OpenSign/src/components/pdf/PrevNext.js b/apps/OpenSign/src/components/pdf/PrevNext.js index a581bcbf1..d4a6a93d2 100644 --- a/apps/OpenSign/src/components/pdf/PrevNext.js +++ b/apps/OpenSign/src/components/pdf/PrevNext.js @@ -1,6 +1,8 @@ import React from "react"; +import { useTranslation } from "react-i18next"; function PrevNext({ pageNumber, allPages, changePage }) { + const { t } = useTranslation(); //for go to previous page function previousPage() { changePage(-1); @@ -20,10 +22,10 @@ function PrevNext({ pageNumber, allPages, changePage }) { <span className="block lg:hidden"> <i className="fa-light fa-backward" aria-hidden="true"></i> </span> - <span className="lg:block hidden 2xl:text-[30px]">Prev</span> + <span className="lg:block hidden 2xl:text-[30px]">{t("prev")}</span> </button> <span className="text-xs text-base-content font-medium mx-2 2xl:text-[30px]"> - {pageNumber || (allPages ? 1 : "--")} of {allPages || "--"} + {pageNumber || (allPages ? 1 : "--")} {t("of")} {allPages || "--"} </span> <button className="op-btn op-btn-neutral op-btn-xs md:op-btn-sm font-semibold text-xs" @@ -33,7 +35,7 @@ function PrevNext({ pageNumber, allPages, changePage }) { <span className="block lg:hidden"> <i className="fa-light fa-forward" aria-hidden="true"></i> </span> - <span className="lg:block hidden 2xl:text-[30px]">Next</span> + <span className="lg:block hidden 2xl:text-[30px]">{t("next")}</span> </button> </div> ); diff --git a/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js b/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js index 68ac073ed..e637c576c 100644 --- a/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js +++ b/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js @@ -69,14 +69,14 @@ function RenderAllPdfPage({ return ( <div ref={pageContainer} className="hidden w-[20%] bg-base-100 md:block"> <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"> - {t("document-signature.pages")} + {t("pages")} </div> <div className={`flex h-[90%] flex-col items-center m-2 autoSignScroll hide-scrollbar max-h-[100vh] `} > <Document - loading={t("document-signature.loading-doc")} + loading={t("loading-doc")} onLoadSuccess={onDocumentLoad} file={signPdfUrl} > diff --git a/apps/OpenSign/src/components/pdf/SignPad.js b/apps/OpenSign/src/components/pdf/SignPad.js index 627d7a857..34a524eae 100644 --- a/apps/OpenSign/src/components/pdf/SignPad.js +++ b/apps/OpenSign/src/components/pdf/SignPad.js @@ -1,4 +1,5 @@ import React, { useRef, useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; import SignatureCanvas from "react-signature-canvas"; function SignPad({ @@ -23,6 +24,7 @@ function SignPad({ currWidgetsDetails, setCurrWidgetsDetails }) { + const { t } = useTranslation(); const [penColor, setPenColor] = useState("blue"); const allColor = ["blue", "red", "black"]; const canvasRef = useRef(null); @@ -82,7 +84,7 @@ function SignPad({ className="op-btn op-btn-ghost mr-1 mt-[2px]" onClick={() => handleClear()} > - Clear + {t("clear")} </button> )} <button @@ -138,7 +140,7 @@ function SignPad({ : true } > - Save + {t("save")} </button> </div> ); @@ -301,8 +303,8 @@ function SignPad({ <span className="text-base-content font-bold text-lg"> {widgetType === "image" || currWidgetsDetails?.type === "image" - ? "Upload image" - : "Upload stamp image"} + ? t("upload-image") + : t("upload-stamp-image")} </span> ) : ( <> @@ -323,7 +325,7 @@ function SignPad({ : "no-underline" } op-link underline-offset-8 ml-[2px]`} > - Draw + {t("draw")} </span> </div> <div> @@ -340,7 +342,7 @@ function SignPad({ : "no-underline" } op-link underline-offset-8 ml-[2px]`} > - Upload Image + {t("upload-image")} </span> </div> <div> @@ -358,7 +360,7 @@ function SignPad({ : "no-underline" } op-link underline-offset-8 ml-[2px]`} > - Type + {t("type")} </span> </div> {!isInitial && defaultSign ? ( @@ -377,7 +379,7 @@ function SignPad({ : "no-underline" } op-link underline-offset-8 ml-[2px]`} > - My Signature + {t("my-signature")} </span> </div> ) : ( @@ -398,7 +400,7 @@ function SignPad({ : "no-underline" } op-link underline-offset-8 ml-[2px]`} > - My Initials + {t("my-initials")} </span> </div> ) @@ -485,7 +487,7 @@ function SignPad({ hidden /> <i className="fa-light fa-cloud-upload-alt uploadImgLogo"></i> - <div className="text-[10px]">Upload</div> + <div className="text-[10px]">{t("upload")}</div> </div> </div> ) : ( @@ -522,7 +524,7 @@ function SignPad({ <div> <div className="flex justify-between items-center"> <span className="mr-[5px] text-[12px]"> - {isInitial ? "Initials" : "Signature"}: + {isInitial ? t("initial-teb") : t("signature-tab")}: </span> <input maxLength={isInitial ? 3 : 30} diff --git a/apps/OpenSign/src/components/pdf/Signedby.js b/apps/OpenSign/src/components/pdf/Signedby.js index cd424b519..0b0411d78 100644 --- a/apps/OpenSign/src/components/pdf/Signedby.js +++ b/apps/OpenSign/src/components/pdf/Signedby.js @@ -1,6 +1,8 @@ import React from "react"; import "../../styles/signature.css"; +import { useTranslation } from "react-i18next"; function Signedby({ pdfDetails }) { + const { t } = useTranslation(); const getFirstLetter = (name) => { const firstLetter = name.charAt(0); return firstLetter; @@ -9,7 +11,7 @@ function Signedby({ pdfDetails }) { return ( <div className="hidden md:block w-full h-full bg-base-100"> <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"> - Signed By + {t("signed-by")} </div> <div className="mt-[2px] bg-base-100"> <div className="bg-[#93a3db] rounded-xl mx-1 flex flex-row items-center py-[10px]"> diff --git a/apps/OpenSign/src/components/pdf/SignerListPlace.js b/apps/OpenSign/src/components/pdf/SignerListPlace.js index 149995ae5..33f90fa3e 100644 --- a/apps/OpenSign/src/components/pdf/SignerListPlace.js +++ b/apps/OpenSign/src/components/pdf/SignerListPlace.js @@ -1,8 +1,10 @@ import React from "react"; import RecipientList from "./RecipientList"; import { Tooltip } from "react-tooltip"; +import { useTranslation } from "react-i18next"; function SignerListPlace(props) { + const { t } = useTranslation(); return ( <div> <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"> @@ -18,36 +20,12 @@ function SignerListPlace(props) { </a> <Tooltip id="my-tooltip" className="z-[100]"> <div className="max-w-[450px] 2xl:max-w-[500px] 2xl:text-[20px] p-[1px]"> - <p className="font-bold pb-[1px]"> - What are template roles? - </p> - <p> - Begin by specifying each role needed for the completion of - the document. Think about the parties involved in the - signing process and what their responsibilities are. - Common roles include HR for internal documents, Customer - for agreements or Vendor for business agreements.{" "} - </p> - <p className="font-bold"> - Why pre-attach users to some roles? - </p> - <p> - For roles that consistently involve the same individual - (e.g., the CEO's signature on employee offer - letters), you can pre-attach a user to a role within the - template. This step is optional but recommended for - efficiency and consistency across documents. - </p> - <p className="font-bold"> - When do i specify the user attached to each role? - </p> - <p> - When you create a document from your template, you'll - be prompted to attach users to each defined role. If a - role already has a user attached, this will be pre-filled, - but you can modify it as needed before sending out the - document. - </p> + <p className="font-bold pb-[1px]">{t("role-help.p1")}</p> + <p>{t("role-help.p2")} </p> + <p className="font-bold">{t("role-help.p3")}</p> + <p>{t("role-help.p4")}</p> + <p className="font-bold">{t("role-help.p5")}</p> + <p>{t("role-help.p6")}</p> </div> </Tooltip> </> @@ -67,7 +45,7 @@ function SignerListPlace(props) { className="op-btn op-btn-accent op-btn-outline w-full mt-[14px]" onClick={() => props.handleAddSigner()} > - <i className="fa-light fa-plus"></i> Add role + <i className="fa-light fa-plus"></i> {t("add-role")} </div> ) : ( <div @@ -77,7 +55,7 @@ function SignerListPlace(props) { disabled={props?.isMailSend ? true : false} onClick={() => props.setIsAddSigner(true)} > - <i className="fa-light fa-plus"></i> Add recipients + <i className="fa-light fa-plus"></i> {t("add-recipients")} </div> )} </div> diff --git a/apps/OpenSign/src/components/pdf/VerifyEmail.js b/apps/OpenSign/src/components/pdf/VerifyEmail.js index b001dfa67..08b0401b1 100644 --- a/apps/OpenSign/src/components/pdf/VerifyEmail.js +++ b/apps/OpenSign/src/components/pdf/VerifyEmail.js @@ -8,7 +8,7 @@ function VerifyEmail(props) { <dialog className="op-modal op-modal-open absolute z-[1999]"> <div className="md:w-[40%] w-[80%] op-modal-box p-0 overflow-y-auto hide-scrollbar text-sm"> <h3 className="font-bold text-lg pt-[15px] px-[20px] text-base-content"> - {t("document-signature.otp-verification")} + {t("otp-verification")} </h3> {props.isVerifyModal ? ( <form @@ -31,13 +31,13 @@ function VerifyEmail(props) { </div> <div className="px-6 my-3"> <button type="submit" className="op-btn op-btn-primary"> - {t("document-signature.verify")} + {t("verify")} </button> <button className="op-btn op-btn-secondary ml-2" onClick={(e) => props.handleResend(e)} > - {t("document-signature.resend")} + {t("resend")} </button> </div> </form> @@ -56,7 +56,7 @@ function VerifyEmail(props) { props.handleVerifyBtn(); }} > - {t("document-signature.send-otp")} + {t("send-otp")} </button> </div> </div> diff --git a/apps/OpenSign/src/components/pdf/WidgetComponent.js b/apps/OpenSign/src/components/pdf/WidgetComponent.js index eb5880297..49500bab4 100644 --- a/apps/OpenSign/src/components/pdf/WidgetComponent.js +++ b/apps/OpenSign/src/components/pdf/WidgetComponent.js @@ -9,6 +9,7 @@ import { textWidget, widgets } from "../../constant/Utils"; +import { useTranslation } from "react-i18next"; function WidgetComponent({ dragSignature, signRef, @@ -40,6 +41,7 @@ function WidgetComponent({ setIsAddSigner, uniqueId }) { + const { t } = useTranslation(); const [isSignersModal, setIsSignersModal] = useState(false); const [, dropdown] = useDrag({ type: "BOX", @@ -330,7 +332,7 @@ function WidgetComponent({ } hidden md:block h-full bg-base-100`} > <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"> - <span>Fields</span> + <span>{t("fields")}</span> </div> <div @@ -348,7 +350,7 @@ function WidgetComponent({ )} {isSignersModal && ( <ModalUi - title={title ? title : "Recipients"} + title={title ? title : t("recipients")} isOpen={isSignersModal} handleClose={handleModal} > @@ -375,7 +377,7 @@ function WidgetComponent({ </div> ) : ( <div className=" p-[20px] text-[15px] font-medium text-center"> - Please add a {title ? title : "recipients"} + {t("please-add")} {title ? title : t("recipients")} </div> )} </ModalUi> diff --git a/apps/OpenSign/src/components/pdf/WidgetList.js b/apps/OpenSign/src/components/pdf/WidgetList.js index a80518b31..2189a0e7d 100644 --- a/apps/OpenSign/src/components/pdf/WidgetList.js +++ b/apps/OpenSign/src/components/pdf/WidgetList.js @@ -1,7 +1,10 @@ import React from "react"; import { getWidgetType } from "../../constant/Utils"; +import { useTranslation } from "react-i18next"; function WidgetList(props) { + const { t } = useTranslation(); + return props.updateWidgets.map((item, ind) => { return ( <div className="2xl:p-3 mb-[5px]" key={ind}> @@ -25,7 +28,7 @@ function WidgetList(props) { onMouseDown={() => props?.handleMouseLeave()} onTouchStart={props?.handleDivClick} > - {item.ref && getWidgetType(item)} + {item.ref && getWidgetType(item, t(`widgets-name.${item.type}`))} </div> </div> ); diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js index 319272f94..db49e061b 100644 --- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js +++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js @@ -7,8 +7,10 @@ import Upgrade from "../../primitives/Upgrade"; import { isEnableSubscription } from "../../constant/const"; import Tooltip from "../../primitives/Tooltip"; import { fontColorArr, fontsizeArr } from "../../constant/Utils"; +import { useTranslation } from "react-i18next"; const WidgetNameModal = (props) => { + const { t } = useTranslation(); const [formdata, setFormdata] = useState({ name: "", defaultValue: "", @@ -104,7 +106,7 @@ const WidgetNameModal = (props) => { <ModalUi isOpen={props.isOpen} handleClose={props.handleClose && props.handleClose} - title={"Widget info"} + title={t("widget-info")} > <form onSubmit={handleSubmit} @@ -114,7 +116,7 @@ const WidgetNameModal = (props) => { > <div className="mb-[0.75rem] text-[13px]"> <label htmlFor="name"> - Name + {t("name")} <span className="text-[red]"> *</span> </label> <input @@ -138,7 +140,7 @@ const WidgetNameModal = (props) => { : "" } text-[13px]`} > - Validation + {t("validation")} </label> <Tooltip url={"https://www.w3schools.com/jsref/jsref_obj_regexp.asp"} @@ -192,7 +194,7 @@ const WidgetNameModal = (props) => { )} <div className="mb-[0.75rem]"> <label htmlFor="name" className="text-[13px]"> - Default value + {t("default-value")} </label> <input className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -216,7 +218,7 @@ const WidgetNameModal = (props) => { className="fa-light fa-exclamation-circle text-[15px]" style={{ color: "#fab005" }} ></i> - invalid default value + {t("invalid-default-value")} </div> )} </div> @@ -247,7 +249,7 @@ const WidgetNameModal = (props) => { {props.defaultdata?.type === textInputWidget && ( <div className="mb-[0.75rem]"> <label htmlFor="hint" className="text-[13px]"> - Hint + {t("hint")} </label> <input className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -283,7 +285,7 @@ const WidgetNameModal = (props) => { })} </select> <div className="flex flex-row gap-1 items-center ml-4"> - <span>color: </span> + <span>{t("color")}: </span> <select value={ props.fontColor || @@ -316,7 +318,7 @@ const WidgetNameModal = (props) => { <div className="h-[1px] w-full mb-[16px] bg-[#b7b3b3]"></div> <button type="submit" className="op-btn op-btn-primary"> - Save + {t("save")} </button> </form> </ModalUi> diff --git a/apps/OpenSign/src/components/shared/fields/SelectSigners.js b/apps/OpenSign/src/components/shared/fields/SelectSigners.js index 3be4ea090..b38cd71cd 100644 --- a/apps/OpenSign/src/components/shared/fields/SelectSigners.js +++ b/apps/OpenSign/src/components/shared/fields/SelectSigners.js @@ -1,8 +1,10 @@ import React, { useState } from "react"; import Parse from "parse"; import AsyncSelect from "react-select/async"; +import { useTranslation } from "react-i18next"; const SelectSigners = (props) => { + const { t } = useTranslation(); const [userList, setUserList] = useState([]); const [selected, setSelected] = useState(); const [userData, setUserData] = useState({}); @@ -71,13 +73,15 @@ const SelectSigners = (props) => { <div className="h-full px-[20px] py-[10px] text-base-content"> <div className="w-full mx-auto p-[8px]"> <div className="mb-0"> - <label className="text-[14px] font-bold">Choose from contacts</label> + <label className="text-[14px] font-bold"> + {t("choose-from-contacts")} + </label> <AsyncSelect cacheOptions defaultOptions value={selected} - loadingMessage={() => "Loading..."} - noOptionsMessage={() => "Contact not found"} + loadingMessage={() => t("loading")} + noOptionsMessage={() => t("contact-not-found")} loadOptions={loadOptions} onChange={handleOptions} unstyled @@ -102,11 +106,11 @@ const SelectSigners = (props) => { isError ? "text-[red]" : "text-transparent" } text-[11px] ml-[6px] my-[2px]`} > - Please select signer + {t("select-signer")} </p> <div> <button className="op-btn op-btn-primary" onClick={() => handleAdd()}> - Submit + {t("submit")} </button> </div> </div> diff --git a/apps/OpenSign/src/components/shared/fields/SignersInput.js b/apps/OpenSign/src/components/shared/fields/SignersInput.js index 1ed5109a3..153d833fe 100644 --- a/apps/OpenSign/src/components/shared/fields/SignersInput.js +++ b/apps/OpenSign/src/components/shared/fields/SignersInput.js @@ -122,7 +122,7 @@ const SignersInput = (props) => { return ( <div className="text-xs mt-2 "> <label className="block relative"> - {t("Signers")} + {t("signers")} {props.required && <span className="text-red-500 text-[13px]">*</span>} <span className="absolute ml-1 text-xs z-30"> <Tooltip id={"signer-tooltip"} message={t("signers-help")} /> diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index f30fc6dfe..398f72a92 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -271,7 +271,6 @@ export const handleImageResize = ( } } }; - export const widgets = [ { type: "signature", @@ -401,14 +400,14 @@ export const addWidgetOptions = (type) => { return {}; } }; -export const getWidgetType = (item) => { +export const getWidgetType = (item, widgetName) => { return ( <div className="op-btn w-fit md:w-[100%] op-btn-primary op-btn-outline op-btn-sm focus:outline-none outline outline-[1.5px] ml-[6px] md:ml-0 p-0 overflow-hidden"> <div className="w-full h-full flex md:justify-between items-center"> <div className="flex justify-start items-center text-[13px] ml-1"> {!isMobile && <i className="fa-light fa-grip-vertical ml-[3px]"></i>} <span className="md:inline-block text-center text-[15px] ml-[5px] font-semibold pr-1 md:pr-0"> - {item.type} + {widgetName} </span> </div> <div className="text-[20px] op-btn op-btn-primary rounded-none w-[40px] h-full flex justify-center items-center"> diff --git a/apps/OpenSign/src/pages/GenerateToken.js b/apps/OpenSign/src/pages/GenerateToken.js index c65984325..511dd892b 100644 --- a/apps/OpenSign/src/pages/GenerateToken.js +++ b/apps/OpenSign/src/pages/GenerateToken.js @@ -75,10 +75,10 @@ function GenerateToken() { setIsAlert({ type: "success", msg: t("token-generated") }); } else { console.error("Error while generating Token"); - setIsAlert({ type: "danger", msg: t("wrong-mssg") }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); } } catch (error) { - setIsAlert({ type: "danger", msg: t("wrong-mssg") }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); console.log("while generating Token", error); } finally { setIsLoader(false); diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index 7b34175df..bdcdb0375 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -7,8 +7,10 @@ import logo from "../assets/images/logo.png"; import { appInfo } from "../constant/appinfo"; import Parse from "parse"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; function GuestLogin() { + const { t } = useTranslation(); const { id, userMail, contactBookId, base64url } = useParams(); const navigate = useNavigate(); const [email, setEmail] = useState(userMail); @@ -198,7 +200,7 @@ function GuestLogin() { <div className="w-full md:w-[50%] text-base-content"> <h1 className="text-2xl md:text-[30px]">Welcome Back!</h1> <legend className="text-[12px] text-[#878787] mt-2 mb-1"> - Verification code is sent to your email + {t("guest-email-alert")} </legend> <div className="p-[20px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md"> <input diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js index 1dc2a8de6..b283e760e 100644 --- a/apps/OpenSign/src/pages/Opensigndrive.js +++ b/apps/OpenSign/src/pages/Opensigndrive.js @@ -10,6 +10,7 @@ import TourContentWithBtn from "../primitives/TourContentWithBtn"; import Tour from "reactour"; import axios from "axios"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const DriveBody = React.lazy( () => import("../components/opensigndrive/DriveBody") @@ -22,6 +23,7 @@ const AppLoader = () => { ); }; function Opensigndrive() { + const { t } = useTranslation(); const navigate = useNavigate(); const scrollRef = useRef(null); const [isList, setIsList] = useState(false); @@ -37,7 +39,7 @@ function Opensigndrive() { const [tourStatusArr, setTourStatusArr] = useState([]); const [isLoading, setIsLoading] = useState({ isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }); const [docId, setDocId] = useState(); const [handleError, setHandleError] = useState(""); @@ -126,7 +128,7 @@ function Opensigndrive() { checkTourStatus(); } if (!disbaleLoading) { - setIsLoading({ isLoad: true, message: "This might take some time" }); + setIsLoading({ isLoad: true, message: t("loading-mssg") }); } try { const driveDetails = await getDrive(docId, skip, limit); diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 9185bbd84..314e33b9f 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -46,8 +46,10 @@ import { useSelector } from "react-redux"; import SignerListComponent from "../components/pdf/SignerListComponent"; import VerifyEmail from "../components/pdf/VerifyEmail"; import PdfZoom from "../components/pdf/PdfZoom"; +import { useTranslation } from "react-i18next"; function PdfRequestFiles(props) { + const { t } = useTranslation(); const [pdfDetails, setPdfDetails] = useState([]); const [signedSigners, setSignedSigners] = useState([]); const [unsignedSigners, setUnSignedSigners] = useState([]); @@ -71,7 +73,7 @@ function PdfRequestFiles(props) { const [tourStatus, setTourStatus] = useState([]); const [isLoading, setIsLoading] = useState({ isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }); const [defaultSignImg, setDefaultSignImg] = useState(); const [isDocId, setIsDocId] = useState(false); @@ -1608,13 +1610,13 @@ function PdfRequestFiles(props) { <Title title={props.templateId ? "Public Sign" : "Request Sign"} /> {isSubscriptionExpired ? ( <ModalUi - title={"Subscription Expired"} + title={t("subscription-expired")} isOpen={isSubscriptionExpired} showClose={false} > <div className="flex flex-col justify-center items-center py-4 md:py-5 gap-5"> <p className="text-sm md:text-lg font-normal"> - Owner's subscription has expired. + {t("owner-subscription-expired")} </p> </div> </ModalUi> @@ -1630,7 +1632,7 @@ function PdfRequestFiles(props) { <div className="absolute h-[100vh] w-full flex flex-col justify-center items-center z-[999] bg-[#e6f2f2] bg-opacity-80"> <Loader /> <span className="text-[13px] text-base-content"> - This might take some time + {t("loading-mssg")} </span> </div> )} @@ -1657,7 +1659,7 @@ function PdfRequestFiles(props) { requestSignTourFunction()} <ModalUi isOpen={isAlert.isShow} - title={"Alert message"} + title={t("alert-message")} handleClose={() => { setIsAlert({ isShow: false, @@ -1678,7 +1680,7 @@ function PdfRequestFiles(props) { type="button" className="op-btn op-btn-primary" > - Ok + {t("ok")} </button> </div> </ModalUi> @@ -1697,14 +1699,13 @@ function PdfRequestFiles(props) { {/* this modal is used to show decline alert */} <PdfDeclineModal show={isDecline.isDeclined} - headMsg="Document decline" + headMsg={t("document-decline")} bodyMssg={ isDecline.currnt === "Sure" - ? "Are you sure want to decline this document ?" + ? t("decline-alert-2") : isDecline.currnt === "YouDeclined" - ? "You have declined this document!" - : isDecline.currnt === "another" && - "You can not sign this document as it has been declined/revoked." + ? t("decline-alert-1") + : isDecline.currnt === "another" && t("decline-alert-3") } footerMessage={isDecline.currnt === "Sure"} declineDoc={declineDoc} @@ -1740,9 +1741,7 @@ function PdfRequestFiles(props) { {isOtp ? ( <form onSubmit={VerifyOTP}> <div className="flex flex-col gap-2"> - <span> - You will get a verification code via email - </span> + <span>{t("get-otp-alert")}</span> <label className="op-input op-input-bordered flex items-center gap-2 "> <input type="number" diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 675868847..a7a352a3e 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -53,8 +53,10 @@ import Loader from "../primitives/Loader"; import { useSelector } from "react-redux"; import PdfZoom from "../components/pdf/PdfZoom"; import LottieWithLoader from "../primitives/DotLottieReact"; +import { useTranslation } from "react-i18next"; function PlaceHolderSign() { + const { t } = useTranslation(); const editorRef = useRef(); const navigate = useNavigate(); const { state } = useLocation(); @@ -78,7 +80,7 @@ function PlaceHolderSign() { const [fontColor, setFontColor] = useState(); const [isLoading, setIsLoading] = useState({ isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }); const [handleError, setHandleError] = useState(); const [currentId, setCurrentId] = useState(""); @@ -268,7 +270,7 @@ function PlaceHolderSign() { //convert document url in array buffer format to use embed widgets in pdf using pdf-lib const arrayBuffer = await convertPdfArrayBuffer(url); if (arrayBuffer === "Error") { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } else { setPdfArrayBuffer(arrayBuffer); } @@ -395,10 +397,10 @@ function PlaceHolderSign() { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); } else { - setHandleError("No Data Found!"); + setHandleError(t("no-data-avaliable")); const loadObj = { isLoad: false }; @@ -410,7 +412,7 @@ function PlaceHolderSign() { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); } else if (res.length && res[0]?.objectId) { setActiveMailAdapter(res[0]?.active_mail_adapter); @@ -433,7 +435,7 @@ function PlaceHolderSign() { }; setIsLoading(loadObj); } else if (res.length === 0) { - setHandleError("No Data Found!"); + setHandleError(t("no-data-avaliable")); const loadObj = { isLoad: false }; @@ -1064,7 +1066,7 @@ function PlaceHolderSign() { > {copied && ( <Alert type="success"> - <div className="ml-3">Copied</div> + <div className="ml-3">{t("copied")}</div> </Alert> )} <span className="w-[220px] md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis "> @@ -1077,12 +1079,12 @@ function PlaceHolderSign() { className="flex flex-row items-center op-link op-link-primary" > <i className="fa-light fa-link" aria-hidden="true"></i> - <span className=" hidden md:block ml-1 ">Copy link</span> + <span className=" hidden md:block ml-1 ">{t("copy-link")}</span> </button> <RWebShare data={{ url: data.url, - title: "Sign url" + title: t("sign-url") }} > <i className="fa-light fa-share-from-square op-link op-link-secondary no-underline"></i> @@ -1705,7 +1707,7 @@ function PlaceHolderSign() { <div className="absolute h-[100vh] w-full flex flex-col justify-center items-center z-[999] bg-[#e6f2f2] bg-opacity-80"> <Loader /> <span className="text-[13px] text-base-content"> - This might take some time + {t("loading-mssg")} </span> </div> )} @@ -1757,29 +1759,21 @@ function PlaceHolderSign() { title={ isSendAlert.mssg === "sure" || isSendAlert.mssg === textWidget - ? "Fields required" - : isSendAlert.mssg === "confirm" && "Send Mail" + ? t("fields-required") + : isSendAlert.mssg === "confirm" && t("send-mail") } handleClose={() => setIsSendAlert({})} > <div className="max-h-96 overflow-y-scroll scroll-hide p-[20px] text-base-content"> {isSendAlert.mssg === "sure" ? ( - <span> - Please ensure there's at least one signature - widget added for all recipients. - </span> + <span>{t("placeholder-alert-1")}</span> ) : isSendAlert.mssg === textWidget ? ( - <p> - Please confirm that you have filled the text field. - </p> + <p>{t("placeholder-alert-2")}</p> ) : ( isSendAlert.mssg === "confirm" && ( <> {!isCustomize && ( - <span> - Are you sure you want to send out this document - for signatures? - </span> + <span>{t("placeholder-alert-3")}</span> )} {isCustomize && isSubscribe && ( <> @@ -1797,7 +1791,7 @@ function PlaceHolderSign() { setRequestSubject(defaultSubject); }} > - <span>Reset to default</span> + <span>{t("reset-to-default")}</span> </div> </> )} @@ -1807,14 +1801,14 @@ function PlaceHolderSign() { onClick={() => sendEmailToSigners()} className="op-btn op-btn-primary font-[500] text-sm shadow" > - Send + {t("send")} </button> {isCustomize && ( <button onClick={() => setIsCustomize(false)} className="op-btn op-btn-ghost font-[500] text-sm" > - Close + {t("close")} </button> )} </div> @@ -1823,13 +1817,13 @@ function PlaceHolderSign() { className="op-link op-link-accent text-sm" onClick={() => setIsCustomize(!isCustomize)} > - Cutomize Email + {t("cutomize-email")} </span> )} {!isSubscribe && isEnableSubscription && ( <div className="mt-2"> <Upgrade - message="Upgrade to customize Email" + message={t("upgrade-to-customize-email")} newWindow={true} /> </div> @@ -1842,7 +1836,7 @@ function PlaceHolderSign() { <> <div className="flex justify-center items-center mt-3"> <span className="h-[1px] w-[20%] bg-[#ccc]"></span> - <span className="ml-[5px] mr-[5px]">or</span> + <span className="ml-[5px] mr-[5px]">{t("or")}</span> <span className="h-[1px] w-[20%] bg-[#ccc]"></span> </div> <div className="mt-3 mb-3">{handleShareList()}</div> @@ -1854,7 +1848,7 @@ function PlaceHolderSign() { {/* this modal is used show send mail message and after send mail success message */} <ModalUi isOpen={isSend} - title={"Mails Sent"} + title={t("Mails Sent")} handleClose={() => { setIsSend(false); setSignerPos([]); @@ -1865,15 +1859,11 @@ function PlaceHolderSign() { {mailStatus === "success" ? ( <div className="text-center mb-[10px]"> <LottieWithLoader /> - <p> - You have successfully sent mails to all recipients! - </p> - {isCurrUser && ( - <p>Do you want to sign documents right now ?</p> - )} + <p>{t("placeholder-alert-4")}</p> + {isCurrUser && <p>{t("placeholder-alert-5")}</p>} </div> ) : ( - <p>Please setup mail adapter to send mail!</p> + <p>{t("placeholder-alert-6")}</p> )} {!mailStatus && ( <div className="w-full h-[1px] bg-[#9f9f9f] my-[15px]"></div> @@ -1893,7 +1883,7 @@ function PlaceHolderSign() { type="button" className="op-btn op-btn-primary mr-1" > - Yes + {t("yes")} </button> )} @@ -1906,20 +1896,20 @@ function PlaceHolderSign() { type="button" className="op-btn op-btn-ghost" > - {isCurrUser ? "No" : "Close"} + {isCurrUser ? t("no") : t("close")} </button> </div> </div> </ModalUi> <ModalUi isOpen={isShowEmail} - title={"signers alert"} + title={t("signers-alert")} handleClose={() => { setIsShowEmail(false); }} > <div className="h-[100%] p-[20px]"> - <p>Please select signer for add placeholder!</p> + <p>{t("placeholder-alert-7")}</p> <div className="w-full h-[1px] bg-[#9f9f9f] my-[15px]"></div> <button onClick={() => { @@ -1928,7 +1918,7 @@ function PlaceHolderSign() { type="button" className="op-btn op-btn-primary" > - Ok + {t("ok")} </button> </div> </ModalUi> @@ -1948,7 +1938,7 @@ function PlaceHolderSign() { /> <DropdownWidgetOption type={radioButtonWidget} - title="Radio group" + title={t("radio-group")} showDropdown={isRadio} setShowDropdown={setIsRadio} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -1959,7 +1949,7 @@ function PlaceHolderSign() { /> <DropdownWidgetOption type="checkbox" - title="Checkbox" + title={t("checkbox")} showDropdown={isCheckbox} setShowDropdown={setIsCheckbox} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -1970,7 +1960,7 @@ function PlaceHolderSign() { /> <DropdownWidgetOption type="dropdown" - title="Dropdown options" + title={t("dropdown-options")} showDropdown={showDropdown} setShowDropdown={setShowDropdown} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -2137,7 +2127,7 @@ function PlaceHolderSign() { <ModalUi isOpen={isAlreadyPlace.status} - title={"Document Alert"} + title={t("document-alert")} showClose={false} > <div className="h-[100%] p-[20px]"> @@ -2148,7 +2138,7 @@ function PlaceHolderSign() { type="button" className="op-btn op-btn-primary" > - View + {t("view")} </button> </div> </ModalUi> diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index a91188bbd..c58708e85 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -87,9 +87,9 @@ function SignYourSelf() { const [validateAlert, setValidateAlert] = useState(false); const [isLoading, setIsLoading] = useState({ isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }); - const [handleError, setHandleError] = useState(); + const [handleError, setHandleError] = useState(""); const [isDragging, setIsDragging] = useState(false); const [signTour, setSignTour] = useState(true); const { docId } = useParams(); @@ -219,12 +219,12 @@ function SignYourSelf() { //convert document url in array buffer format to use embed widgets in pdf using pdf-lib const arrayBuffer = await convertPdfArrayBuffer(url); if (arrayBuffer === "Error") { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } else { setPdfArrayBuffer(arrayBuffer); } } else { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } isCompleted = documentData[0].IsCompleted && documentData[0].IsCompleted; if (isCompleted) { @@ -236,7 +236,7 @@ function SignYourSelf() { setPdfUrl(documentData[0].SignedUrl); const alreadySign = { status: true, - mssg: "Congratulations! 🎉 This document has been successfully signed by you!" + mssg: t("document-signed-alert") }; if (showComplete) { setShowAlreadySignDoc(alreadySign); @@ -255,10 +255,10 @@ function SignYourSelf() { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); } else { - setHandleError("No Data Found!"); + setHandleError(t("no-data-avaliable")); const loadObj = { isLoad: false }; @@ -292,7 +292,7 @@ function SignYourSelf() { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); }); const contractUsersRes = await contractUsers(jsonSender.email); @@ -300,7 +300,7 @@ function SignYourSelf() { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); } else if (contractUsersRes[0] && contractUsersRes.length > 0) { setActiveMailAdapter(contractUsersRes[0]?.active_mail_adapter); @@ -344,7 +344,7 @@ function SignYourSelf() { setCheckTourStatus(true); } } else { - setHandleError("No Data Found!"); + setHandleError(t("no-data-avaliable")); } const loadObj = { isLoad: false @@ -580,7 +580,7 @@ function SignYourSelf() { setOtpLoader(true); await handleSendOTP(Parse.User.current().getEmail()); setOtpLoader(false); - alert("OTP sent on you email"); + alert(t("otp-sent-alert")); }; //`handleVerifyEmail` function is used to verify email with otp const handleVerifyEmail = async (e) => { @@ -630,7 +630,7 @@ function SignYourSelf() { setIsEmailVerified(isEmailVerified); } } catch (e) { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } } if (isEmailVerified) { @@ -668,17 +668,15 @@ function SignYourSelf() { } if (xyPostion.length === 0 || !isSignatureExist) { setIsAlert({ - header: "Fields required", + header: t("fields-required"), isShow: true, - alertMessage: - "Please ensure there's at least one signature widget added" + alertMessage: t("signature-widget-alert-1") }); return; } else if (showAlert) { setIsAlert({ isShow: true, - alertMessage: - "Please ensure all field is accurately filled and meets all requirements." + alertMessage: t("signature-widget-alert-2") }); return; } else { @@ -713,13 +711,13 @@ function SignYourSelf() { if (err && err.message.includes("is encrypted.")) { setIsAlert({ isShow: true, - alertMessage: `Currently encrypted pdf files are not supported.` + alertMessage: t("encrypted-pdf-alert") }); } else { console.log("err in signing", err); setIsAlert({ isShow: true, - alertMessage: `Something went wrong.` + alertMessage: t("something-went-wrong-mssg") }); } } @@ -729,7 +727,7 @@ function SignYourSelf() { setIsUiLoading(false); setIsAlert({ isShow: true, - alertMessage: "something went wrong, please try again later." + alertMessage: t("something-went-wrong-mssg") }); } } @@ -740,7 +738,7 @@ function SignYourSelf() { const getIsSubscribe = await checkIsSubscribed(); const tenantDetails = await getTenantDetails(jsonSender.objectId); if (tenantDetails && tenantDetails === "user does not exist!") { - alert("User does not exist"); + alert(t("user-not-exist")); } else { if ( tenantDetails?.CompletionBody && @@ -771,6 +769,7 @@ function SignYourSelf() { base64Sign = await fetchImageBase64(base64Sign); } catch (e) { console.log("error", e); + alert(t("something-went-wrong-mssg")); } } //change image width and height to 104/44 in png base64 @@ -805,6 +804,7 @@ function SignYourSelf() { }) .catch((err) => { console.log("axois err ", err); + alert(t("something-went-wrong-mssg")); }); }; @@ -1056,6 +1056,7 @@ function SignYourSelf() { }) .catch((err) => { console.log("axois err ", err); + alert(t("something-went-wrong-mssg")); }); } }; @@ -1177,7 +1178,7 @@ function SignYourSelf() { <div className="absolute h-[100vh] w-full z-[999] flex flex-col justify-center items-center bg-[#e6f2f2] bg-opacity-80"> <Loader /> <span style={{ fontSize: "13px", fontWeight: "bold" }}> - {t("document-signature.loader")} + {t("loader")} </span> </div> )} @@ -1235,7 +1236,7 @@ function SignYourSelf() { <div className=" w-full md:w-[95%] "> <ModalUi isOpen={isAlert.isShow} - title={isAlert?.header || "Alert"} + title={isAlert?.header || t("alert")} handleClose={() => { setIsAlert({ isShow: false, @@ -1251,7 +1252,7 @@ function SignYourSelf() { {/* this modal is used show this document is already sign */} <ModalUi isOpen={showAlreadySignDoc.status} - title={t("document-signature.document-signed")} + title={t("document-signed")} handleClose={() => { setShowAlreadySignDoc({ status: false }); }} @@ -1270,7 +1271,7 @@ function SignYourSelf() { </ModalUi> <DropdownWidgetOption type="checkbox" - title="Checkbox" + title={t("checkbox")} showDropdown={isCheckbox} setShowDropdown={setIsCheckbox} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -1425,7 +1426,7 @@ function SignYourSelf() { }} > <div className="p-[20px] h-full"> - <p>{t("document-signature.validate-alert-mssg")}</p> + <p>{t("validate-alert-mssg")}</p> <div className="h-[1px] w-full my-[15px] bg-[#9f9f9f]"></div> <button diff --git a/apps/OpenSign/src/pages/TeamList.js b/apps/OpenSign/src/pages/TeamList.js index 8fc7e4ae5..e5fd5509c 100644 --- a/apps/OpenSign/src/pages/TeamList.js +++ b/apps/OpenSign/src/pages/TeamList.js @@ -11,6 +11,7 @@ import { isEnableSubscription } from "../constant/const"; import { checkIsSubscribedTeam } from "../constant/Utils"; import SubscribeCard from "../primitives/SubscribeCard"; import Title from "../components/Title"; +import { useTranslation } from "react-i18next"; const heading = ["Sr.No", "Name", "Parent Team", "Active"]; const actions = [ @@ -25,6 +26,7 @@ const actions = [ ]; const TeamList = () => { + const { t } = useTranslation(); const recordperPage = 10; const [teamList, setTeamList] = useState([]); const [isLoader, setIsLoader] = useState(false); @@ -120,7 +122,7 @@ const TeamList = () => { } } catch (err) { console.log("Err in fetch teamlist", err); - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); } finally { setTimeout(() => { setIsAlert({ type: "success", msg: "" }); @@ -169,10 +171,10 @@ const TeamList = () => { // console.log("teamRes ", teamRes); setIsAlert({ type: !IsActive === false ? "danger" : "success", - msg: !IsActive === false ? "Team disabled." : "Team enabled." + msg: !IsActive === false ? t("team-disabled") : t("team-enabled") }); } catch (err) { - setIsAlert({ type: "danger", msg: "something went wrong." }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); console.log("err in disable team", err); } finally { setIsActLoader({}); @@ -200,10 +202,10 @@ const TeamList = () => { const data = { Name: team.Name, TeamId: team.objectId }; await Parse.Cloud.run("updateteam", data); // console.log("updateTeamRes ", updateTeamRes); - setIsAlert({ type: "success", msg: "Team Update successfully." }); + setIsAlert({ type: "success", msg: t("something-went-wrong-mssg") }); } catch (Err) { console.log("Err in update team name"), Err; - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); } finally { setIsActLoader({}); setTimeout(() => setIsAlert({ type: "success", msg: "" }), 1500); @@ -233,9 +235,9 @@ const TeamList = () => { )} <div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]"> <div className="font-light"> - Teams{" "} + {t("report-name.Teams")} <span className="text-xs md:text-[13px] font-normal"> - <Tooltip message={"Teams"} /> + <Tooltip message={t("report-heading.Team")} /> </span> </div> <div @@ -251,7 +253,9 @@ const TeamList = () => { <tr className="border-y-[1px]"> {heading?.map((item, index) => ( <React.Fragment key={index}> - <th className="px-4 py-2">{item}</th> + <th className="px-4 py-2"> + {t(`report-heading.${item}`)} + </th> </React.Fragment> ))} </tr> @@ -286,16 +290,16 @@ const TeamList = () => { {isActiveModal[item.objectId] && ( <ModalUi isOpen - title={"Team status"} + title={t("Team status")} handleClose={handleClose} > <div className="m-[20px]"> <div className="text-lg font-normal text-black"> - Are you sure you want to{" "} + {t("are-you-sure")}{" "} {item?.IsActive - ? "disable" - : "enable"}{" "} - this team? + ? t("disable") + : t("enable")}{" "} + {t("this-team")} </div> <hr className="bg-[#ccc] mt-4 " /> <div className="flex items-center mt-3 gap-2 text-white"> @@ -305,13 +309,13 @@ const TeamList = () => { } className="op-btn op-btn-primary" > - Yes + {t("yes")} </button> <button onClick={handleClose} className="op-btn op-btn-secondary" > - No + {t("no")} </button> </div> </div> @@ -341,7 +345,7 @@ const TeamList = () => { {isEditModal[item.objectId] && ( <ModalUi isOpen - title={"Edit Team"} + title={t("edit-team")} handleClose={handleClose} > <form @@ -351,7 +355,7 @@ const TeamList = () => { } > <label className="text-xs font-semibold text-base-content ml-1"> - Name of Team{" "} + {t("name-of-team")}{" "} <span className="text-[red] text-[13px]"> * </span> @@ -368,7 +372,7 @@ const TeamList = () => { type="submit" className="op-btn op-btn-primary mt-3" > - Save + {t("save")} </button> </form> </ModalUi> @@ -389,7 +393,7 @@ const TeamList = () => { onClick={() => paginateBack()} className="op-join-item op-btn op-btn-sm" > - Prev + {t("prev")} </button> )} {pageNumbers.map((x, i) => ( @@ -409,7 +413,7 @@ const TeamList = () => { onClick={() => paginateFront()} className="op-join-item op-btn op-btn-sm" > - Next + {t("next")} </button> )} </div> @@ -426,11 +430,13 @@ const TeamList = () => { alt="img" /> </div> - <div className="text-sm font-semibold">No Data Available</div> + <div className="text-sm font-semibold"> + {t("no-data-avaliable")} + </div> </div> )} <ModalUi - title={"Add Team"} + title={t("add-team")} isOpen={isModal} handleClose={handleFormModal} > @@ -447,7 +453,9 @@ const TeamList = () => { <h1 className="text-[60px] lg:text-[120px] font-semibold"> 404 </h1> - <p className="text-[30px] lg:text-[50px]">Page Not Found</p> + <p className="text-[30px] lg:text-[50px]"> + {t("page-not-found")} + </p> </div> </div> )} diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js index e96cab49d..85500123e 100644 --- a/apps/OpenSign/src/pages/TemplatePlaceholder.js +++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js @@ -40,7 +40,9 @@ import DropdownWidgetOption from "../components/pdf/DropdownWidgetOption"; import Parse from "parse"; import { useSelector } from "react-redux"; import PdfZoom from "../components/pdf/PdfZoom"; +import { useTranslation } from "react-i18next"; const TemplatePlaceholder = () => { + const { t } = useTranslation(); const navigate = useNavigate(); const isHeader = useSelector((state) => state.showHeader); const { templateId } = useParams(); @@ -61,7 +63,7 @@ const TemplatePlaceholder = () => { const [isSubscribe, setIsSubscribe] = useState(false); const [isLoading, setIsLoading] = useState({ isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }); const [handleError, setHandleError] = useState(); const [currentEmail, setCurrentEmail] = useState(); @@ -300,10 +302,10 @@ const TemplatePlaceholder = () => { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); } else { - setHandleError("No Data Found!"); + setHandleError(t("no-data-avaliable")); const loadObj = { isLoad: false }; @@ -312,9 +314,9 @@ const TemplatePlaceholder = () => { } catch (err) { console.log("err ", err); if (err?.response?.data?.code === 101) { - setHandleError("Error: Template not found!"); + setHandleError(t("no-data-avaliable")); } else { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } } const res = await contractUsers(jsonSender.email); @@ -339,10 +341,10 @@ const TemplatePlaceholder = () => { const loadObj = { isLoad: false }; - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading(loadObj); } else if (res.length === 0) { - setHandleError("No Data Found!"); + setHandleError(t("no-data-avaliable")); const loadObj = { isLoad: false }; @@ -730,7 +732,7 @@ const TemplatePlaceholder = () => { if (signersdata?.length) { const loadObj = { isLoad: true, - message: "This might take some time" + message: t("loading-mssg") }; setIsLoading(loadObj); setIsSendAlert(false); @@ -905,7 +907,7 @@ const TemplatePlaceholder = () => { }); setIsCreateDoc(false); } else { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsCreateDoc(false); } }; @@ -1321,35 +1323,30 @@ const TemplatePlaceholder = () => { {/* this modal is used show alert set placeholder for all signers before send mail */} <ModalUi isOpen={isSendAlert} - title={"Fields required"} + title={t("fields-required")} handleClose={() => setIsSendAlert(false)} > <div className="h-full p-[20px]"> - <p> - Please add at least one signature field for all roles. - </p> + <p>{t("template-signature-field")}</p> </div> </ModalUi> <ModalUi isOpen={!IsReceipent} - title={"Roles"} + title={t("roles")} handleClose={() => setIsReceipent(true)} > <div className="h-full p-[20px] text-center font-medium"> - <p>Please add roles first</p> + <p>{t("template-role-alert")}</p> </div> </ModalUi> {/* this modal is used show send mail message and after send mail success message */} <ModalUi isOpen={isCreateDocModal} - title={"Create Document"} + title={t("create-document")} handleClose={() => setIsCreateDocModal(false)} > <div className="h-full p-[20px]"> - <p> - Do you want to create a document using the template you - just created ? - </p> + <p>{t("template-created-alert")}</p> <div className="h-[1px] w-full my-[15px] bg-[#9f9f9f]"></div> {currentEmail.length > 0 && ( <> @@ -1360,7 +1357,7 @@ const TemplatePlaceholder = () => { type="button" className="op-btn op-btn-primary" > - Yes + {t("yes")} </button> <button onClick={() => { @@ -1370,7 +1367,7 @@ const TemplatePlaceholder = () => { type="button" className="op-btn op-btn-secondary ml-2" > - No + {t("no")} </button> </> )} @@ -1379,13 +1376,13 @@ const TemplatePlaceholder = () => { {isCreateDoc && <LoaderWithMsg isLoading={isLoading} />} <ModalUi isOpen={isShowEmail} - title={"signers alert"} + title={t("signers-alert")} handleClose={() => { setIsShowEmail(false); }} > <div className="h-full p-[20px]"> - <p>Please select signer for add placeholder!</p> + <p>{t("template-creation-alert-1")}</p> <div className="h-[1px] w-full my-[15px] bg-[#9f9f9f]"></div> <button onClick={() => { @@ -1394,13 +1391,13 @@ const TemplatePlaceholder = () => { type="button" className="op-btn op-btn-primary" > - Ok + {t("ok")} </button> </div> </ModalUi> <DropdownWidgetOption type={radioButtonWidget} - title="Radio group" + title={t("radio-group")} showDropdown={isRadio} setShowDropdown={setIsRadio} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -1411,7 +1408,7 @@ const TemplatePlaceholder = () => { /> <DropdownWidgetOption type="checkbox" - title="Checkbox" + title={t("checkbox")} showDropdown={isCheckbox} setShowDropdown={setIsCheckbox} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -1422,7 +1419,7 @@ const TemplatePlaceholder = () => { /> <DropdownWidgetOption type="dropdown" - title="Dropdown options" + title={t("dropdown-options")} showDropdown={showDropdown} setShowDropdown={setShowDropdown} handleSaveWidgetsOptions={handleSaveWidgetsOptions} @@ -1444,7 +1441,7 @@ const TemplatePlaceholder = () => { /> {/* pdf header which contain funish back button */} <Header - completeBtnTitle={"Next"} + completeBtnTitle={t("next")} isPlaceholder={true} pageNumber={pageNumber} allPages={allPages} @@ -1541,7 +1538,7 @@ const TemplatePlaceholder = () => { handleDeleteUser={handleDeleteUser} handleRoleChange={handleRoleChange} handleOnBlur={handleOnBlur} - title={"Roles"} + title={t("roles")} initial={true} isTemplateFlow={true} sendInOrder={pdfDetails[0].SendinOrder} @@ -1570,7 +1567,7 @@ const TemplatePlaceholder = () => { handleDeleteUser={handleDeleteUser} handleRoleChange={handleRoleChange} handleOnBlur={handleOnBlur} - title={"Roles"} + title={t("roles")} sendInOrder={pdfDetails[0]?.SendinOrder} setSignersData={setSignersData} blockColor={blockColor} @@ -1590,7 +1587,7 @@ const TemplatePlaceholder = () => { isDragStamp={isDragStamp} isSignYourself={false} addPositionOfSignature={addPositionOfSignature} - title={"Roles"} + title={t("roles")} initial={true} isTemplateFlow={true} /> @@ -1601,7 +1598,6 @@ const TemplatePlaceholder = () => { </div> </div> )} - <div data-tut="reactourAddbtn--observe"> <AddRoleModal isModalRole={isModalRole} @@ -1622,7 +1618,7 @@ const TemplatePlaceholder = () => { /> </div> <ModalUi - title={"Edit Template"} + title={t("edit-template")} isOpen={isEditTemplate} handleClose={handleEditTemplateModal} > diff --git a/apps/OpenSign/src/pages/UserList.js b/apps/OpenSign/src/pages/UserList.js index c0351acc3..63696a66b 100644 --- a/apps/OpenSign/src/pages/UserList.js +++ b/apps/OpenSign/src/pages/UserList.js @@ -11,9 +11,11 @@ import SubscribeCard from "../primitives/SubscribeCard"; import { isEnableSubscription } from "../constant/const"; import { checkIsSubscribedTeam } from "../constant/Utils"; import Title from "../components/Title"; +import { useTranslation } from "react-i18next"; const heading = ["Sr.No", "Name", "Email", "Phone", "Role", "Team", "Active"]; // const actions = []; const UserList = () => { + const { t } = useTranslation(); const [userList, setUserList] = useState([]); const [isLoader, setIsLoader] = useState(false); const [isModal, setIsModal] = useState(false); @@ -110,7 +112,7 @@ const UserList = () => { setUserList(_userRes); } catch (err) { console.log("Err in fetch userlist", err); - setIsAlert({ type: "danger", msg: "Something went wrong." }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); } finally { setTimeout(() => { setIsAlert({ type: "success", msg: "" }); @@ -166,10 +168,11 @@ const UserList = () => { await extUser.save(); setIsAlert({ type: !IsDisabled === true ? "danger" : "success", - msg: !IsDisabled === true ? "User deactivated." : "User activated." + msg: + !IsDisabled === true ? t("user-deactivated") : t("user-activated") }); } catch (err) { - setIsAlert({ type: "danger", msg: "something went wrong." }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); console.log("err in disable team", err); } finally { setIsActLoader({}); @@ -204,9 +207,9 @@ const UserList = () => { )} <div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]"> <div className="font-light"> - Users{" "} + {t("report-name.Users")} <span className="text-xs md:text-[13px] font-normal"> - <Tooltip message={"users from Teams"} /> + <Tooltip message={t("users-from-teams")} /> </span> </div> <div @@ -222,7 +225,9 @@ const UserList = () => { <tr className="border-y-[1px]"> {heading?.map((item, index) => ( <React.Fragment key={index}> - <th className="px-4 py-2">{item}</th> + <th className="px-4 py-2"> + {t(`report-heading.${item}`)} + </th> </React.Fragment> ))} </tr> @@ -261,16 +266,16 @@ const UserList = () => { {isActiveModal[item.objectId] && ( <ModalUi isOpen - title={"User status"} + title={t("user-status")} handleClose={handleClose} > <div className="m-[20px]"> <div className="text-lg font-normal text-black"> - Are you sure you want to{" "} + {t("are-you-sure")}{" "} {item?.IsDisabled - ? "activate" - : "deactivate"}{" "} - this user? + ? t("activate") + : t("deactivate")}{" "} + {t("this-user")}? </div> <hr className="bg-[#ccc] mt-4 " /> <div className="flex items-center mt-3 gap-2 text-white"> @@ -280,13 +285,13 @@ const UserList = () => { } className="op-btn op-btn-primary" > - Yes + {t("yes")} </button> <button onClick={handleClose} className="op-btn op-btn-secondary" > - No + {t("no")} </button> </div> </div> @@ -311,12 +316,12 @@ const UserList = () => { {isDeleteModal[item.objectId] && ( <ModalUi isOpen - title={"Delete User"} + title={t("delete-user")} handleClose={handleClose} > <div className="m-[20px]"> <div className="text-lg font-normal text-black"> - Are you sure you want to delete this user? + {t( "are-you-sure")} {t("delete")} {t("this-user")}? </div> <hr className="bg-[#ccc] mt-4 " /> <div className="flex items-center mt-3 gap-2 text-white"> @@ -324,13 +329,13 @@ const UserList = () => { onClick={() => handleDelete(item)} className="op-btn op-btn-primary" > - Yes + {t("yes")} </button> <button onClick={handleClose} className="op-btn op-btn-secondary" > - No + {('no)} </button> </div> </div> @@ -350,7 +355,7 @@ const UserList = () => { onClick={() => paginateBack()} className="op-join-item op-btn op-btn-sm" > - Prev + {t("prev")} </button> )} {pageNumbers.map((x, i) => ( @@ -370,7 +375,7 @@ const UserList = () => { onClick={() => paginateFront()} className="op-join-item op-btn op-btn-sm" > - Next + {t("next")} </button> )} </div> @@ -387,11 +392,13 @@ const UserList = () => { alt="img" /> </div> - <div className="text-sm font-semibold">No Data Available</div> + <div className="text-sm font-semibold"> + {t("no-data-avaliable")} + </div> </div> )} <ModalUi - title={"Add User"} + title={t("add-user")} isOpen={isModal} handleClose={handleFormModal} > @@ -408,7 +415,9 @@ const UserList = () => { <h1 className="text-[60px] lg:text-[120px] font-semibold"> 404 </h1> - <p className="text-[30px] lg:text-[50px]">Page Not Found</p> + <p className="text-[30px] lg:text-[50px]"> + {t("page-not-found")} + </p> </div> </div> )} diff --git a/apps/OpenSign/src/pages/Webhook.js b/apps/OpenSign/src/pages/Webhook.js index 3a9cf49e0..b9dc45c3f 100644 --- a/apps/OpenSign/src/pages/Webhook.js +++ b/apps/OpenSign/src/pages/Webhook.js @@ -71,10 +71,10 @@ function Webhook() { setIsAlert({ type: "success", msg: t("webhook-added") }); } else { console.error("Error while generating webhook"); - setIsAlert({ type: "danger", msg: t("wrong-mssg") }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); } } catch (error) { - setIsAlert({ type: "danger", msg: t("wrong-mssg") }); + setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") }); console.log("err while generating webhook", error); } finally { setIsLoader(false); diff --git a/apps/OpenSign/src/primitives/AddContact.js b/apps/OpenSign/src/primitives/AddContact.js index c645b0363..5e5c661e5 100644 --- a/apps/OpenSign/src/primitives/AddContact.js +++ b/apps/OpenSign/src/primitives/AddContact.js @@ -1,7 +1,9 @@ import React, { useState, useEffect } from "react"; import Parse from "parse"; import Loader from "./Loader"; +import { useTranslation } from "react-i18next"; const AddContact = (props) => { + const { t } = useTranslation(); const [name, setName] = useState(""); const [phone, setPhone] = useState(""); const [email, setEmail] = useState(""); @@ -148,7 +150,7 @@ const AddContact = (props) => { } catch (err) { // console.log("err", err); setIsLoader(false); - alert("something went wrong!"); + alert(t("something-went-wrong-mssg")); } }; @@ -175,7 +177,7 @@ const AddContact = (props) => { </div> )} <div className="w-full mx-auto p-[8px]"> - <div className="text-[14px] font-[700]">Add Contact</div> + <div className="text-[14px] font-[700]">{t("add-contact")}</div> {isUserExist && ( <div className="mb-[0.75rem] flex items-center mt-1"> <input @@ -189,14 +191,14 @@ const AddContact = (props) => { htmlFor="addYourself" className="ml-[0.5rem] text-base-content mb-0" > - Add Yourself + {t("add-yourself")} </label> </div> )} <form className="text-base-content" onSubmit={handleSubmit}> <div className="mb-[0.75rem]"> <label htmlFor="name" className="text-[13px]"> - Name + {t("name")} <span className="text-[13px] text-[red]"> *</span> </label> <input @@ -211,7 +213,7 @@ const AddContact = (props) => { </div> <div className="mb-[0.75rem]"> <label htmlFor="email" className="text-[13px]"> - Email + {t("email")} <span className="text-[13px] text-[red]"> *</span> </label> <input @@ -226,7 +228,7 @@ const AddContact = (props) => { </div> <div className="mb-[0.75rem]"> <label htmlFor="phone" className="text-[13px]"> - Phone + {t("phone")} </label> <input type="text" @@ -240,14 +242,14 @@ const AddContact = (props) => { <div className="mt-6 flex justify-start gap-2"> <button type="submit" className="op-btn op-btn-primary"> - Submit + {t("submit")} </button> <button type="button" onClick={() => handleReset()} className="op-btn op-btn-secondary" > - Reset + {t("reset")} </button> </div> </form> diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index dde156ee3..98f49e03d 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -304,7 +304,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); setActLoader({}); @@ -316,7 +316,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); setActLoader({}); @@ -326,7 +326,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); setActLoader({}); @@ -416,7 +416,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "success", - message: "Record deleted successfully!" + message: t("record-delete-alert") }); setTimeout(() => setIsAlert(false), 1500); const upldatedList = props.List.filter( @@ -429,7 +429,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); setActLoader({}); @@ -505,7 +505,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "success", - message: "Record revoked successfully!" + message: t("record-revoke-alert") }); setTimeout(() => setIsAlert(false), 1500); const upldatedList = props.List.filter( @@ -520,7 +520,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); setActLoader({}); @@ -607,7 +607,7 @@ const ReportTable = (props) => { setActLoader({}); } catch (err) { console.log("err in getsignedurl", err); - alert("something went wrong, please try again later."); + alert(t("something-went-wrong-mssg")); setActLoader({}); } } @@ -740,12 +740,12 @@ const ReportTable = (props) => { const res = await axios.post(url, params, { headers: headers }); if (res?.data?.result?.status === "success") { setIsAlert(true); - setAlertMsg({ type: "success", message: "Mail sent successfully." }); + setAlertMsg({ type: "success", message: t("mail-sent-alert") }); } else { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, please try again later!" + message: t("something-went-wrong-mssg") }); } } catch (err) { @@ -753,7 +753,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, please try again later!" + message: t("something-went-wrong-mssg") }); } finally { setTimeout(() => setIsAlert(false), 1500); @@ -794,20 +794,20 @@ const ReportTable = (props) => { if (count > 1) { setAlertMsg({ type: "success", - message: count + " Document sent successfully!" + message: count + t("document-sent-alert") }); setTimeout(() => setIsAlert(false), 1500); } else { setAlertMsg({ type: "success", - message: count + " Document sent successfully!" + message: count + t("document-sent-alert") }); setTimeout(() => setIsAlert(false), 1500); } } else { setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); } @@ -844,7 +844,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); } @@ -868,7 +868,7 @@ const ReportTable = (props) => { if (props.isPublic[item.objectId]) { setAlertMsg({ type: "success", - message: "You have successfully made the template public." + message: t("template-public-alert-1") }); setIsCelebration(true); setTimeout(() => { @@ -880,7 +880,7 @@ const ReportTable = (props) => { } else { setAlertMsg({ type: "success", - message: "You have successfully made the template private." + message: t("template-public-alert-2") }); setSelectedPublicRole(""); } @@ -897,7 +897,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later!" + message: t("something-went-wrong-mssg") }); setTimeout(() => setIsAlert(false), 1500); props.setIsPublic((prevStates) => ({ @@ -909,7 +909,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: "You need to select a role for the public signers." + message: t("template-public-alert-3") }); setTimeout(() => setIsAlert(false), 1500); } @@ -963,8 +963,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: - " Please ensure there's at least one signature widget added for all signers." + message: t("template-public-alert-4") }); setTimeout(() => setIsAlert(false), 5000); } @@ -972,8 +971,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: - "Since this template has send-in-order enabled, the public role must be positioned at the top." + message: t("template-public-alert-5") }); setTimeout(() => setIsAlert(false), 5000); } @@ -981,8 +979,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: - "Please attach signers to all roles except for the public role user." + message: t("template-public-alert-6") }); setTimeout(() => setIsAlert(false), 5000); } @@ -990,8 +987,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "danger", - message: - "Please assign at least one public role to make this template public." + message: t("template-public-alert-7") }); setTimeout(() => setIsAlert(false), 5000); } @@ -1004,7 +1000,7 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "success", - message: "Copied." + message: t("copied") }); setTimeout(() => setIsAlert(false), 1500); }; @@ -1033,14 +1029,14 @@ const ReportTable = (props) => { setIsAlert(true); setAlertMsg({ type: "success", - message: "Template Shared successfully." + message: t("template-share-alert") }); } } catch (err) { setIsAlert(true); setAlertMsg({ type: "danger", - message: "Something went wrong, Please try again later." + message: t("something-went-wrong-mssg") }); } finally { setActLoader({}); @@ -1110,11 +1106,11 @@ const ReportTable = (props) => { </React.Fragment> ))} {props.ReportName === "Templates" && isEnableSubscription && ( - <th className="px-4 py-2">Public</th> + <th className="px-4 py-2">{t("public")}</th> )} {props.actions?.length > 0 && ( <th className="px-4 py-2 text-transparent pointer-events-none"> - Action + {t("action")} </th> )} </tr> @@ -1205,16 +1201,16 @@ const ReportTable = (props) => { )} {props.heading.includes("Folder") && ( <td className="px-4 py-2"> - {item?.Folder?.Name || "OpenSign™ Drive"} + {item?.Folder?.Name || t("OpenSign™ Drive")} </td> )} <td className="px-4 py-2"> <button onClick={() => handleDownload(item)} className="op-link op-link-primary" - title={"Download"} + title={t("download")} > - {item?.URL ? "Download" : "-"} + {item?.URL ? t("download") : "-"} </button> </td> <td className="px-4 py-2"> @@ -1226,7 +1222,7 @@ const ReportTable = (props) => { onClick={() => handleViewSigners(item)} className="op-link op-link-primary" > - View + {t("view")} </button> ) : ( "-" @@ -1260,8 +1256,8 @@ const ReportTable = (props) => { isOpen title={ props.isPublic[item.objectId] - ? "Make template public" - : "Make template private" + ? t("make-template-public") + : t("make-template-private") } handleClose={() => { setIsMakePublicModal({}); @@ -1277,13 +1273,13 @@ const ReportTable = (props) => { <div className="font-normal text-black"> <p className="text-lg"> {props.isPublic[item.objectId] - ? `Are you sure you want to make this template public?` - : `Are you sure you want to make this template private? This will remove it from your public profile.`} + ? t("make-template-public-alert") + : t("make-template-private-alert")} </p> {props.isPublic[item.objectId] && ( <div className="flex mt-2 gap-2 md:items-center"> <p className="text-[15px]"> - Public role :{" "} + {t("public-role")} :{" "} </p> <input @@ -1301,13 +1297,13 @@ const ReportTable = (props) => { } className="op-btn op-btn-primary" > - Submit + {t("submit")} </button> <button onClick={() => handleClose(item)} className="op-btn op-btn-secondary" > - Cancel + {t("cancel")} </button> </div> </div> @@ -1316,7 +1312,7 @@ const ReportTable = (props) => { {isPublicProfile[item.objectId] && ( <ModalUi isOpen - title={"Public URL"} + title={t("public-url")} handleClose={() => { setIsPublicProfile({}); }} @@ -1324,15 +1320,10 @@ const ReportTable = (props) => { <div className="m-[20px]"> {publicUserName ? ( <div className="font-normal text-black"> - <p> - Here’s your public URL: Copy it or - share it with the signer, and you will - be able to see all your publicly set - templates. - </p> + <p>{t("public-url-copy-mssg")}</p> <div className=" flex items-center gap-3 mt-2 p-[2px] "> <span className="font-bold"> - Public URL : + {t("public-url")}: </span> <span onClick={() => copytoProfileLink()} @@ -1342,16 +1333,12 @@ const ReportTable = (props) => { </div> ) : ( <div className="font-normal text-black"> - <p> - Please add your public URL, and you - will be able to make a public - template. - </p> + <p>{t("add-public-url-alert")}</p> <button className="mt-3 op-btn op-btn-primary" onClick={() => navigate("/profile")} > - Add + {t("add")} </button> </div> )} @@ -1376,7 +1363,7 @@ const ReportTable = (props) => { onClick={() => handleActionBtn(act, item) } - title={act.hoverLabel} + title={t(`btnLabel.${act.btnLabel}`)} className={ act.action !== "option" ? `${ @@ -1390,7 +1377,7 @@ const ReportTable = (props) => { <i className={act.btnIcon}></i> {act.btnLabel && ( <span className="uppercase font-medium"> - {act.btnLabel} + {t(`btnLabel.${act.btnLabel}`)} </span> )} {isOption[item.objectId] && @@ -1405,7 +1392,9 @@ const ReportTable = (props) => { item ) } - title={subact.hoverLabel} + title={t( + `btnLabel.${subact.btnLabel}` + )} > <span> <i @@ -1413,7 +1402,9 @@ const ReportTable = (props) => { ></i> {subact.btnLabel && ( <span className="text-[13px] capitalize font-medium"> - {subact.btnLabel} + {t( + `btnLabel.${subact.btnLabel}` + )} </span> )} </span> @@ -1430,7 +1421,7 @@ const ReportTable = (props) => { data-tut={act?.selector} key={index} onClick={() => handleActionBtn(act, item)} - title={act.hoverLabel} + title={t(`btnLabel.${act.hoverLabel}`)} className={ act.action !== "option" ? `${ @@ -1442,7 +1433,7 @@ const ReportTable = (props) => { <i className={act.btnIcon}></i> {act.btnLabel && ( <span className="uppercase font-medium"> - {act.btnLabel} + {t(`btnLabel.${act.btnLabel}`)} </span> )} {isOption[item.objectId] && @@ -1454,7 +1445,9 @@ const ReportTable = (props) => { onClick={() => handleActionBtn(subact, item) } - title={subact.hoverLabel} + title={t( + `btnLabel.${subact.hoverLabel}` + )} > <span> <i @@ -1462,7 +1455,9 @@ const ReportTable = (props) => { ></i> {subact.btnLabel && ( <span className="text-[13px] capitalize font-medium"> - {subact.btnLabel} + {t( + `btnLabel.${subact.btnLabel}` + )} </span> )} </span> @@ -1488,17 +1483,13 @@ const ReportTable = (props) => { ✕ </div> <div className="text-base-content text-base text-center"> - You cannot share a template if any - roles already have contacts assigned. - Please remove all contact assignments - from the roles before sharing the - template. + {t("share-with-alert")} </div> </div> ) : ( <> <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]"> - Share with + {t("share-with")} </h3> <div className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40" @@ -1522,7 +1513,7 @@ const ReportTable = (props) => { closeMenuOnSelect required={true} noOptionsMessage={() => - "Team not found" + t("team-not-found") } unstyled classNames={{ @@ -1544,7 +1535,7 @@ const ReportTable = (props) => { }} /> <button className="op-btn op-btn-primary ml-[10px] my-3"> - Submit + {t("submit")} </button> </form> </> @@ -1568,7 +1559,7 @@ const ReportTable = (props) => { {isSubscribe && !isEnableSubscription && ( <> <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]"> - Share with + {t("share-with")} </h3> <div className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40" @@ -1585,7 +1576,7 @@ const ReportTable = (props) => { onClick={(e) => handleShareWith(e, item)} className="op-btn op-btn-primary ml-[10px] my-3" > - Submit + {t("submit")} </button> </> )} @@ -1598,7 +1589,7 @@ const ReportTable = (props) => { showHeader={ props.ReportName === "Templates" && true } - title={"Signers"} + title={t("signers")} reduceWidth={"md:max-w-[450px]"} handleClose={() => setIsViewShare({})} > @@ -1615,13 +1606,13 @@ const ReportTable = (props) => { <tr> {props.ReportName === "Templates" && ( <th className="p-2 pl-3 w-[30%]"> - Roles + {t("roles")} </th> )} <th className="pl-3 py-2"> {props.ReportName === "Templates" - ? "Email" - : "Signers"} + ? t("email") + : t("signers")} </th> </tr> </thead> @@ -1647,12 +1638,12 @@ const ReportTable = (props) => { {isDeleteModal[item.objectId] && ( <ModalUi isOpen - title={"Delete Document"} + title={t("delete-document")} handleClose={handleClose} > <div className="m-[20px]"> <div className="text-lg font-normal text-black"> - Are you sure you want to delete this document? + {t("delete-document-alert")} </div> <hr className="bg-[#ccc] mt-4" /> <div className="flex items-center mt-3 gap-2 text-white"> @@ -1660,13 +1651,13 @@ const ReportTable = (props) => { onClick={() => handleDelete(item)} className="op-btn op-btn-primary" > - Yes + {t("yes")} </button> <button onClick={handleClose} className="op-btn op-btn-secondary" > - No + {t("no")} </button> </div> </div> @@ -1675,7 +1666,7 @@ const ReportTable = (props) => { {isBulkSend[item.objectId] && ( <ModalUi isOpen - title={"Quick send"} + title={t("quick-send")} handleClose={() => setIsBulkSend({})} > {isLoader[item.objectId] ? ( @@ -1694,7 +1685,7 @@ const ReportTable = (props) => { {isShare[item.objectId] && ( <ModalUi isOpen - title={"Copy link"} + title={t("copy-link")} handleClose={() => { setIsShare({}); setActLoader({}); @@ -1719,7 +1710,7 @@ const ReportTable = (props) => { > <button className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm "> <i className="fa-light fa-share-from-square"></i>{" "} - Share + {t("btnLabel.Share")} </button> </RWebShare> <button @@ -1728,8 +1719,8 @@ const ReportTable = (props) => { > <i className="fa-light fa-link"></i>{" "} {copied[share.email] - ? "Copied" - : "Copy"} + ? t("copied") + : t("copy")} </button> </div> </div> @@ -1740,12 +1731,12 @@ const ReportTable = (props) => { {isRevoke[item.objectId] && ( <ModalUi isOpen - title={"Revoke document"} + title={t("revoke-document")} handleClose={handleClose} > <div className="m-[20px]"> <div className="text-sm md:text-lg font-normal text-black"> - Are you sure you want to revoke this document? + {t("revoke-document-alert")} </div> <div className="mt-2"> <textarea @@ -1761,13 +1752,13 @@ const ReportTable = (props) => { onClick={() => handleRevoke(item)} className="op-btn op-btn-primary px-6" > - Yes + {t("yes")} </button> <button onClick={handleClose} className="op-btn op-btn-secondary px-6" > - No + {t("no")} </button> </div> </div> @@ -1776,7 +1767,7 @@ const ReportTable = (props) => { {isResendMail[item.objectId] && ( <ModalUi isOpen - title={"Resend Mail"} + title={t("resend-mail")} handleClose={() => { setIsResendMail({}); setIsNextStep({}); @@ -1802,9 +1793,7 @@ const ReportTable = (props) => { <div className="absolute right-5 text-xs z-40"> <Tooltip id={`${user.Id}_help`} - message={ - "You can use following variables which will get replaced with their actual values:- {{document_title}}, {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}." - } + message={t("resend-mail-help")} /> </div> <div> @@ -1812,7 +1801,7 @@ const ReportTable = (props) => { className="text-xs ml-1" htmlFor="mailsubject" > - Subject{" "} + {t("subject")}{" "} </label> <input id="mailsubject" @@ -1832,7 +1821,7 @@ const ReportTable = (props) => { className="text-xs ml-1" htmlFor="mailbody" > - Body{" "} + {t("body")}{" "} </label> <EditorToolbar containerId="toolbar1" /> <ReactQuill @@ -1851,7 +1840,7 @@ const ReportTable = (props) => { type="submit" className="op-btn op-btn-primary" > - Resend + {t("resend")} </button> </form> </div> @@ -1889,7 +1878,7 @@ const ReportTable = (props) => { onClick={() => paginateBack()} className="op-join-item op-btn op-btn-sm" > - Prev + {t("prev")} </button> )} {pageNumbers.map((x, i) => ( @@ -1909,7 +1898,7 @@ const ReportTable = (props) => { onClick={() => paginateFront()} className="op-join-item op-btn op-btn-sm" > - Next + {t("next")} </button> )} </div> @@ -1926,11 +1915,13 @@ const ReportTable = (props) => { alt="img" /> </div> - <div className="text-sm font-semibold">No Data Available</div> + <div className="text-sm font-semibold"> + {t("no-data-avaliable")} + </div> </div> )} <ModalUi - title={"Add Contact"} + title={t("add-contact")} isOpen={isContactform} handleClose={handleContactFormModal} > diff --git a/apps/OpenSign/src/primitives/LinkUserModal.js b/apps/OpenSign/src/primitives/LinkUserModal.js index 552582697..ed3bef0db 100644 --- a/apps/OpenSign/src/primitives/LinkUserModal.js +++ b/apps/OpenSign/src/primitives/LinkUserModal.js @@ -2,11 +2,13 @@ import React from "react"; import SelectSigners from "../components/shared/fields/SelectSigners"; import AddContact from "./AddContact"; import ModalUi from "./ModalUi"; +import { useTranslation } from "react-i18next"; const LinkUserModal = (props) => { + const { t } = useTranslation(); return ( <ModalUi - title={"Add/Choose Signer"} + title={t("add/choose-signer")} isOpen={ props?.isAddSigner || (props?.isAddUser && props?.isAddUser[props?.uniqueId]) @@ -18,7 +20,9 @@ const LinkUserModal = (props) => { closePopup={props.closePopup} signersData={props?.signersData} /> - <div className="op-divider text-base-content mx-[25%] my-1">or</div> + <div className="op-divider text-base-content mx-[25%] my-1"> + {t("or")} + </div> <AddContact details={props.handleAddUser} closePopup={props.closePopup} /> </ModalUi> ); From d546d5d0a7364c91194930890615342f9f254cd6 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Thu, 1 Aug 2024 20:57:22 +0530 Subject: [PATCH 05/28] feat: apply multisupport language for all type alert, buttons and tour-messages --- .../public/locales/en/translation.json | 140 +++++++++++++++++- .../public/locales/fr/translation.json | 135 ++++++++++++++++- apps/OpenSign/src/components/AddUser.js | 9 +- apps/OpenSign/src/components/LoginFacebook.js | 18 ++- apps/OpenSign/src/components/LoginGoogle.js | 19 +-- .../src/components/opensigndrive/DriveBody.js | 10 +- .../src/components/pdf/DefaultSignature.js | 14 +- apps/OpenSign/src/components/pdf/PdfHeader.js | 14 +- .../components/shared/fields/CreateFolder.js | 6 +- apps/OpenSign/src/layout/HomeLayout.js | 8 +- apps/OpenSign/src/pages/AddAdmin.js | 59 ++++---- apps/OpenSign/src/pages/ChangePassword.js | 22 +-- apps/OpenSign/src/pages/Form.js | 30 ++-- apps/OpenSign/src/pages/GenerateToken.js | 13 +- apps/OpenSign/src/pages/GuestLogin.js | 34 ++--- apps/OpenSign/src/pages/Login.js | 12 +- apps/OpenSign/src/pages/Managesign.js | 4 +- apps/OpenSign/src/pages/Opensigndrive.js | 50 ++++--- apps/OpenSign/src/pages/PdfRequestFiles.js | 113 +++++++------- apps/OpenSign/src/pages/Pgsignup.js | 29 ++-- apps/OpenSign/src/pages/PlaceHolderSign.js | 50 +++---- apps/OpenSign/src/pages/PlanSubscriptions.js | 18 ++- apps/OpenSign/src/pages/Report.js | 6 +- apps/OpenSign/src/pages/SSOVerify.js | 30 ++-- apps/OpenSign/src/pages/Signup.js | 16 +- apps/OpenSign/src/pages/SignyourselfPdf.js | 4 +- .../OpenSign/src/pages/TemplatePlaceholder.js | 12 +- .../src/pages/UpdateExistUserAdmin.js | 26 ++-- apps/OpenSign/src/pages/UserProfile.js | 8 +- apps/OpenSign/src/pages/Webhook.js | 14 +- 30 files changed, 598 insertions(+), 325 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index f85308bc1..0beaea5a5 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -14,7 +14,18 @@ "tagline":"Tagline ", "has-requested-you-to-sign":"has requested you to sign", "has-requested-you-to-review-and-sign":" has requested you to review and sign", - "ascending":"Ascending", + "sort-order" :{ + "Ascending":"Ascending", + "Descending":"Descending", + "Name":"Name", + "Date":"Date" + }, + "context-menu": { + "Download": "Download", + "Rename": "Rename", + "Move": "Move", + "Delete": "Delete" + }, "action":"Action", "add":"Add", "add-new-folder":"ajouter un nouveau dossier", @@ -45,6 +56,7 @@ "password-special-char":" Password should contain special character", "agreee":"I agree to the", "term":"Terms of Service", + "subscribe-to-opensign":"Subscribe to OpenSign newsletter", "register":"Register", "sidebar": { "Dashboard": "Dashboard", @@ -399,7 +411,131 @@ "decline-alert-3":"You can not sign this document as it has been declined/revoked.", "sign here":"Sign here", "guest-email-alert" :"verification code is sent to your email", - "get-otp-alert" :"you will get a OTP via Email" + "get-otp-alert" :"you will get a OTP via Email", + "user-already-exist":"User already exist.", + "server-error":"Internal server error !", + "fill-required-details!":"Please fill required details!", + "sign-up-form":"Sign up form", + "sign-up":"Sign up", + "folder-already-exist!":"folder already exist!", + "please-select-position!":"please select position!", + "default-sign-alert":"Are you sure you want to auto sign at requested all locations?", + "Your-Signature":"Your Signature", + "auto-sign-all" :"Auto Sign All", + "generating-certificate":"Generating certificate", + "pdf-download":"PDF Download", + "generate-certificate-alert" :" Your completion certificate is being generated. Please wait momentarily. If the download doesn't start shortly, click the button again.", + "folder-already-exist" :"Folder already exist!" , + "folder-created-successfully":"Folder created successfully!", + "fill-folder-name" :"Please fill folder name" , + "already-exists-this-username" :"User already exists with this username!", + "verification-code-sent":"Verification mail has been sent to your E-mail!", + "registered-user-successfully":"Registered user successfully.", + "role-not-found":"Role not found.", + "do-not-access" :"You don't have access, please contact the admin.", + "add-admin":"Add admin", + "opensign-setup" :"Opensign Setup", + "join-discord" :"Join our discord server", + "admin-already-exist":"Admin already exist.", + "password-update-alert-1":"Password updated successfully.", + "password-update-alert-2":"Your current password is missing or incorrect.", + "password-update-alert-3" :"Your current password is missing or incorrect.", + "password-update-alert-4" :"Your password and confirmation password do not match.", + "current-password":" Current Password" , + "new-password":"New Password", + "confirm-password":"Confirm Password", + "file-alert-1" :"The selected file size is too large. Please select a file less than", + "file-alert-2" :"Please select file.", + "file-alert-3" :"Please wait while the document is being uploaded.", + "enter-pdf-password" :"Enter Pdf Password", + "correct-password" :"Please provide correct password", + "decrypting-pdf" :" Decrypting pdf please wait...", + "invalid-otp":"Invalid Otp", + "user-not-found":"User not found!", + "enter-otp-alert" :"Please Enter OTP!", + "get-verification-code":"Get verification code", + "get-verification-code-2" :"You will get a verification code via Email", + "enter-verification-code":"Enter Verification Code", + "provide-your-details" :"Provide your details", + "provide-email":"Please provide email.", + "additional-info" :"Additional Info", + "signature-saved-alert":"Signature saved successfully.", + "fill-field" :"Please fill out this field", + "error-template" :"Error: Template not found!", + "invalid-document" :"Error: invalid document!", + "document-not-found" :"Document not Found!", + "document-signed-alert-1" :"You have successfully signed the document. You can download or print a copy of the partially signed document. A copy of the digitally signed document will be sent to the owner over email once it is signed by all signers.", + "encrypted-pdf-not-support" :"Currently encrypted pdf files are not supported.", + "document-signed-alert-4" :" Congratulations! 🎉 This document has been successfully signed by all participants!", + "document-signed-alert-5" :"This document has been signed by all Signers.", + "document-signed-alert-6" : "This document has been declined by one or more recipient(s).", + "document-signed-alert-7" :"This Document is no longer available.", + "document-signed-alert-8" :"The document has already been dispatched for signing.", + "yet-to-sign":"Yet to sign", + "validation-alert-1" :"The input does not meet the criteria set by the regular expression.", + "account-already-exists" :"Account already exists!", + "choose-password":"Choose Password", + "enter-password":"Enter Password", + "sure":"sure", + "subscribed-alert" :"You have already subscribed to plan!", + "monthly" :"Monthly", + "yearly-upto" :"Yearly (upto 66% off)", + "billed-yearly":"Billed Yearly", + "billed-monthly": "Billed Monthly", + "plansubscription-1" :"Host it yourself for free", + "visit-github":"Visit Github", + "user-already-exist-name" :"User already exists with this username!", + "do-not-access-contact-admin" : "You don't have access, please contact the admin.", + "filed-required-correctly" :"Please fill required details correctly.", + "admin-created":"Admin created", + "invalid-masterkey" :"Invalid masterkey", + "opensign-Setup" :"Opensign Setup", + "master-key":" Master key", + "profile-update-alert" :"Profile updated successfully.", + "date":"Date", + "tour-mssg":{ + "home-layout-1":"You have logged in successfully! Let's take a look.", + "home-layout-2":"To upload documents for self-signing or to request others’ signatures, simply select the respective buttons.", + "home-layout-3":"You are ready to start using OpenSign! If you need support feel free to contact us.", + "generate-token":"Upgrade now to generate API token", + "opensign-drive-1":"Click on the breadcrumb links to easily navigate through the folder hierarchy and view the documents within each folder.", + "opensign-drive-2":"Click the add button to create a new folder or document.", + "opensign-drive-3":"Sort your documents by Date or Name using this menu.", + "opensign-drive-4":"Click on this menu to display the documents in list view.", + "opensign-drive-5":"The document list is displayed according to the selected sorting option. Icons next to each document indicate its current status.", + "opensign-drive-6":"Right-click on a document to see options such as Download, Rename, Move, and Delete. Click on the document to open it.", + "opensign-drive-7":"Right-click on any folder to see options. Choose ‘Rename’ to change the folder’s name or click on the folder to navigate through its contents.", + "pdf-request-file-1":"List of signers who still need to sign the document .", + "pdf-request-file-2":"Click any of the placeholders appearing on the document to sign. You will then see options to draw your signature, type it, or upload an image .", + "pdf-request-file-3":"Click the Back, Decline, or Finish buttons to navigate your document. Use the ellipsis menu for additional options, including the Download button .", + "pdf-request-file-4":"List of signers who have already signed the document .", + "pdf-request-file-5":"You can click 'Auto Sign All' to automatically sign at all the locations meant to be signed by you. Make sure that you review the document properly before you click this button .", + "placeholder-sign-1":"Select a recipient from this list to add a place-holder where he is supposed to sign.The placeholder will appear in the same colour as the recipient name once you drop it on the document.", + "placeholder-sign-2":"Clicking 'Add recipients' button will allow you to add more signers.", + "placeholder-sign-3":"Drag or click on a field to add it to the document.", + "placeholder-sign-4":"The PDF content area already displays the template's existing placeholders. For your convenience, these placeholders will match the color of the recipient's name, making them easily identifiable.", + "placeholder-sign-5":"Clicking 'Send' will save the document. In the next step you can customize the emails to be sent out to the recipients or copy the signing links and share those with the recipients yourself.", + "report-1":"Click the 'Add' button to create a new template. Templates are reusable documents designed to quickly generate new documents with the same structure and varying signers. For example, an HR template for onboarding could have predefined roles like ‘HR Manager’ and ‘New Employee’. Each time you use the template, you can assign the ‘New Employee’ role to different incoming staff members, while the ‘HR Manager’ role remains constant, facilitating a seamless onboarding process for each recruit. ", + "signyour-self-1":"Select and drag your preferred widgets onto the PDF to customize your document before signing. Choose the perfect spots for each modification to tailor the document to your needs.", + "signyour-self-2":"Drag and drop anywhere in this area. You can resize and move it later.", + "template-placeholder-1":"Clicking 'Add role' button will allow you to add various signer roles. You can attach users to each role in subsequent steps.", + "template-placeholder-2":"Once roles are added, select a role from list to add a place-holder where he is supposed to sign. The placeholder will appear in the same colour as the role name once you drop it on the document.", + "template-placeholder-3":"Drag or click on a field to add it to the document.", + "template-placeholder-4":"Drag the placeholder for a role anywhere on the document.Remember, it will appear in the same colour as the name of the recipient for easy reference.", + "template-placeholder-5":"Clicking 'Next' will store the current template. After saving, you’ll be prompted to create a new document from this template if you wish.", + "webhook-1":"Upgrade now to set webhook" + + + } + + + + + + + + + } \ No newline at end of file diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 8405706c7..dd5c130e0 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -14,7 +14,18 @@ "tagline":"Slogan", "has-requested-you-to-sign":" vous a demandé de signer", "has-requested-you-to-review-and-sign":"vous a demandé de consulter et de signer", - "ascending":"Ascendant", + "sort-order" :{ + "Ascending":"Ascendant", + "Descending":"Descendant", + "Name":"Nom", + "Date":"Date" + }, + "context-menu": { + "Download": "Télécharger", + "Rename": "Renommer", + "Move": "Se déplacer", + "Delete": "Supprimer" + }, "action":"Action", "add":"ajouter", "add-new-folder":"ajouter un nouveau dossier", @@ -45,6 +56,7 @@ "password-special-char":"Le mot de passe doit contenir un caractère spécial", "agreee":"je suis d'accord avec le", "term":"Conditions d'utilisation", + "subscribe-to-opensign":"Abonnez-vous à la newsletter OpenSign", "register" :"Registre", "sidebar": { "Dashboard": "Tableau de bord", @@ -399,8 +411,125 @@ "decline-alert-3": "Vous ne pouvez pas signer ce document car il a été refusé/révoqué.", "sign here":"Signer ici", "guest-email-alert" :"le code de vérification a été envoyé sur votre e-mail", - "get-otp-alert":"vous recevrez un mot de passe à usage unique par e-mail" - + "get-otp-alert":"vous recevrez un mot de passe à usage unique par e-mail", + "user-already-exist" :"L'utilisateur existe déjà.", + "server-error":"Erreur interne du serveur !", + "fill-required-details!" :"Veuillez remplir les informations requises !", + "sign-up-form" :"Formulaire d'inscription", + "sign-up":"S'inscrire", + "folder-already-exist!" :"le dossier existe déjà !", + "please-select-position!" :"Veuillez sélectionner un poste !", + "default-sign-alert" :"Êtes-vous sûr de vouloir vous connecter automatiquement à tous les emplacements demandés ? ", + "Your-Signature":"Votre signature", + "auto-sign-all" :"Tout signer automatiquement", + "generating-certificate":"Génération du certificat", + "pdf-download" :"Téléchargement PDF", + "generate-certificate-alert" :" Votre certificat d'achèvement est en cours de génération. Veuillez patienter quelques instants. Si le téléchargement ne démarre pas sous peu, cliquez à nouveau sur le bouton. ", + "folder-already-exist":"Le dossier existe déjà !", + "folder-created-successfully":"Dossier créé avec succès !", + "fill-folder-name":"Veuillez indiquer le nom du dossier", + "already-exists-this-username":"Un utilisateur existe déjà avec ce nom d'utilisateur !", + "verification-code-sent" :"Un e-mail de vérification a été envoyé à votre adresse e-mail !", + "registered-user-successfully" :"Utilisateur enregistré avec succès.", + "role-not-found" :"Rôle introuvable.", + "do-not-access" :"Vous n'y avez pas accès, veuillez contacter l'administrateur.", + "add-admin" :"Ajouter un administrateur", + "opensign-setup" :"Configuration d'Opensign", + "join-discord" :"Rejoignez notre serveur Discord", + "admin-already-exist":"L'administrateur existe déjà.", + "password-update-alert-1" :"Mot de passe mis à jour avec succès.", + "password-update-alert-2" :"Votre mot de passe actuel est manquant ou incorrect.", + "password-update-alert-3" :"Votre mot de passe actuel est manquant ou incorrect.", + "password-update-alert-4" :"Votre mot de passe et votre mot de passe de confirmation ne correspondent pas.", + "current-password":"Current Password", + "new-password" :"nouveau mot de passe", + "confirm-password":"Confirmez le mot de passe", + "file-alert-1":"La taille du fichier sélectionné est trop grande. Veuillez sélectionner un fichier inférieur à", + "file-alert-2" :"Veuillez sélectionner un fichier.", + "file-alert-3" :"Veuillez patienter pendant le téléchargement du document." , + "enter-pdf-password" :"Entrez le mot de passe PDF" , + "correct-password" :"Veuillez fournir un mot de passe correct", + "decrypting-pdf" :"Décryptage du pdf, veuillez patienter...", + "invalid-otp" :"OTP invalide", + "user-not-found" :"Utilisateur non trouvé!", + "enter-otp-alert" :"Veuillez saisir OTP !", + "get-verification-code" :"Obtenir le code de vérification", + "get-verification-code-2" :"Vous recevrez un code de vérification par e-mail", + "enter-verification-code" :"Entrez le code de vérification", + "provide-your-details" :"Fournissez vos coordonnées", + "provide-email" :"Veuillez fournir un e-mail.", + "additional-info" :"Information additionnelle", + "signature-saved-alert" :"Signature enregistrée avec succès.", + "fill-field":"Veuillez remplir ce champ", + "error-template":"Erreur : modèle introuvable ! ", + "invalid-document" :"Erreur : document invalide !", + "document-not-found" :"Document introuvable !", + "document-signed-alert-1" :"Vous avez signé le document avec succès. Vous pouvez télécharger ou imprimer une copie du document partiellement signé. Une copie du document signé numériquement sera envoyée au propriétaire par e-mail une fois qu'il sera signé par tous les signataires.", + "encrypted-pdf-not-support" :"Les fichiers PDF actuellement cryptés ne sont pas pris en charge. ", + "document-signed-alert-4" :"Toutes nos félicitations! 🎉 Ce document a été signé avec succès par tous les participants !", + "document-signed-alert-5" :"Ce document a été signé par tous les signataires.", + "document-signed-alert-6" :"Ce document a été refusé par un ou plusieurs destinataire(s).", + "document-signed-alert-7" : "Ce document n'est plus disponible.", + "document-signed-alert-8":"Le document a déjà été envoyé pour signature.", + "yet-to-sign" :"Reste à signer", + "validation-alert-1" :"L'entrée ne répond pas aux critères définis par l'expression régulière.", + "account-already-exists" :"Le compte existe déjà!", + "choose-password" :"Choisissez un mot de passe", + "enter-password" :"Entrer le mot de passe", + "sure" :"bien sûr", + "subscribed-alert":"Vous êtes déjà abonné au forfait !", + "monthly" :"Mensuel", + "yearly-upto" :"Annuel (jusqu'à 66 % de réduction)", + "billed-yearly" :"Facturé annuellement", + "billed-monthly" :"Facturé mensuellement", + "plansubscription-1" :"Hébergez-le vous-même gratuitement", + "visit-github" :"Visitez Github", + "user-already-exist-name" :"Un utilisateur existe déjà avec ce nom d'utilisateur !", + "do-not-access-contact-admin" :"Vous n'y avez pas accès, veuillez contacter l'administrateur.", + "filed-required-correctly" :"Veuillez remplir correctement les informations requises.", + "admin-created" :"Administrateur créé", + "invalid-masterkey":"Clé principale invalide", + "opensign-Setup" :"Configuration d'Opensign", + "master-key" :"La clef maitresse", + "profile-update-alert" :"Mise à jour du profil réussie.", + "date":"Date", + "tour-mssg":{ + "home-layout-1":"Vous vous êtes connecté avec succès ! Jetons un coup d'oeil.", + "home-layout-2": "Pour télécharger des documents à auto-signature ou pour demander la signature d'autres personnes, sélectionnez simplement les boutons correspondants.", + "home-layout-3": "Vous êtes prêt à commencer à utiliser OpenSign ! Si vous avez besoin d'aide, n'hésitez pas à nous contacter.", + "generate-token": "Mettez à niveau maintenant pour générer un jeton API", + "opensign-drive-1": "Cliquez sur les liens du fil d'Ariane pour naviguer facilement dans la hiérarchie des dossiers et afficher les documents dans chaque dossier.", + "opensign-drive-2": "Cliquez sur le bouton Ajouter pour créer un nouveau dossier ou document.", + "opensign-drive-3": "Triez vos documents par date ou par nom à l'aide de ce menu.", + "opensign-drive-4": "Cliquez sur ce menu pour afficher les documents sous forme de liste.", + "opensign-drive-5": "La liste des documents s'affiche selon l'option de tri sélectionnée. Les icônes à côté de chaque document indiquent son état actuel.", + "opensign-drive-6": "Faites un clic droit sur un document pour voir les options telles que Télécharger, Renommer, Déplacer et Supprimer. Cliquez sur le document pour l'ouvrir.", + "opensign-drive-7": "Faites un clic droit sur n'importe quel dossier pour voir les options. Choisissez 'Renommer' pour changer le nom du dossier ou cliquez sur le dossier pour naviguer dans son contenu.", + "pdf-request-file-1":"Liste des signataires qui doivent encore signer le document.", + "pdf-request-file-2": "Cliquez sur l'un des espaces réservés apparaissant sur le document pour signer. Vous verrez alors des options pour dessiner votre signature, la saisir ou télécharger une image.", + "pdf-request-file-3": "Cliquez sur les boutons Précédent, Refuser ou Terminer pour parcourir votre document. Utilisez le menu points de suspension pour des options supplémentaires, notamment le bouton Télécharger.", + "pdf-request-file-4":"Liste des signataires ayant déjà signé le document.", + "pdf-request-file-5":"Vous pouvez cliquer sur 'Signer automatiquement tout' pour signer automatiquement à tous les emplacements que vous êtes censé signer. Assurez-vous de lire correctement le document avant de cliquer sur ce bouton.", + "placeholder-sign-1": "Sélectionnez un destinataire dans cette liste pour ajouter un espace réservé à l'endroit où il est censé signer. L'espace réservé apparaîtra de la même couleur que le nom du destinataire une fois que vous le déposerez sur le document.", + "placeholder-sign-2":"Cliquer sur le bouton 'Ajouter des destinataires' vous permettra d'ajouter plus de signataires.", + "placeholder-sign-3":"Faites glisser ou cliquez sur un champ pour l'ajouter au document.", + "placeholder-sign-4":"La zone de contenu PDF affiche déjà les espaces réservés existants du modèle. Pour votre commodité, ces espaces réservés correspondront à la couleur du nom du destinataire, ce qui les rendra facilement identifiables.", + "placeholder-sign-5":"Cliquer sur 'Envoyer' enregistrera le document. À l'étape suivante, vous pourrez personnaliser les e-mails à envoyer aux destinataires ou copier les liens de signature et les partager vous-même avec les destinataires.", + "report-1":"Cliquez sur le bouton 'Ajouter' pour créer un nouveau modèle. Les modèles sont des documents réutilisables conçus pour générer rapidement de nouveaux documents avec la même structure et différents signataires. Par exemple, un modèle RH pour l'intégration peut avoir des rôles prédéfinis tels que 'Responsable RH' et ' Nouvel employé'. Chaque fois que vous utilisez le modèle, vous pouvez attribuer le rôle 'Nouvel employé' à différents membres du personnel entrants, tandis que le rôle 'Responsable RH' reste constant, facilitant ainsi un processus d'intégration fluide pour chaque recrue", + "signyour-self-1": "Sélectionnez et faites glisser vos widgets préférés sur le PDF pour personnaliser votre document avant de le signer. Choisissez les endroits parfaits pour chaque modification afin d'adapter le document à vos besoins.", + "signyour-self-2":"Faites glisser et déposer n'importe où dans cette zone. Vous pourrez la redimensionner et la déplacer plus tard.", + "template-placeholder-1":"Cliquer sur le bouton 'Ajouter un rôle' vous permettra d'ajouter différents rôles de signataire. Vous pourrez attacher des utilisateurs à chaque rôle dans les étapes suivantes.", + "template-placeholder-2": "Une fois les rôles ajoutés, sélectionnez un rôle dans la liste pour ajouter un espace réservé à l'endroit où il est censé signer. L'espace réservé apparaîtra dans la même couleur que le nom du rôle une fois que vous l'aurez déposé sur le document.", + "template-placeholder-3":"Faites glisser ou cliquez sur un champ pour l'ajouter au document.", + "template-placeholder-4":"Faites glisser l'espace réservé pour un rôle n'importe où sur le document. N'oubliez pas qu'il apparaîtra dans la même couleur que le nom du destinataire pour une référence facile.", + "template-placeholder-5":"Cliquer sur 'Suivant' stockera le modèle actuel. Après l'enregistrement, vous serez invité à créer un nouveau document à partir de ce modèle si vous le souhaitez.", + "webhook-1":"Mettez à niveau maintenant pour définir le webhook" + + + } + + + diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js index 68ff280cf..b8b2bcdee 100644 --- a/apps/OpenSign/src/components/AddUser.js +++ b/apps/OpenSign/src/components/AddUser.js @@ -70,7 +70,7 @@ const AddUser = (props) => { setIsLoader(true); const res = await checkUserExist(); if (res) { - props.setIsAlert({ type: "danger", msg: "User already exist." }); + props.setIsAlert({ type: "danger", msg: t("user-already-exist") }); setIsLoader(false); setTimeout(() => { props.setIsAlert({ type: "success", msg: "" }); @@ -217,7 +217,10 @@ const AddUser = (props) => { } catch (err) { console.log("err", err); setIsLoader(false); - props.setIsAlert({ type: "danger", msg: "something went wrong." }); + props.setIsAlert({ + type: "danger", + msg: t("something-went-wrong-mssg") + }); } finally { setTimeout(() => props.setIsAlert({ type: "success", msg: "" }), 1500); } @@ -243,7 +246,7 @@ const AddUser = (props) => { const copytoclipboard = (text) => { copytoData(text); - props.setIsAlert({ type: "success", msg: "Copied" }); + props.setIsAlert({ type: "success", msg: t("copied") }); setTimeout(() => props.setIsAlert({ type: "success", msg: "" }), 1500); // Reset copied state after 1.5 seconds }; return ( diff --git a/apps/OpenSign/src/components/LoginFacebook.js b/apps/OpenSign/src/components/LoginFacebook.js index 7b3e2aa92..edfe43dc7 100644 --- a/apps/OpenSign/src/components/LoginFacebook.js +++ b/apps/OpenSign/src/components/LoginFacebook.js @@ -1,6 +1,7 @@ import React, { useState } from "react"; import Parse from "parse"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; // import FacebookLogin from "react-facebook-login"; const LoginFacebook = ({ @@ -9,6 +10,7 @@ const LoginFacebook = ({ thirdpartyLoader, setThirdpartyLoader }) => { + const { t } = useTranslation(); const [isModal, setIsModal] = useState(false); const [userDetails, setUserDetails] = useState({ Phone: "", @@ -106,10 +108,10 @@ const LoginFacebook = ({ alert(userSignUp.message); } } else { - alert("Internal server error !"); + alert(t("server-error")); } } else { - alert("Please fill required details!"); + alert(t("fill-required-details!")); } }; return ( @@ -136,7 +138,7 @@ const LoginFacebook = ({ <div className="modal-dialog" role="document"> <div className="modal-content"> <div className="modal-header"> - <h5 className="modal-title">Sign up form</h5> + <h5 className="modal-title">{t("sign-up-form")}</h5> <span> <span></span> </span> @@ -145,7 +147,8 @@ const LoginFacebook = ({ <form> <div className="form-group"> <label htmlFor="Phone" className="col-form-label"> - Phone <span className="text-[red] text-[13px]">*</span> + {t("phone")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="tel" @@ -163,7 +166,8 @@ const LoginFacebook = ({ </div> <div className="form-group"> <label htmlFor="Company" className="col-form-label"> - Company <span className="text-[red] text-[13px]">*</span> + {t("company")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="text" @@ -185,14 +189,14 @@ const LoginFacebook = ({ onClick={() => handleSubmitbtn()} className="btn btn-info mr-[10px]" > - Sign up + {t("sign-up")} </button> <button type="button" className="btn btn-secondary w-[90px]" onClick={() => setIsModal(false)} > - Cancel + {t("cancel")} </button> </div> </form> diff --git a/apps/OpenSign/src/components/LoginGoogle.js b/apps/OpenSign/src/components/LoginGoogle.js index 08d027f52..5dbf2845e 100644 --- a/apps/OpenSign/src/components/LoginGoogle.js +++ b/apps/OpenSign/src/components/LoginGoogle.js @@ -4,7 +4,7 @@ import { jwtDecode } from "jwt-decode"; import { useScript } from "../hook/useScript"; import ModalUi from "../primitives/ModalUi"; import Loader from "../primitives/Loader"; - +import { useTranslation } from "react-i18next"; /* * `GoogleSignInBtn`as it's name indicates it render google sign in button * and in this `useScript` in which we have created for generate google sign button @@ -17,6 +17,7 @@ const GoogleSignInBtn = ({ thirdpartyLoader, setThirdpartyLoader }) => { + const { t } = useTranslation(); const [isModal, setIsModal] = useState(false); const googleBtn = useRef(); const [userDetails, setUserDetails] = useState({ @@ -162,10 +163,10 @@ const GoogleSignInBtn = ({ payload && payload.message.replace(/ /g, "_") === "Internal_server_err" ) { - alert("Internal server error !"); + alert(t("server-error")); } } else { - alert("Please fill required details!"); + alert(t("fill-required-details!")); } }; const handleCloseModal = () => { @@ -196,11 +197,11 @@ const GoogleSignInBtn = ({ </div> )} <div ref={googleBtn} className="text-sm"></div> - <ModalUi showClose={false} isOpen={isModal} title="Sign up form"> + <ModalUi showClose={false} isOpen={isModal} title={t("sign-up-form")}> <form className="px-4 py-3 text-base-content"> <div className="mb-3"> <label htmlFor="Phone" className="block text-xs font-semibold"> - Phone <span className="text-[13px] text-[red]">*</span> + {t("phone")} <span className="text-[13px] text-[red]">*</span> </label> <input type="tel" @@ -218,7 +219,7 @@ const GoogleSignInBtn = ({ </div> <div className="mb-3"> <label htmlFor="Company" className="block text-xs font-semibold"> - Company <span className="text-[13px] text-[red]">*</span> + {t("company")} <span className="text-[13px] text-[red]">*</span> </label> <input type="text" @@ -236,7 +237,7 @@ const GoogleSignInBtn = ({ </div> <div className="mb-3"> <label htmlFor="JobTitle" className="block text-xs font-semibold"> - Job Title <span className="text-[13px] text-[red]">*</span> + {t("job-title")} <span className="text-[13px] text-[red]">*</span> </label> <input type="text" @@ -258,14 +259,14 @@ const GoogleSignInBtn = ({ className="op-btn op-btn-primary" onClick={() => handleSubmitbtn()} > - Sign up + {t("sign-up")} </button> <button type="button" className="op-btn op-btn-ghost" onClick={handleCloseModal} > - Cancel + {t("cancel")} </button> </div> </form> diff --git a/apps/OpenSign/src/components/opensigndrive/DriveBody.js b/apps/OpenSign/src/components/opensigndrive/DriveBody.js index 68398be9c..02ef21a1d 100644 --- a/apps/OpenSign/src/components/opensigndrive/DriveBody.js +++ b/apps/OpenSign/src/components/opensigndrive/DriveBody.js @@ -92,7 +92,7 @@ function DriveBody(props) { console.log("Err ", err); props.setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); }); } @@ -193,7 +193,7 @@ function DriveBody(props) { console.log("Err ", err); props.setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); }); }; @@ -260,7 +260,7 @@ function DriveBody(props) { setIsOpenMoveModal(false); } else { - alert("folder already exist!"); + alert(t("folder-already-exist!")); setIsOpenMoveModal(false); } }; @@ -505,7 +505,9 @@ function DriveBody(props) { className="ContextMenuItem" > <i className={menu.icon}></i> - <span className="ml-[8px]">{menu.type}</span> + <span className="ml-[8px]"> + {t(`context-menu${menu.type}`)} + </span> </ContextMenu.Item> ); })} diff --git a/apps/OpenSign/src/components/pdf/DefaultSignature.js b/apps/OpenSign/src/components/pdf/DefaultSignature.js index 4e4e0780a..3847b895b 100644 --- a/apps/OpenSign/src/components/pdf/DefaultSignature.js +++ b/apps/OpenSign/src/components/pdf/DefaultSignature.js @@ -1,16 +1,18 @@ import React from "react"; +import { useTranslation } from "react-i18next"; function DefaultSignature({ defaultSignImg, xyPostion, setDefaultSignAlert }) { + const { t } = useTranslation(); + const confirmToaddDefaultSign = () => { if (xyPostion.length > 0) { setDefaultSignAlert({ isShow: true, - alertMessage: - "Are you sure you want to auto sign at requested all locations?" + alertMessage: t("default-sign-alert") }); } else { setDefaultSignAlert({ isShow: true, - alertMessage: "please select position!" + alertMessage: t("please-select-position!") }); } }; @@ -18,10 +20,10 @@ function DefaultSignature({ defaultSignImg, xyPostion, setDefaultSignAlert }) { return ( <div data-tut="reactourThird"> <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"> - Signature + {t("signature")} </div> <div className="flex flex-col items-center mt-[10px] font-semibold"> - <p className="text-base-content">Your Signature</p> + <p className="text-base-content">{t("Your-Signature")}</p> <div className="op-card shadow-md h-[111px] w-[90%] p-2"> <img alt="signature" @@ -34,7 +36,7 @@ function DefaultSignature({ defaultSignImg, xyPostion, setDefaultSignAlert }) { className="op-btn op-btn-primary op-btn-sm mt-[10px]" onClick={() => confirmToaddDefaultSign()} > - Auto Sign All + {t("auto-sign-all")} </button> </div> </div> diff --git a/apps/OpenSign/src/components/pdf/PdfHeader.js b/apps/OpenSign/src/components/pdf/PdfHeader.js index b685b2cdd..1d1647ff4 100644 --- a/apps/OpenSign/src/components/pdf/PdfHeader.js +++ b/apps/OpenSign/src/components/pdf/PdfHeader.js @@ -164,7 +164,7 @@ function Header({ onClick={() => handleDeclinePdfAlert()} className="text-[red] border-none font-[650] text-[14px] mr-2" > - Decline + {t("decline")} </div> )} {isPlaceholder ? ( @@ -179,7 +179,7 @@ function Header({ } op-link no-underline font-[650] text-[14px]`} data-tut="headerArea" > - {completeBtnTitle ? completeBtnTitle : "Send"} + {completeBtnTitle ? completeBtnTitle : t("send")} </div> ) : ( <div @@ -465,18 +465,14 @@ function Header({ isOpen={isDownloading === "certificate"} title={ isDownloading === "certificate" - ? "Generating certificate" - : "PDF Download" + ? t("generating-certificate") + : t("pdf-download") } handleClose={() => setIsDownloading("")} > <div className="p-3 md:p-5 text-[13px] md:text-base text-center text-base-content"> {isDownloading === "certificate"}{" "} - <p> - Your completion certificate is being generated. Please wait - momentarily. If the download doesn't start shortly, click the - button again. - </p> + <p>{t("generate-certificate-alert")}</p> </div> </ModalUi> </div> diff --git a/apps/OpenSign/src/components/shared/fields/CreateFolder.js b/apps/OpenSign/src/components/shared/fields/CreateFolder.js index 20c253996..3f7448eab 100644 --- a/apps/OpenSign/src/components/shared/fields/CreateFolder.js +++ b/apps/OpenSign/src/components/shared/fields/CreateFolder.js @@ -62,7 +62,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { } const templExist = await exsitQuery.first(); if (templExist) { - setAlert({ type: "danger", message: "Folder already exist!" }); + setAlert({ type: "danger", message: t("folder-already-exist") }); setIsAlert(true); setTimeout(() => { setIsAlert(false); @@ -87,7 +87,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { handleLoader(false); setAlert({ type: "success", - message: "Folder created successfully!" + message: t("folder-created-successfully") }); setIsAlert(true); setTimeout(() => { @@ -100,7 +100,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { } } else { handleLoader(false); - setAlert({ type: "info", message: "Please fill folder name" }); + setAlert({ type: "info", message: t("fill-folder-name") }); setIsAlert(true); setTimeout(() => { setIsAlert(false); diff --git a/apps/OpenSign/src/layout/HomeLayout.js b/apps/OpenSign/src/layout/HomeLayout.js index 89f748c31..153c0dc26 100644 --- a/apps/OpenSign/src/layout/HomeLayout.js +++ b/apps/OpenSign/src/layout/HomeLayout.js @@ -14,8 +14,10 @@ import { useCookies } from "react-cookie"; import { fetchSubscription } from "../constant/Utils"; import Loader from "../primitives/Loader"; import { showHeader } from "../redux/reducers/showHeader"; +import { useTranslation } from "react-i18next"; const HomeLayout = () => { + const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -150,20 +152,20 @@ const HomeLayout = () => { setTourConfigs([ { selector: '[data-tut="reactourFirst"]', - content: `You have logged in successfully! Let's take a look.`, + content: t("tour-mssg.home-layout-1"), position: "top" // style: { backgroundColor: "#abd4d2" }, }, { selector: '[data-tut="tourbutton"]', - content: `To upload documents for self-signing or to request others’ signatures, simply select the respective buttons.`, + content: t("tour-mssg.home-layout-2"), position: "top" // style: { backgroundColor: "#abd4d2" }, }, ...resArr, { selector: '[data-tut="reactourLast"]', - content: `You are ready to start using OpenSign! If you need support feel free to contact us.`, + content: t("tour-mssg.home-layout-3"), position: "top" // style: { backgroundColor: "#abd4d2" }, } diff --git a/apps/OpenSign/src/pages/AddAdmin.js b/apps/OpenSign/src/pages/AddAdmin.js index 7f65feadb..bba1da4b9 100644 --- a/apps/OpenSign/src/pages/AddAdmin.js +++ b/apps/OpenSign/src/pages/AddAdmin.js @@ -7,8 +7,10 @@ import { useDispatch } from "react-redux"; import { showTenant } from "../redux/reducers/ShowTenant"; import Loader from "../primitives/Loader"; import Title from "../components/Title"; +import { useTranslation } from "react-i18next"; const AddAdmin = () => { + const { t } = useTranslation(); const navigate = useNavigate(); const dispatch = useDispatch(); const [showPassword, setShowPassword] = useState(false); @@ -40,10 +42,10 @@ const AddAdmin = () => { try { const app = await getAppLogo(); if (app?.user === "exist") { - setErrMsg("Admin already exist."); + setErrMsg(t("admin-already-exist")); } } catch (err) { - setErrMsg("Something went wrong."); + setErrMsg(t("something-went-wrong-mssg")); console.log("err in check user exist", err); } finally { setState((prev) => ({ ...prev, loading: false })); @@ -124,7 +126,7 @@ const AddAdmin = () => { const res = await Parse.Cloud.run("getUserDetails", params); // console.log("Res ", res); if (res) { - alert("User already exists with this username!"); + alert(t("already-exists-this-username")); setState({ loading: false }); } else { // console.log("state.email ", email); @@ -132,7 +134,7 @@ const AddAdmin = () => { await Parse.User.requestPasswordReset(email).then( async function (res) { if (res.data === undefined) { - alert("Verification mail has been sent to your E-mail!"); + alert(t("verification-code-sent")); } } ); @@ -199,27 +201,27 @@ const AddAdmin = () => { setState({ loading: false, alertType: "success", - alertMsg: "Registered user successfully." + alertMsg: t("registered-user-successfully") }); navigate(`/${menu.pageType}/${menu.pageId}`); } else { setState({ loading: false, alertType: "danger", - alertMsg: "Role not found." + alertMsg: t("role-not-found") }); } } else { setState({ loading: false, alertType: "danger", - alertMsg: "You don't have access, please contact the admin." + alertMsg: t("do-not-access") }); } } } catch (error) { console.log("error in fetch extuser", error); - const msg = error.message || "Something went wrong."; + const msg = error.message || t("something-went-wrong-mssg"); setState({ loading: false, alertType: "danger", alertMsg: msg }); } finally { setTimeout(() => setState({ loading: false, alertMsg: "" }), 2000); @@ -249,7 +251,7 @@ const AddAdmin = () => { }; return ( <div className="h-screen flex justify-center"> - <Title title={"Add admin"} /> + <Title title={t("add-admin")} /> {state.loading ? ( <div className="text-[grey] flex justify-center items-center text-lg md:text-2xl"> <Loader /> @@ -265,7 +267,7 @@ const AddAdmin = () => { <form onSubmit={handleSubmit}> <div className="w-full my-4 op-card bg-base-100 shadow-md outline outline-1 outline-slate-300/50"> <h2 className="text-[30px] text-center mt-3 font-medium"> - Opensign Setup + {t("opensign-setup")} </h2> <NavLink to="https://discord.com/invite/xe9TDuyAyj" @@ -273,7 +275,7 @@ const AddAdmin = () => { rel="noopener noreferrer" className="text-center text-sm mt-1 text-[blue] cursor-pointer" > - Join our discord server + {t("join-discord")} <i aria-hidden="true" className="fa-brands fa-discord ml-1" @@ -282,7 +284,8 @@ const AddAdmin = () => { </NavLink> <div className="px-6 py-3 text-xs"> <label className="block "> - Name <span className="text-[red] text-[13px]">*</span> + {t("name")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="text" @@ -293,7 +296,8 @@ const AddAdmin = () => { /> <hr className="my-2 border-none" /> <label> - Email <span className="text-[red] text-[13px]">*</span> + {"email"}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input id="email" @@ -305,7 +309,8 @@ const AddAdmin = () => { /> <hr className="my-2 border-none" /> <label> - Phone <span className="text-[red] text-[13px]">*</span> + {t("phone")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="tel" @@ -316,7 +321,8 @@ const AddAdmin = () => { /> <hr className="my-2 border-none" /> <label> - Company <span className="text-[red] text-[13px]">*</span> + {t("company")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input type="text" @@ -327,7 +333,7 @@ const AddAdmin = () => { /> <hr className="my-2 border-none" /> <label> - Job Title{" "} + {t("job-title")}{" "} <span className="text-[red] text-[13px]">*</span> </label> <input @@ -339,7 +345,8 @@ const AddAdmin = () => { /> <hr className="my-2 border-none" /> <label> - Password <span className="text-[red] text-[13px]">*</span> + {t("password")} + <span className="text-[red] text-[13px]">*</span> </label> <div className="relative"> <input @@ -368,24 +375,22 @@ const AddAdmin = () => { lengthValid ? "text-green-600" : "text-red-600" }`} > - {lengthValid ? "✓" : "✗"} Password should be 8 - characters long + {lengthValid ? "✓" : "✗"} {t("password-length")} </p> <p className={`${ caseDigitValid ? "text-green-600" : "text-red-600" }`} > - {caseDigitValid ? "✓" : "✗"} Password should contain - uppercase letter, lowercase letter, digit + {caseDigitValid ? "✓" : "✗"} {t("password-case")} </p> <p className={`${ specialCharValid ? "text-green-600" : "text-red-600" }`} > - {specialCharValid ? "✓" : "✗"} Password should contain - special character + {specialCharValid ? "✓" : "✗"}{" "} + {t("password-special-char")} </p> </div> )} @@ -402,7 +407,7 @@ const AddAdmin = () => { className="text-xs cursor-pointer ml-1 mb-0" htmlFor="termsandcondition" > - I agree to the + {t("agreee")} </label> <span className="underline cursor-pointer ml-1" @@ -412,7 +417,7 @@ const AddAdmin = () => { ) } > - Terms of Service + {t("term")} </span> <span>.</span> </div> @@ -428,7 +433,7 @@ const AddAdmin = () => { className="text-xs cursor-pointer ml-1 mb-0" htmlFor="termsandcondition" > - Subscribe to OpenSign newsletter + {t("subscribe-to-opensign")} </label> </div> </div> @@ -438,7 +443,7 @@ const AddAdmin = () => { className="op-btn op-btn-primary w-full" disabled={state.loading} > - {state.loading ? "Loading..." : "Next"} + {state.loading ? t("loading") : t("next")} </button> </div> </div> diff --git a/apps/OpenSign/src/pages/ChangePassword.js b/apps/OpenSign/src/pages/ChangePassword.js index 990fd8ed8..b78918a61 100644 --- a/apps/OpenSign/src/pages/ChangePassword.js +++ b/apps/OpenSign/src/pages/ChangePassword.js @@ -2,8 +2,10 @@ import React, { useState } from "react"; import Parse from "parse"; import { Navigate } from "react-router-dom"; import Title from "../components/Title"; +import { useTranslation } from "react-i18next"; function ChangePassword() { + const { t } = useTranslation(); const [currentpassword, setCurrentPassword] = useState(""); const [newpassword, setnewpassword] = useState(""); const [confirmpassword, setconfirmpassword] = useState(""); @@ -27,23 +29,23 @@ function ChangePassword() { await Parse.User.become(_user.sessionToken); localStorage.setItem("accesstoken", _user.sessionToken); } - alert("Password updated successfully."); + alert(t("password-update-alert-1")); }) .catch((error) => { console.log("err", error); - alert("Something went wrong."); + alert(t("something-went-wrong-mssg")); }); }); } else { - alert("Your current password is missing or incorrect."); + alert(t("password-update-alert-2")); } }) .catch((error) => { - alert("Your current password is missing or incorrect."); + alert(t("password-update-alert-3")); console.error("Error while logging in user", error); }); } else { - alert("Your password and confirmation password do not match."); + alert(t("password-update-alert-4")); } } catch (error) { console.log("err", error); @@ -56,13 +58,13 @@ function ChangePassword() { <div className="w-full bg-base-100 text-base-content shadow rounded-box p-2"> <Title title="Change Password" /> <div className="text-xl font-bold border-b-[1px] border-gray-300"> - Change Password + {t("change-password")} </div> <div className="m-2"> <form onSubmit={handleSubmit} className=" flex flex-col gap-y-2"> <div> <label htmlFor="currentpassword" className="block text-xs ml-1"> - Current Password + {t("current-password")} </label> <input type="password" @@ -76,7 +78,7 @@ function ChangePassword() { </div> <div> <label htmlFor="newpassword" className="text-xs block ml-1"> - New Password + {t("new-password")} </label> <input type="password" @@ -90,7 +92,7 @@ function ChangePassword() { </div> <div> <label htmlFor="newpassword" className="text-xs block ml-1"> - Confirm Password + {t("confirm-password")} </label> <input type="password" @@ -106,7 +108,7 @@ function ChangePassword() { type="submit" className="op-btn op-btn-primary shadow-md mt-2" > - Change Password + {t("change-password")} </button> </form> </div> diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.js index d06ba09a6..67b204b9b 100644 --- a/apps/OpenSign/src/pages/Form.js +++ b/apps/OpenSign/src/pages/Form.js @@ -111,9 +111,7 @@ const Forms = (props) => { if (typeof files[0] !== "undefined") { const mb = Math.round(files[0].size / Math.pow(1024, 2)); if (mb > maxFileSize) { - alert( - `The selected file size is too large. Please select a file less than ${maxFileSize} MB` - ); + alert(`${t("file-alert-1")} ${maxFileSize} MB`); setFileUpload(""); e.target.value = ""; return; @@ -294,7 +292,7 @@ const Forms = (props) => { } } } else { - alert("Please select file."); + alert(t("file-alert-2")); return false; } } catch (error) { @@ -346,9 +344,7 @@ const Forms = (props) => { if (mb > maxFileSize) { setTimeout(() => { - alert( - `The selected file size is too large. Please select a file less than ${maxFileSize} MB` - ); + alert(`${t("file-alert-1")}${maxFileSize} MB`); }, 500); return; } else { @@ -446,7 +442,7 @@ const Forms = (props) => { setIsSubmit(false); } } else { - alert("Please wait while the document is being uploaded."); + alert(t("file-alert-3")); } }; @@ -571,7 +567,7 @@ const Forms = (props) => { {isAlert && ( <Alert type={isErr ? "danger" : "success"}> {isErr - ? "Something went wrong please try again!" + ? t("something-went-wrong-mssg") : `${props.msgVar} created successfully!`} </Alert> )} @@ -584,12 +580,12 @@ const Forms = (props) => { <ModalUi isOpen={isPassword} handleClose={() => handeCloseModal()} - title={"Enter Pdf Password"} + title={t("enter-pdf-password")} > <form onSubmit={handlePasswordSubmit}> <div className="px-6 pt-3 pb-2"> <label className="mb-2 text-xs text-base-content"> - Password + {t("password")} </label> <input type="text" @@ -607,12 +603,12 @@ const Forms = (props) => { : "text-transparent pointer-events-none" } ml-2 text-[11px] `} > - Please provide correct password + {t("correct-password")} </p> </div> <div className="px-6 mb-3"> <button type="submit" className="op-btn op-btn-primary"> - Submit + {t("submit")} </button> </div> </form> @@ -635,7 +631,7 @@ const Forms = (props) => { {isDecrypting && ( <div className="flex items-center gap-x-2"> <span className="text-base-content text-sm"> - Decrypting pdf please wait... + {t("decrypting-pdf")} </span> </div> )} @@ -775,11 +771,11 @@ const Forms = (props) => { <p className="p-[5px]"> <ol className="list-disc"> <li> - <span className="font-bold">Yes:</span> + <span className="font-bold">{t("yes")}:</span> <span>{t("send-in-order-help.p2")}</span> </li> <li> - <span className="font-bold">No: </span> + <span className="font-bold">{t("no")}: </span> <span>{t("send-in-order-help.p3")}</span> </li> </ol> @@ -797,7 +793,7 @@ const Forms = (props) => { checked={formData.SendinOrder === "true"} onChange={handleStrInput} /> - <div className="text-center">Yes</div> + <div className="text-center">{t("yes")}</div> </div> <div className="flex items-center gap-2 ml-2 mb-1"> <input diff --git a/apps/OpenSign/src/pages/GenerateToken.js b/apps/OpenSign/src/pages/GenerateToken.js index 511dd892b..99e7ede48 100644 --- a/apps/OpenSign/src/pages/GenerateToken.js +++ b/apps/OpenSign/src/pages/GenerateToken.js @@ -10,12 +10,6 @@ import Loader from "../primitives/Loader"; import SubscribeCard from "../primitives/SubscribeCard"; import Tour from "reactour"; import { useTranslation } from "react-i18next"; -const tourSteps = [ - { - selector: '[data-tut="apisubscribe"]', - content: "Upgrade now to generate API token" - } -]; function GenerateToken() { const { t } = useTranslation(); @@ -31,7 +25,12 @@ function GenerateToken() { fetchToken(); // eslint-disable-next-line }, []); - + const tourSteps = [ + { + selector: '[data-tut="apisubscribe"]', + content: t("tour-mssg.generate-token") + } + ]; const fetchToken = async () => { try { if (isEnableSubscription) { diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index bdcdb0375..f197f7044 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -89,7 +89,7 @@ function GuestLogin() { setEnterOtp(true); } } catch (error) { - alert("something went wrong!"); + alert(t("something-went-wrong-mssg")); } }; @@ -119,10 +119,10 @@ function GuestLogin() { }; let user = await axios.post(url, body, { headers: headers }); if (user.data.result === "Invalid Otp") { - alert("Invalid Otp"); + alert(t("invalid-otp")); setLoading(false); } else if (user.data.result === "user not found!") { - alert("User not found!"); + alert(t("user-not-found")); setLoading(false); } else { let _user = user.data.result; @@ -158,7 +158,7 @@ function GuestLogin() { console.log("err ", error); } } else { - alert("Please Enter OTP!"); + alert(t("enter-otp-alert")); } }; const handleUserData = async (e) => { @@ -173,7 +173,7 @@ function GuestLogin() { await SendOtp(); } catch (err) { setLoading(false); - alert("something went wron, please try agian later."); + alert(t("something-went-wrong-mssg")); console.log("Err in link ext contact", err); } }; @@ -198,7 +198,7 @@ function GuestLogin() { <> {!EnterOTP ? ( <div className="w-full md:w-[50%] text-base-content"> - <h1 className="text-2xl md:text-[30px]">Welcome Back!</h1> + <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> <legend className="text-[12px] text-[#878787] mt-2 mb-1"> {t("guest-email-alert")} </legend> @@ -217,7 +217,7 @@ function GuestLogin() { onClick={(e) => handleSendOTPBtn(e)} disabled={loading} > - {loading ? "Loading..." : "Get verification code"} + {loading ? t("loading") : t("get-verification-code")} </button> </div> </div> @@ -226,12 +226,12 @@ function GuestLogin() { className="w-full md:w-[50%] text-base-content" onSubmit={VerifyOTP} > - <h1 className="text-2xl md:text-[30px]">Welcome Back!</h1> + <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> <legend className="text-[12px] text-[#878787] mt-2"> - You will get a verification code via Email + {t("get-verification-code-2")} </legend> <div className="p-[20px] pt-[15px] outline outline-1 outline-slate-300/50 op-card my-2 shadow-md"> - <p className="text-sm">Enter Verification Code</p> + <p className="text-sm">{t("enter-verification-code")}</p> <input type="number" className="mt-2 op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -246,7 +246,7 @@ function GuestLogin() { type="submit" disabled={loading} > - {loading ? "Loading..." : "Verify"} + {loading ? t("loading") : t("verify")} </button> </div> </form> @@ -254,9 +254,9 @@ function GuestLogin() { </> ) : ( <div className="w-full md:w-[50%] text-base-content"> - <h1 className="text-2xl md:text-[30px]">Welcome</h1> + <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> <legend className="text-[12px] text-[#878787] mt-2"> - Provide your details + {t("provide-your-details")} </legend> <form className="p-[20px] pt-[15px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md" @@ -267,7 +267,7 @@ function GuestLogin() { htmlFor="name" className="block text-xs text-gray-700 font-semibold" > - Name + {t("name")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -285,7 +285,7 @@ function GuestLogin() { htmlFor="email" className="block text-xs text-gray-700 font-semibold" > - Email + {t("email")} <span className="text-[red] text-[13px]"> *</span> </label> <input @@ -303,7 +303,7 @@ function GuestLogin() { htmlFor="phone" className="block text-xs text-gray-700 font-semibold" > - Phone + {t("phone")} </label> <input type="text" @@ -320,7 +320,7 @@ function GuestLogin() { className="op-btn op-btn-primary" disabled={loading} > - {loading ? "Loading..." : "Next"} + {loading ? t("loading") : t("next")} </button> </div> </form> diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 4df8dd688..053fe8f03 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -247,7 +247,7 @@ function Login() { } } catch (err) { console.log("err in free subscribe", err.message); - alert("Somenthing went wrong, please try again later!"); + alert(t("something-went-wrong-mssg")); } }; const thirdpartyLoginfn = async (sessionToken) => { @@ -551,7 +551,7 @@ function Login() { payload && payload.message.replace(/ /g, "_") === "Internal_server_err" ) { - alert("Internal server error !"); + alert(t("server-error")); } } else { setState({ @@ -601,7 +601,7 @@ function Login() { "_self" ); } else { - alert("Please provide email."); + alert(t("provide-email")); } } }; @@ -772,7 +772,11 @@ function Login() { </Alert> )} </div> - <ModalUi isOpen={isModal} title="Additional Info" showClose={false}> + <ModalUi + isOpen={isModal} + title={t("additional-info")} + showClose={false} + > <form className="px-4 py-3 text-base-content"> <div className="mb-3"> <label diff --git a/apps/OpenSign/src/pages/Managesign.js b/apps/OpenSign/src/pages/Managesign.js index f5a0a8cfe..9d8b8fead 100644 --- a/apps/OpenSign/src/pages/Managesign.js +++ b/apps/OpenSign/src/pages/Managesign.js @@ -189,7 +189,7 @@ const ManageSign = () => { setIsLoader(false); setIsAlert({ type: "success", - message: "Signature saved successfully." + message: t("signature-saved-alert") }); setTimeout(() => setIsAlert({}), 2000); return res; @@ -213,7 +213,7 @@ const ManageSign = () => { setIsLoader(false); setIsAlert({ type: "success", - message: "Signature saved successfully." + message: t("signature-saved-alert") }); setTimeout(() => setIsAlert({}), 2000); return res; diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js index b283e760e..4fed29604 100644 --- a/apps/OpenSign/src/pages/Opensigndrive.js +++ b/apps/OpenSign/src/pages/Opensigndrive.js @@ -80,7 +80,7 @@ function Opensigndrive() { selector: '[data-tut="reactourFirst"]', content: () => ( <TourContentWithBtn - message={`Click on the breadcrumb links to easily navigate through the folder hierarchy and view the documents within each folder.`} + message={t("tour-mssg.opensign-drive-1")} isChecked={handleDontShow} /> ), @@ -91,7 +91,7 @@ function Opensigndrive() { selector: '[data-tut="reactourSecond"]', content: () => ( <TourContentWithBtn - message={`Click the add button to create a new folder or document.`} + message={t("tour-mssg.opensign-drive-2")} isChecked={handleDontShow} /> ), @@ -102,7 +102,7 @@ function Opensigndrive() { selector: '[data-tut="reactourThird"]', content: () => ( <TourContentWithBtn - message={`Sort your documents by Date or Name using this menu.`} + message={t("tour-mssg.opensign-drive-3")} isChecked={handleDontShow} /> ), @@ -113,7 +113,7 @@ function Opensigndrive() { selector: '[data-tut="reactourForth"]', content: () => ( <TourContentWithBtn - message={`Click on this menu to display the documents in list view.`} + message={t("tour-mssg.opensign-drive-4")} isChecked={handleDontShow} /> ), @@ -140,7 +140,7 @@ function Opensigndrive() { selector: '[data-tut="reactourFifth"]', content: () => ( <TourContentWithBtn - message={`The document list is displayed according to the selected sorting option. Icons next to each document indicate its current status.`} + message={t("tour-mssg.opensign-drive-5")} isChecked={handleDontShow} /> ), @@ -151,7 +151,7 @@ function Opensigndrive() { selector: '[data-tut="reactourSixth"]', content: () => ( <TourContentWithBtn - message={`Right-click on a document to see options such as Download, Rename, Move, and Delete. Click on the document to open it.`} + message={t("tour-mssg.opensign-drive-6")} isChecked={handleDontShow} /> ), @@ -162,7 +162,7 @@ function Opensigndrive() { selector: '[data-tut="reactourSeventh"]', content: () => ( <TourContentWithBtn - message={`Right-click on any folder to see options. Choose ‘Rename’ to change the folder’s name or click on the folder to navigate through its contents.`} + message={t("tour-mssg.opensign-drive-7")} isChecked={handleDontShow} /> ), @@ -197,7 +197,7 @@ function Opensigndrive() { } catch (e) { setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); } finally { setLoading(false); @@ -321,11 +321,11 @@ function Opensigndrive() { } catch (e) { setIsAlert({ isShow: true, - alertMessage: "something went wrong!" + alertMessage: t("something-went-wrong-mssg") }); } } else { - setError("Please fill out this field"); + setError(t("fill-field")); } }; @@ -527,7 +527,7 @@ function Opensigndrive() { <Title title={"OpenSign™ Drive"} drive={true} /> <ModalUi isOpen={isAlert.isShow} - title={"Alert"} + title={t("alert")} handleClose={() => { setIsAlert({ isShow: false, @@ -548,13 +548,13 @@ function Opensigndrive() { type="button" className="op-btn op-btn-neutral op-btn-sm" > - Close + {t("close")} </button> </div> </ModalUi> <ModalUi isOpen={isFolder} - title={"Add New Folder"} + title={t("add-new-folder")} handleClose={oncloseFolder} > <div className="h-full p-[20px] pt-[10px] pb-[15px]"> @@ -568,7 +568,7 @@ function Opensigndrive() { className="flex flex-col text-base-content" > <label className="py-[8px] text-[15px] font-[400] mb-0"> - Name + {t("name")} <span className="text-[red]">*</span> </label> <input @@ -582,14 +582,14 @@ function Opensigndrive() { <div className="w-full h-[1px] bg-[#9f9f9f] my-[15px]"></div> <div className="flex flex-row"> <button type="submit" className="op-btn op-btn-primary"> - Add + {t("add")} </button> <button type="button" className="op-btn op-btn-ghost ml-1" onClick={oncloseFolder} > - Close + {t("close")} </button> </div> </form> @@ -657,21 +657,21 @@ function Opensigndrive() { className="fa-light fa-plus mr-[5px]" aria-hidden="true" ></i> - Create folder + {t("create-folder")} </span> <span className="dropdown-item text-[10px] md:text-[13px]" onClick={() => navigate("/form/sHAnZphf69")} > <i className="fa-light fa-pen-nib mr-[5px]"></i> - Sign Yourself + {t("form-name.Sign Yourself")} </span> <span className="dropdown-item text-[10px] md:text-[13px]" onClick={() => navigate("/form/8mZzFxbG1z")} > <i className="fa-light fa-file-signature mr-[5px]"></i> - Request Signatures + {t("form-name.Request Signatures")} </span> </div> </div> @@ -721,7 +721,9 @@ function Opensigndrive() { aria-hidden="true" ></i> )} - <span className="ml-[5px]">{value}</span> + <span className="ml-[5px]"> + {t(`sort-order.${value}`)} + </span> </span> ); })} @@ -746,7 +748,9 @@ function Opensigndrive() { aria-hidden="true" ></i> )} - <span className="ml-[5px]">{order}</span> + <span className="ml-[5px]"> + {t(`sort-order.${order}`)} + </span> </span> ); })} @@ -783,7 +787,7 @@ function Opensigndrive() { {pdfData && pdfData.length === 0 ? ( <div className="flex justify-center items-center w-full h-[50vh]"> <span className="text-base-content font-bold"> - No Data Found! + {t("no-data")} </span> </div> ) : ( @@ -805,7 +809,7 @@ function Opensigndrive() { sortingData={sortingData} /> {loading && ( - <div className="text-center pb-[20px]">Loading...</div> + <div className="text-center pb-[20px]">{t("loading")}</div> )} </React.Suspense> </div> diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 314e33b9f..b01db5498 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -191,7 +191,7 @@ function PdfRequestFiles(props) { const currentUser = JSON.parse(localuser); await handleSendOTP(currentUser?.email); setOtpLoader(false); - alert("OTP sent on you email"); + alert(t("otp-sent-alert")); }; //`handleVerifyEmail` function is used to verify email with otp const handleVerifyEmail = async (e) => { @@ -318,12 +318,12 @@ function PdfRequestFiles(props) { (documentData.result && documentData.result.error) ) { console.log("err in get template details "); - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading({ isLoad: false }); } else { - setHandleError("No Data Found!"); + setHandleError(t("no-data")); setIsLoading({ isLoad: false }); @@ -331,9 +331,9 @@ function PdfRequestFiles(props) { } catch (err) { console.log("err in get template details ", err); if (err?.response?.data?.code === 101) { - setHandleError("Error: Template not found!"); + setHandleError(t("error-template")); } else { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } } }; @@ -408,8 +408,7 @@ function PdfRequestFiles(props) { }, 5000); setIsCompleted({ isModal: true, - message: - "You have successfully signed the document. You can download or print a copy of the partially signed document. A copy of the digitally signed document will be sent to the owner over email once it is signed by all signers." + message: t("document-signed-alert-1") }); } else { if (currUserId) { @@ -561,7 +560,7 @@ function PdfRequestFiles(props) { const currentUserEmail = currentUser.email; const res = await contractUsers(currentUserEmail); if (res === "Error: Something went wrong!") { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } else if (res[0] && res?.length) { setContractName("_Users"); currUserId = res[0].objectId; @@ -577,7 +576,7 @@ function PdfRequestFiles(props) { } else if (res?.length === 0) { const res = await contactBook(currUserId); if (res === "Error: Something went wrong!") { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } else if (res[0] && res.length) { setContractName("_Contactbook"); const objectId = res[0].objectId; @@ -591,7 +590,7 @@ function PdfRequestFiles(props) { setRequestSignTour(checkTourRequest[0]?.requestSign || false); } } else if (res.length === 0) { - setHandleError("Error: User does not exist!"); + setHandleError(t("user-not-exist")); } } } @@ -600,13 +599,13 @@ function PdfRequestFiles(props) { documentData === "Error: Something went wrong!" || (documentData.result && documentData.result.error) ) { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading({ isLoad: false }); console.log("err in getDocument cloud function "); } else { - setHandleError("No Data Found!"); + setHandleError(t("no-data")); setIsUiLoading({ isLoad: false }); @@ -642,7 +641,7 @@ function PdfRequestFiles(props) { }) .catch((err) => { console.log("Err in contracts_Signature class", err); - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading({ isLoad: false }); @@ -832,7 +831,7 @@ function PdfRequestFiles(props) { //convert document url in array buffer format to use embed widgets in pdf using pdf-lib const arrayBuffer = await convertPdfArrayBuffer(url); if (arrayBuffer === "Error") { - setHandleError("Error: invalid document!"); + setHandleError(t("invalid-document")); } else { pdfArrBuffer = arrayBuffer; } @@ -840,9 +839,9 @@ function PdfRequestFiles(props) { documentData === "Error: Something went wrong!" || (documentData.result && documentData.result.error) ) { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } else { - setHandleError("Document not Found!"); + setHandleError(t("document-not-found")); } // Load a PDFDocument from the existing PDF bytes @@ -875,7 +874,7 @@ function PdfRequestFiles(props) { const res = await contractUsers(currentUserEmail); let activeMailAdapter = ""; if (res === "Error: Something went wrong!") { - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); setIsLoading({ isLoad: false }); @@ -1040,13 +1039,13 @@ function PdfRequestFiles(props) { } else { setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); } } catch (err) { setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); } } catch (err) { @@ -1054,7 +1053,7 @@ function PdfRequestFiles(props) { if (err && err.message.includes("is encrypted.")) { setIsAlert({ isShow: true, - alertMessage: `Currently encrypted pdf files are not supported.` + alertMessage: t("encrypted-pdf-not-support") }); } else { console.log("err in request signing", err); @@ -1069,7 +1068,7 @@ function PdfRequestFiles(props) { } else { setIsAlert({ isShow: true, - alertMessage: "something went wrong" + alertMessage: t("something-went-wrong-mssg") }); } } catch (err) { @@ -1077,7 +1076,7 @@ function PdfRequestFiles(props) { setIsUiLoading(false); setIsAlert({ isShow: true, - alertMessage: "something went wrong, please try again later." + alertMessage: t("something-went-wrong-mssg") }); } } else { @@ -1093,7 +1092,7 @@ function PdfRequestFiles(props) { } } catch (e) { console.log("error in save user's emailVerified in user class"); - setHandleError("Error: Something went wrong!"); + setHandleError(t("something-went-wrong-mssg")); } } } @@ -1381,7 +1380,7 @@ function PdfRequestFiles(props) { selector: '[data-tut="reactourFirst"]', content: () => ( <TourContentWithBtn - message={`List of signers who still need to sign the document .`} + message={t("tour-mssg.pdf-request-file-1")} isChecked={handleDontShow} /> ), @@ -1392,7 +1391,7 @@ function PdfRequestFiles(props) { selector: '[data-tut="pdfArea"]', content: () => ( <TourContentWithBtn - message={`Click any of the placeholders appearing on the document to sign. You will then see options to draw your signature, type it, or upload an image .`} + message={t("tour-mssg.pdf-request-file-2")} isChecked={handleDontShow} /> ), @@ -1403,7 +1402,7 @@ function PdfRequestFiles(props) { selector: '[data-tut="reactourFifth"]', content: () => ( <TourContentWithBtn - message={`Click the Back, Decline, or Finish buttons to navigate your document. Use the ellipsis menu for additional options, including the Download button .`} + message={t("tour-mssg.pdf-request-file-3")} isChecked={handleDontShow} /> ), @@ -1415,7 +1414,7 @@ function PdfRequestFiles(props) { selector: '[data-tut="reactourSecond"]', content: () => ( <TourContentWithBtn - message={`List of signers who have already signed the document .`} + message={t("tour-mssg.pdf-request-file-4")} isChecked={handleDontShow} /> ), @@ -1433,7 +1432,7 @@ function PdfRequestFiles(props) { selector: '[data-tut="reactourThird"]', content: () => ( <TourContentWithBtn - message={`You can click "Auto Sign All" to automatically sign at all the locations meant to be signed by you. Make sure that you review the document properly before you click this button .`} + message={t("tour-mssg.pdf-request-file-5")} isChecked={handleDontShow} /> ), @@ -1493,7 +1492,7 @@ function PdfRequestFiles(props) { await SendOtp(); } else { console.log("error in public-sign to create user details"); - alert("something went wrong"); + alert(t("something-went-wrong-mssg")); } } catch (e) { console.log("e", e); @@ -1526,7 +1525,7 @@ function PdfRequestFiles(props) { } } catch (error) { console.log("error in verify otp in public-sign", error); - alert("something went wrong!"); + alert(t("something-went-wrong-mssg")); } }; @@ -1552,10 +1551,10 @@ function PdfRequestFiles(props) { }; let user = await axios.post(url, body, { headers: headers }); if (user.data.result === "Invalid Otp") { - alert("Invalid Otp"); + alert(t("invalid-otp")); setLoading(false); } else if (user.data.result === "user not found!") { - alert("User not found!"); + alert(t("user-not-found")); setLoading(false); } else { let _user = user.data.result; @@ -1590,7 +1589,7 @@ function PdfRequestFiles(props) { console.log("err ", error); } } else { - alert("Please Enter OTP!"); + alert(t("enter-otp-alert")); } }; const handleCloseOtp = () => { @@ -1863,7 +1862,7 @@ function PdfRequestFiles(props) { </ModalUi> <ModalUi isOpen={defaultSignAlert.isShow} - title={"Auto sign"} + title={t("auto-sign-all")} handleClose={() => setDefaultSignAlert({ isShow: false, alertMessage: "" }) } @@ -1878,7 +1877,7 @@ function PdfRequestFiles(props) { type="button" className="op-btn op-btn-primary" > - Yes + {t("yes")} </button> <button onClick={() => @@ -1890,7 +1889,7 @@ function PdfRequestFiles(props) { type="button" className="op-btn op-btn-secondary" > - Close + {t("close")} </button> </> ) : ( @@ -1901,7 +1900,7 @@ function PdfRequestFiles(props) { type="button" className="op-btn op-btn-primary" > - Ok + {t("ok")} </button> )} </div> @@ -1933,7 +1932,7 @@ function PdfRequestFiles(props) { {/* this modal is used show this document is already sign */} <ModalUi isOpen={isCompleted.isModal} - title={"Document signed"} + title={t("document-signed")} handleClose={() => { setIsCompleted((prev) => ({ ...prev, isModal: false })); }} @@ -1947,10 +1946,7 @@ function PdfRequestFiles(props) { <p>{isCompleted?.message}</p> ) : ( <div className="px-[15px]"> - <span> - Congratulations! 🎉 This document has been - successfully signed by all participants! - </span> + <span>{t("document-signed-alert-4")}</span> </div> )} {!isCompleted?.message && ( @@ -1966,7 +1962,9 @@ function PdfRequestFiles(props) { className="fa-light fa-print" aria-hidden="true" ></i> - <span className="hidden lg:block">Print</span> + <span className="hidden lg:block"> + {t("print")} + </span> </button> <button type="button" @@ -1983,7 +1981,7 @@ function PdfRequestFiles(props) { aria-hidden="true" ></i> <span className="hidden lg:block"> - Certificate + {t("certificate")} </span> </button> <button @@ -2001,7 +1999,9 @@ function PdfRequestFiles(props) { className="fa-light fa-download" aria-hidden="true" ></i> - <span className="hidden lg:block">Download</span> + <span className="hidden lg:block"> + {t("download")} + </span> </button> </div> )} @@ -2016,18 +2016,14 @@ function PdfRequestFiles(props) { isOpen={isDownloading === "certificate"} title={ isDownloading === "certificate" - ? "Generating certificate" - : "PDF Download" + ? t("generating-certificate") + : t("pdf-download") } handleClose={() => setIsDownloading("")} > <div className="p-3 md:p-5 text-[13px] md:text-base text-center text-base-content"> {isDownloading === "certificate"}{" "} - <p> - Your completion certificate is being generated. Please - wait momentarily. If the download doesn't start - shortly, click the button again. - </p> + <p>{t("generate-certificate-alert")}</p> </div> </ModalUi> {/* this component is used for signature pad modal */} @@ -2133,7 +2129,7 @@ function PdfRequestFiles(props) { data-tut="reactourSecond" className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300" > - <span> Signed by</span> + <span>{t("signed-by")}</span> </div> <div className="mt-[2px]"> {signedSigners.map((obj, ind) => { @@ -2158,7 +2154,7 @@ function PdfRequestFiles(props) { data-tut="reactourFirst" className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300" > - <span>Yet to sign</span> + <span>{t("yet-to-sign")}</span> </div> <div className="mt-[5px]"> {unsignedSigners.map((obj, ind) => { @@ -2193,23 +2189,20 @@ function PdfRequestFiles(props) { )} <ModalUi isOpen={validateAlert} - title={"Validation alert"} + title={t("validation-alert")} handleClose={() => { setValidateAlert(false); }} > <div className="h-[100%] p-[20px]"> - <p> - The input does not meet the criteria set by the regular - expression. - </p> + <p>{t("validation-alert-1")}</p> <div className="h-[1px] bg-[#9f9f9f] w-full my-[15px]"></div> <button onClick={() => setValidateAlert(false)} type="button" className="op-btn op-btn-ghost" > - Close + {t("close")} </button> </div> </ModalUi> diff --git a/apps/OpenSign/src/pages/Pgsignup.js b/apps/OpenSign/src/pages/Pgsignup.js index 7e5c97637..95474b18f 100644 --- a/apps/OpenSign/src/pages/Pgsignup.js +++ b/apps/OpenSign/src/pages/Pgsignup.js @@ -8,8 +8,10 @@ import { appInfo } from "../constant/appinfo"; import { showTenant } from "../redux/reducers/ShowTenant"; import { fetchAppInfo } from "../redux/reducers/infoReducer"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const PgSignUp = () => { + const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -168,11 +170,11 @@ const PgSignUp = () => { } catch (error) { console.log("err ", error); if (error.message === "Account already exists for this username.") { - alert("Account already exists!"); + alert(t("account-already-exists")); navigate("/", { replace: true }); } else { setIsLoader(false); - alert("Something went wrong, please try again later!"); + alert(t("something-went-wrong-mssg")); } } }; @@ -262,7 +264,7 @@ const PgSignUp = () => { localStorage.setItem("defaultmenuid", menu.menuId); localStorage.setItem("pageType", menu.pageType); setIsLoader(false); - alert("Registered user successfully"); + alert(t("registered-user-successfully")); const redirectUrl = location?.state?.from || `/${menu.pageType}/${menu.pageId}`; // Redirect to the appropriate URL after successful login @@ -294,15 +296,15 @@ const PgSignUp = () => { > <div className="p-[16px]"> <h1 className="text-2xl md:text-3xl font-bold"> - Choose Password + {t("choose-password")} </h1> <hr className="border-[1px] border-[#cecece] mb-[5px]" /> <label htmlFor="password"> - <b className="text-[13px]">Password</b> + <b className="text-[13px]">{t("password")}</b> </label> <input type="password" - placeholder="Enter Password" + placeholder={t("enter-password")} name="password" className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={formData.password} @@ -310,11 +312,11 @@ const PgSignUp = () => { required /> <label htmlFor="confirmPassword"> - <b className="text-[13px]">Confirm Password</b> + <b className="text-[13px]">{t("confirm-password")}</b> </label> <input type="password" - placeholder="Confirm Password" + placeholder={t("confirm-password")} name="confirmPassword" className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" style={{ @@ -344,24 +346,21 @@ const PgSignUp = () => { lengthValid ? "text-green-600" : "text-red-600" }`} > - {lengthValid ? "✓" : "✗"} Password should be 8 characters - long + {lengthValid ? "✓" : "✗"} {t("password-length")} </p> <p className={`${ caseDigitValid ? "text-green-600" : "text-red-600" }`} > - {caseDigitValid ? "✓" : "✗"} Password should contain - uppercase letter, lowercase letter, digit + {caseDigitValid ? "✓" : "✗"} {t("password-case")} </p> <p className={`${ specialCharValid ? "text-green-600" : "text-red-600" }`} > - {specialCharValid ? "✓" : "✗"} Password should contain - special character + {specialCharValid ? "✓" : "✗"} {t("password-special-char")} </p> </div> )} @@ -369,7 +368,7 @@ const PgSignUp = () => { type="submit" className="op-btn op-btn-primary w-full mt-[8px]" > - Submit + {t("submit")} </button> </div> </form> diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index a7a352a3e..e2c186950 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -192,7 +192,7 @@ function PlaceHolderSign() { try { const tenantDetails = await getTenantDetails(user?.objectId); if (tenantDetails && tenantDetails === "user does not exist!") { - alert("User does not exist"); + alert(t("user-not-exist")); } else if (tenantDetails) { const defaultRequestBody = `<p>Hi {{receiver_name}},</p><br><p>We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.</p><p>Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.</p><br><p>{{signing_url}}</p><br><p>If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.</p><br><p>Thanks</p><p> Team OpenSign™</p><br>`; if (tenantDetails?.RequestBody) { @@ -215,10 +215,10 @@ function PlaceHolderSign() { } } } catch (e) { - alert("User does not exist"); + alert(t("user-not-exist")); } } else { - alert("User does not exist"); + alert(t("user-not-exist")); } }; @@ -297,32 +297,29 @@ function PlaceHolderSign() { // If document is completed setIsAlreadyPlace({ status: true, - message: "This document has been signed by all Signers." + message: t("document-signed-alert-5") }); } else if (declined) { // If document has been declined setIsAlreadyPlace({ status: true, - message: - "This document has been declined by one or more recipient(s)." + message: t("document-signed-alert-6") }); } else if (currDate > expireUpdateDate) { // If document has expired setIsAlreadyPlace({ status: true, - message: "This Document is no longer available." + message: t("document-signed-alert-7") }); } else { // If document is dispatched for signing setIsAlreadyPlace({ status: true, - message: "The document has already been dispatched for signing." + message: t("document-signed-alert-8") }); } } - setPdfDetails(documentData); - if (documentData[0].Signers && documentData[0].Signers.length > 0) { const currEmail = documentData[0].ExtUserPtr.Email; setCurrentId(currEmail); @@ -914,20 +911,18 @@ function PlaceHolderSign() { } if (!signatureExist) { isSignatureExist = false; - const alert = { - mssg: "sure", + setIsSendAlert({ + mssg: t("sure"), alert: true - }; - setIsSendAlert(alert); + }); } } if (getPrefill && isLabel) { - const alert = { + setIsSendAlert({ mssg: textWidget, alert: true - }; - setIsSendAlert(alert); + }); } else if (isSignatureExist) { if (filterPrefill.length === signersdata.length) { const IsSignerNotExist = filterPrefill?.filter((x) => !x.signerObjId); @@ -940,11 +935,10 @@ function PlaceHolderSign() { saveDocumentDetails(); } } else { - const alert = { - mssg: "sure", + setIsSendAlert({ + mssg: t("sure"), alert: true - }; - setIsSendAlert(alert); + }); } } }; @@ -1028,11 +1022,11 @@ function PlaceHolderSign() { }) .catch((err) => { console.log("axois err ", err); - alert("something went wrong"); + alert(t("something-went-wrong-mssg")); }); } catch (e) { console.log("error", e); - alert("something went wrong"); + alert(t("something-went-wrong-mssg")); } }; @@ -1266,7 +1260,7 @@ function PlaceHolderSign() { selector: '[data-tut="recipientArea"]', content: () => ( <TourContentWithBtn - message={`Select a recipient from this list to add a place-holder where he is supposed to sign.The placeholder will appear in the same colour as the recipient name once you drop it on the document.`} + message={t("tour-mssg.placeholder-sign-1")} isChecked={handleDontShow} /> ), @@ -1277,7 +1271,7 @@ function PlaceHolderSign() { selector: '[data-tut="addRecipient"]', content: () => ( <TourContentWithBtn - message={`Clicking "Add recipients" button will allow you to add more signers.`} + message={t("tour-mssg.placeholder-sign-3")} isChecked={handleDontShow} /> ), @@ -1288,7 +1282,7 @@ function PlaceHolderSign() { selector: '[data-tut="addWidgets"]', content: () => ( <TourContentWithBtn - message={`Drag or click on a field to add it to the document.`} + message={t("tour-mssg.placeholder-sign-3")} isChecked={handleDontShow} /> ), @@ -1299,7 +1293,7 @@ function PlaceHolderSign() { selector: '[data-tut="pdfArea"]', content: () => ( <TourContentWithBtn - message={`The PDF content area already displays the template's existing placeholders. For your convenience, these placeholders will match the color of the recipient's name, making them easily identifiable.`} + message={t("tour-mssg.placeholder-sign-4")} isChecked={handleDontShow} /> ), @@ -1311,7 +1305,7 @@ function PlaceHolderSign() { selector: '[data-tut="headerArea"]', content: () => ( <TourContentWithBtn - message={`Clicking "Send" will save the document. In the next step you can customize the emails to be sent out to the recipients or copy the signing links and share those with the recipients yourself.`} + message={t("tour-mssg.placeholder-sign-5")} isChecked={handleDontShow} /> ), diff --git a/apps/OpenSign/src/pages/PlanSubscriptions.js b/apps/OpenSign/src/pages/PlanSubscriptions.js index eaaeaa08e..1987048f4 100644 --- a/apps/OpenSign/src/pages/PlanSubscriptions.js +++ b/apps/OpenSign/src/pages/PlanSubscriptions.js @@ -6,6 +6,7 @@ import Title from "../components/Title"; import Parse from "parse"; import { openInNewTab } from "../constant/Utils"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const listItemStyle = { paddingLeft: "20px", // Add padding to create space for the image backgroundImage: `url(${checkmark})`, // Set your image as the list style image @@ -15,6 +16,7 @@ const listItemStyle = { }; const PlanSubscriptions = () => { + const { t } = useTranslation(); const navigate = useNavigate(); const [yearlyVisible, setYearlyVisible] = useState(true); const [isLoader, setIsLoader] = useState(true); @@ -76,7 +78,7 @@ const PlanSubscriptions = () => { const res = await Parse.Cloud.run("freesubscription", params); if (res.status === "success" && res.result === "already subscribed!") { setIsLoader(false); - alert("You have already subscribed to plan!"); + alert(t("subscribed-alert")); } else if (res.status === "success") { setIsLoader(false); navigate("/"); @@ -87,7 +89,7 @@ const PlanSubscriptions = () => { } catch (err) { setIsLoader(false); console.log("err in free subscribe", err.message); - alert("Somenthing went wrong, please try again later!"); + alert(t("something-went-wrong-mssg")); } } }; @@ -111,14 +113,14 @@ const PlanSubscriptions = () => { role="tab" className={`${!yearlyVisible ? "op-tab-active" : ""} op-tab`} > - Monthly + {t("monthly")} </a> <a onClick={() => setYearlyVisible(true)} role="tab" className={`${yearlyVisible ? "op-tab-active" : ""} op-tab`} > - Yearly (upto 66% off) + {t("yearly-upto")} </a> </div> <ul className="op-card flex flex-col md:flex-row h-full bg-base-100 justify-center shadow-lg"> @@ -170,7 +172,9 @@ const PlanSubscriptions = () => { )} </span> <p className="font-semibold pt-2 text-sm"> - {yearlyVisible ? "Billed Yearly" : "Billed Monthly"} + {yearlyVisible + ? t("billed-yearly") + : t("billed-monthly")} </p> <div className="max-w-[250px] h-[40px] text-center text-sm my-2"> <div @@ -228,7 +232,7 @@ const PlanSubscriptions = () => { </div> <div className="flex flex-col justify-center items-center"> <h3 className="text-[#002862] mt-1 mb-2"> - Host it yourself for free + {t("plansubscription-1")} </h3> <div className="op-btn op-btn-primary w-[200px]" @@ -236,7 +240,7 @@ const PlanSubscriptions = () => { openInNewTab("https://github.com/OpenSignLabs/OpenSign") } > - Visit Github + {t("visit-github")} </div> </div> </div> diff --git a/apps/OpenSign/src/pages/Report.js b/apps/OpenSign/src/pages/Report.js index 7afba1711..c6a8451d0 100644 --- a/apps/OpenSign/src/pages/Report.js +++ b/apps/OpenSign/src/pages/Report.js @@ -8,8 +8,10 @@ import Title from "../components/Title"; import PageNotFound from "./PageNotFound"; import TourContentWithBtn from "../primitives/TourContentWithBtn"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const Report = () => { + const { t } = useTranslation(); const { id } = useParams(); const [List, setList] = useState([]); const [isLoader, setIsLoader] = useState(true); @@ -83,9 +85,7 @@ const Report = () => { selector: "[data-tut=reactourFirst]", content: () => ( <TourContentWithBtn - message={ - "Click the 'Add' button to create a new template. Templates are reusable documents designed to quickly generate new documents with the same structure and varying signers. For example, an HR template for onboarding could have predefined roles like ‘HR Manager’ and ‘New Employee’. Each time you use the template, you can assign the ‘New Employee’ role to different incoming staff members, while the ‘HR Manager’ role remains constant, facilitating a seamless onboarding process for each recruit. " - } + message={t("tour-mssg.report-1")} isChecked={handleDontShow} /> ), diff --git a/apps/OpenSign/src/pages/SSOVerify.js b/apps/OpenSign/src/pages/SSOVerify.js index b2ab6701d..469164fef 100644 --- a/apps/OpenSign/src/pages/SSOVerify.js +++ b/apps/OpenSign/src/pages/SSOVerify.js @@ -8,8 +8,10 @@ import { useDispatch } from "react-redux"; import { showTenant } from "../redux/reducers/ShowTenant"; import ModalUi from "../primitives/ModalUi"; import Loader from "../primitives/Loader"; +import { useTranslation } from "react-i18next"; const SSOVerify = () => { + const { t } = useTranslation(); const location = useLocation(); const navigate = useNavigate(); const dispatch = useDispatch(); @@ -120,16 +122,16 @@ const SSOVerify = () => { } catch (err) { console.log("error in usersignup", err); localStorage.removeItem("accesstoken"); - alert("Something went wrong."); + alert(t("something-went-wrong-mssg")); setIsLoader(false); } } else { localStorage.removeItem("accesstoken"); - alert("Internal server error."); + alert(t("server-error")); setIsLoader(false); } } else { - alert("Please fill required details correctly."); + alert(t("filed-required-correctly")); setIsLoader(false); } }; @@ -207,19 +209,15 @@ const SSOVerify = () => { } } } else { - alert( - "Error: You don't have access, please contact the admin." - ); - setMessage( - "Error: You don't have access, please contact the admin." - ); + alert(t("do-not-access-contact-admin")); + setMessage(t("do-not-access-contact-admin")); } } }) .catch((error) => { console.error("Err in fetch extuser", error); - alert("user not exist."); - setMessage("Error: User not exist."); + alert(t("user-not-exist")); + setMessage(t("user-not-exist")); }); } catch (err) { console.log("err in getuserdetails", err); @@ -265,7 +263,7 @@ const SSOVerify = () => { > <div className="mb-3"> <label htmlFor="Company" className="block text-xs font-semibold"> - Phone <span className="text-[13px] text-[red]">*</span> + {t("phone")} <span className="text-[13px] text-[red]">*</span> </label> <input type="tel" @@ -287,7 +285,7 @@ const SSOVerify = () => { </div> <div className="mb-3"> <label htmlFor="Company" className="block text-xs font-semibold"> - Company <span className="text-[13px] text-[red]">*</span> + {t("company")} <span className="text-[13px] text-[red]">*</span> </label> <input type="text" @@ -306,7 +304,7 @@ const SSOVerify = () => { </div> <div className="mb-3"> <label htmlFor="JobTitle" className="block text-xs font-semibold"> - Job Title + {t("job-title")} <span className="text-[13px] text-[red]">*</span> </label> <input @@ -326,14 +324,14 @@ const SSOVerify = () => { </div> <div className="mt-4"> <button type="submit" className="op-btn op-btn-primary"> - Login + {t("login")} </button> <button type="button" className="op-btn op-btn-ghost ml-2" onClick={handleCloseModal} > - Cancel + {t("cancel")} </button> </div> </form> diff --git a/apps/OpenSign/src/pages/Signup.js b/apps/OpenSign/src/pages/Signup.js index 0b0a97fc2..303485c72 100644 --- a/apps/OpenSign/src/pages/Signup.js +++ b/apps/OpenSign/src/pages/Signup.js @@ -71,7 +71,7 @@ const Signup = () => { } } catch (err) { console.log("err in free subscribe", err.message); - alert("Somenthing went wrong, please try again later!"); + alert(t("something-went-wrong-mssg")); } }; const handleSubmit = (event) => { @@ -138,7 +138,7 @@ const Signup = () => { const res = await Parse.Cloud.run("getUserDetails", params); // console.log("Res ", res); if (res) { - alert("User already exists with this username!"); + alert(t("user-already-exist-name")); setState({ loading: false }); } else { // console.log("state.email ", email); @@ -146,9 +146,7 @@ const Signup = () => { await Parse.User.requestPasswordReset(email).then( async function (res1) { if (res1.data === undefined) { - alert( - "Verification mail has been sent to your E-mail!" - ); + alert(t("verification-code-sent")); } } ); @@ -235,14 +233,14 @@ const Signup = () => { navigate(`/subscription`, { replace: true }); } } else { - alert("Registered user successfully"); + alert(t("registered-user-successfully")); navigate(`/${menu.pageType}/${menu.pageId}`); } } else { setState({ loading: false, alertType: "danger", - alertMsg: "Role not found." + alertMsg: t("role-not-found") }); setTimeout(() => { setState({ loading: false, alertMsg: "" }); @@ -252,7 +250,7 @@ const Signup = () => { setState({ loading: false, alertType: "danger", - alertMsg: "You don't have access, please contact the admin." + alertMsg: t("do-not-access-contact-admin") }); setTimeout(() => { setState({ loading: false, alertMsg: "" }); @@ -265,7 +263,7 @@ const Signup = () => { setState({ loading: false, alertType: "danger", - alertMsg: "You don't have access, please contact the admin." + alertMsg: t("do-not-access-contact-admin") }); setTimeout(() => { setState({ loading: false, alertMsg: "" }); diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index c58708e85..e923f46bc 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -997,7 +997,7 @@ function SignYourSelf() { selector: '[data-tut="addWidgets"]', content: () => ( <TourContentWithBtn - message={`Select and drag your preferred widgets onto the PDF to customize your document before signing. Choose the perfect spots for each modification to tailor the document to your needs.`} + message={t("tour-mssg.signyour-self-2")} isChecked={handleDontShow} /> ), @@ -1008,7 +1008,7 @@ function SignYourSelf() { selector: '[data-tut="reactourSecond"]', content: () => ( <TourContentWithBtn - message={`Drag and drop anywhere in this area. You can resize and move it later.`} + message={t("tour-mssg.signyour-self-2")} isChecked={handleDontShow} /> ), diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js index 85500123e..44972863d 100644 --- a/apps/OpenSign/src/pages/TemplatePlaceholder.js +++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js @@ -778,7 +778,7 @@ const TemplatePlaceholder = () => { setIsLoading(loadObj); } catch (e) { setIsLoading(false); - alert("Something went wrong, please try again later."); + alert(t("something-went-wrong-mssg")); console.log("error", e); } } else { @@ -796,7 +796,7 @@ const TemplatePlaceholder = () => { selector: '[data-tut="reactourAddbtn"]', content: () => ( <TourContentWithBtn - message={`Clicking "Add role" button will allow you to add various signer roles. You can attach users to each role in subsequent steps.`} + message={t("tour-mssg.template-placeholder-1")} isChecked={handleDontShow} /> ), @@ -808,7 +808,7 @@ const TemplatePlaceholder = () => { selector: '[data-tut="reactourFirst"]', content: () => ( <TourContentWithBtn - message={`Once roles are added, select a role from list to add a place-holder where he is supposed to sign. The placeholder will appear in the same colour as the role name once you drop it on the document.`} + message={t("tour-mssg.template-placeholder-2")} isChecked={handleDontShow} /> ), @@ -820,7 +820,7 @@ const TemplatePlaceholder = () => { selector: '[data-tut="addWidgets"]', content: () => ( <TourContentWithBtn - message={`Drag or click on a field to add it to the document.`} + message={t("tour-mssg.template-placeholder-3")} isChecked={handleDontShow} /> ), @@ -831,7 +831,7 @@ const TemplatePlaceholder = () => { selector: '[data-tut="reactourThird"]', content: () => ( <TourContentWithBtn - message={`Drag the placeholder for a role anywhere on the document.Remember, it will appear in the same colour as the name of the recipient for easy reference.`} + message={t("tour-mssg.template-placeholder-4")} isChecked={handleDontShow} /> ), @@ -842,7 +842,7 @@ const TemplatePlaceholder = () => { selector: '[data-tut="headerArea"]', content: () => ( <TourContentWithBtn - message={`Clicking ‘Next’ will store the current template. After saving, you’ll be prompted to create a new document from this template if you wish.`} + message={t("tour-mssg.template-placeholder-5")} isChecked={handleDontShow} /> ), diff --git a/apps/OpenSign/src/pages/UpdateExistUserAdmin.js b/apps/OpenSign/src/pages/UpdateExistUserAdmin.js index bd4338878..e71dcb530 100644 --- a/apps/OpenSign/src/pages/UpdateExistUserAdmin.js +++ b/apps/OpenSign/src/pages/UpdateExistUserAdmin.js @@ -4,8 +4,9 @@ import Parse from "parse"; import { NavLink, useNavigate } from "react-router-dom"; import Alert from "../primitives/Alert"; import Title from "../components/Title"; - +import { useTranslation } from "react-i18next"; const UpdateExistUserAdmin = () => { + const { t } = useTranslation(); const navigate = useNavigate(); const [formdata, setFormdata] = useState({ email: "", masterkey: "" }); const [loader, setLoader] = useState(true); @@ -41,19 +42,19 @@ const UpdateExistUserAdmin = () => { ); // console.log("updateUserAsAdmin ", updateUserAsAdmin); if (updateUserAsAdmin === "admin_created") { - setIsAlert({ type: "success", msg: "Admin created" }); + setIsAlert({ type: "success", msg: t("admin-created") }); navigate("/"); } } catch (err) { console.log("err in updateuserasadmin", err.code); if (err.code === 404) { - setIsAlert((prev) => ({ ...prev, msg: "Invalid masterkey" })); + setIsAlert((prev) => ({ ...prev, msg: t("invalid-masterkey") })); } else if (err.code === 101) { - setIsAlert((prev) => ({ ...prev, msg: "User not found" })); + setIsAlert((prev) => ({ ...prev, msg: t("user-not-found") })); } else if (err.code === 137) { - setIsAlert((prev) => ({ ...prev, msg: "Admin already exist" })); + setIsAlert((prev) => ({ ...prev, msg: t("admin-already-exist") })); } else { - setErrMsg("Something went wrong."); + setErrMsg(t("something-went-wrong-mssg")); } } finally { setIsSubmitLoading(false); @@ -64,7 +65,7 @@ const UpdateExistUserAdmin = () => { }; return ( <div className="h-screen flex justify-center"> - <Title title={"Add Admin"} /> + <Title title={t("add-admin")} /> {isAlert.msg && ( <Alert type={isAlert.type}> <div className="ml-3">{isAlert.msg}</div> @@ -90,7 +91,7 @@ const UpdateExistUserAdmin = () => { </div> )} <h2 className="text-[30px] text-center mt-3 font-medium"> - Opensign Setup + {t("opensign-Setup")} </h2> <NavLink to="https://discord.com/invite/xe9TDuyAyj" @@ -98,7 +99,7 @@ const UpdateExistUserAdmin = () => { rel="noopener noreferrer" className="text-center text-sm mt-1 text-[blue] cursor-pointer" > - Join our discord server + {t("join-discord")} <i aria-hidden="true" className="fa-brands fa-discord ml-1" @@ -107,7 +108,8 @@ const UpdateExistUserAdmin = () => { </NavLink> <div className="px-6 py-3 text-xs"> <label> - Email <span className="text-[red] text-[13px]">*</span> + {t("email")}{" "} + <span className="text-[red] text-[13px]">*</span> </label> <input id="email" @@ -124,7 +126,7 @@ const UpdateExistUserAdmin = () => { /> <hr className="my-2 border-none" /> <label> - Master key{" "} + {t("master-key")}{" "} <span className="text-[red] text-[13px]">*</span> </label> <input @@ -163,7 +165,7 @@ const UpdateExistUserAdmin = () => { className="op-btn op-btn-primary w-full" disabled={loader} > - {loader ? "Loading..." : "Next"} + {loader ? t("loading") : t("next")} </button> </div> </div> diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index 8accaa439..4e69dbb56 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -94,7 +94,7 @@ function UserProfile() { setIsLoader(false); } } catch (e) { - alert("something went wrong!"); + alert(t("something-went-wrong-mssg")); } } }; @@ -148,14 +148,14 @@ function UserProfile() { Name: res.name, Phone: res?.phone || "" }); - alert("Profile updated successfully."); + alert(t("profile-update-alert")); setEditMode(false); setIsLoader(false); //navigate("/dashboard/35KBoSgoAK"); } }, (error) => { - alert("Something went wrong."); + alert(t("something-went-wrong-mssg")); console.error("Error while updating tour", error); setIsLoader(false); } @@ -290,7 +290,7 @@ function UserProfile() { setOtpLoader(true); await handleSendOTP(); setOtpLoader(false); - alert("OTP sent on you email"); + alert(t("otp-sent-alert")); }; //function to handle onchange username and restrict 6-characters username for free users const handleOnchangeUserName = (e) => { diff --git a/apps/OpenSign/src/pages/Webhook.js b/apps/OpenSign/src/pages/Webhook.js index b9dc45c3f..a9bff7f54 100644 --- a/apps/OpenSign/src/pages/Webhook.js +++ b/apps/OpenSign/src/pages/Webhook.js @@ -11,12 +11,7 @@ import Loader from "../primitives/Loader"; import SubscribeCard from "../primitives/SubscribeCard"; import Tour from "reactour"; import { useTranslation } from "react-i18next"; -const tourSteps = [ - { - selector: '[data-tut="webhooksubscribe"]', - content: "Upgrade now to set webhook" - } -]; + function Webhook() { const { t } = useTranslation(); const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); @@ -32,7 +27,12 @@ function Webhook() { fetchWebhook(); // eslint-disable-next-line }, []); - + const tourSteps = [ + { + selector: '[data-tut="webhooksubscribe"]', + content: t("tour-mssg.webhook-1") + } + ]; const fetchWebhook = async () => { const email = Parse.User.current().getEmail(); if (isEnableSubscription) { From dfcb4fe286fa6bcb83042f81a09ee2e1245a8320 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Thu, 1 Aug 2024 21:05:00 +0530 Subject: [PATCH 06/28] refactor-code --- .../public/locales/en/translation.json | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 0beaea5a5..e11e46cc4 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -425,7 +425,7 @@ "generating-certificate":"Generating certificate", "pdf-download":"PDF Download", "generate-certificate-alert" :" Your completion certificate is being generated. Please wait momentarily. If the download doesn't start shortly, click the button again.", - "folder-already-exist" :"Folder already exist!" , + "folder-already-exist" :"Folder already exist!" , "folder-created-successfully":"Folder created successfully!", "fill-folder-name" :"Please fill folder name" , "already-exists-this-username" :"User already exists with this username!", @@ -440,55 +440,55 @@ "password-update-alert-1":"Password updated successfully.", "password-update-alert-2":"Your current password is missing or incorrect.", "password-update-alert-3" :"Your current password is missing or incorrect.", - "password-update-alert-4" :"Your password and confirmation password do not match.", - "current-password":" Current Password" , + "password-update-alert-4" :"Your password and confirmation password do not match.", + "current-password":"Current Password" , "new-password":"New Password", "confirm-password":"Confirm Password", - "file-alert-1" :"The selected file size is too large. Please select a file less than", + "file-alert-1":"The selected file size is too large. Please select a file less than", "file-alert-2" :"Please select file.", - "file-alert-3" :"Please wait while the document is being uploaded.", + "file-alert-3":"Please wait while the document is being uploaded.", "enter-pdf-password" :"Enter Pdf Password", - "correct-password" :"Please provide correct password", - "decrypting-pdf" :" Decrypting pdf please wait...", + "correct-password" :"Please provide correct password", + "decrypting-pdf":" Decrypting pdf please wait...", "invalid-otp":"Invalid Otp", "user-not-found":"User not found!", - "enter-otp-alert" :"Please Enter OTP!", + "enter-otp-alert" :"Please Enter OTP!", "get-verification-code":"Get verification code", "get-verification-code-2" :"You will get a verification code via Email", "enter-verification-code":"Enter Verification Code", - "provide-your-details" :"Provide your details", + "provide-your-details":"Provide your details", "provide-email":"Please provide email.", - "additional-info" :"Additional Info", + "additional-info" :"Additional Info", "signature-saved-alert":"Signature saved successfully.", - "fill-field" :"Please fill out this field", - "error-template" :"Error: Template not found!", - "invalid-document" :"Error: invalid document!", - "document-not-found" :"Document not Found!", + "fill-field":"Please fill out this field", + "error-template" :"Error: Template not found!", + "invalid-document":"Error: invalid document!", + "document-not-found" :"Document not Found!", "document-signed-alert-1" :"You have successfully signed the document. You can download or print a copy of the partially signed document. A copy of the digitally signed document will be sent to the owner over email once it is signed by all signers.", - "encrypted-pdf-not-support" :"Currently encrypted pdf files are not supported.", - "document-signed-alert-4" :" Congratulations! 🎉 This document has been successfully signed by all participants!", - "document-signed-alert-5" :"This document has been signed by all Signers.", - "document-signed-alert-6" : "This document has been declined by one or more recipient(s).", - "document-signed-alert-7" :"This Document is no longer available.", - "document-signed-alert-8" :"The document has already been dispatched for signing.", + "encrypted-pdf-not-support":"Currently encrypted pdf files are not supported.", + "document-signed-alert-4":" Congratulations! 🎉 This document has been successfully signed by all participants!", + "document-signed-alert-5":"This document has been signed by all Signers.", + "document-signed-alert-6": "This document has been declined by one or more recipient(s).", + "document-signed-alert-7" :"This Document is no longer available.", + "document-signed-alert-8":"The document has already been dispatched for signing.", "yet-to-sign":"Yet to sign", - "validation-alert-1" :"The input does not meet the criteria set by the regular expression.", - "account-already-exists" :"Account already exists!", + "validation-alert-1":"The input does not meet the criteria set by the regular expression.", + "account-already-exists":"Account already exists!", "choose-password":"Choose Password", "enter-password":"Enter Password", "sure":"sure", - "subscribed-alert" :"You have already subscribed to plan!", + "subscribed-alert":"You have already subscribed to plan!", "monthly" :"Monthly", - "yearly-upto" :"Yearly (upto 66% off)", + "yearly-upto":"Yearly (upto 66% off)", "billed-yearly":"Billed Yearly", "billed-monthly": "Billed Monthly", - "plansubscription-1" :"Host it yourself for free", + "plansubscription-1":"Host it yourself for free", "visit-github":"Visit Github", "user-already-exist-name" :"User already exists with this username!", - "do-not-access-contact-admin" : "You don't have access, please contact the admin.", - "filed-required-correctly" :"Please fill required details correctly.", + "do-not-access-contact-admin": "You don't have access, please contact the admin.", + "filed-required-correctly":"Please fill required details correctly.", "admin-created":"Admin created", - "invalid-masterkey" :"Invalid masterkey", + "invalid-masterkey":"Invalid masterkey", "opensign-Setup" :"Opensign Setup", "master-key":" Master key", "profile-update-alert" :"Profile updated successfully.", From 10083ac8070cc2f750522a005212a291b5a86df0 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Fri, 2 Aug 2024 17:50:06 +0530 Subject: [PATCH 07/28] fix: detect from browser's language and set it in dropdown by default --- apps/OpenSign/public/locales/en/translation.json | 4 +++- apps/OpenSign/public/locales/fr/translation.json | 2 ++ apps/OpenSign/src/components/pdf/SelectLanguage.js | 7 ++++--- apps/OpenSign/src/pages/SignyourselfPdf.js | 10 +++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 284b79c3d..12f91e257 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -367,8 +367,9 @@ "otp-sent-alert":"OTP sent on your email", "fields-required":"Fields required", "signature-widget-alert-1" :"Please ensure there's at least one signature widget added", - "signature-widget-alert-2" : "Please ensure all field is accurately filled and meets all requirements.", + "signature-widget-alert-2" : "Please ensure all field is accurately filled and meets all requirements.", "encrypted-pdf-alert" :"Currently encrypted pdf files are not supported.", + "encrypted-pdf-alert-1" :"PFX file password is invalid.", "user-not-exist":"User does not exist", "template-signature-field":"Please add at least one signature field for all roles.", "template-role-alert":"Please add roles first", @@ -477,6 +478,7 @@ "signature-saved-alert":"Signature saved successfully.", "fill-field":"Please fill out this field", "error-template" :"Error: Template not found!", + "error":"Error", "invalid-document":"Error: invalid document!", "document-not-found" :"Document not Found!", "document-signed-alert-1" :"You have successfully signed the document. You can download or print a copy of the partially signed document. A copy of the digitally signed document will be sent to the owner over email once it is signed by all signers.", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 1be2da25b..7740f4be4 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -367,6 +367,7 @@ "signature-widget-alert-1" :"Veuillez vous assurer qu'au moins un widget de signature a été ajouté", "signature-widget-alert-2" :"Veuillez vous assurer que tous les champs sont remplis avec précision et répondent à toutes les exigences.", "encrypted-pdf-alert" :"Les fichiers PDF actuellement cryptés ne sont pas pris en charge.", + "encrypted-pdf-alert-1" :"Le mot de passe du fichier PFX n'est pas valide.", "user-not-exist" :"L'utilisateur n'existe pas", "template-signature-field":"Veuillez ajouter au moins un champ de signature pour tous les rôles.", "template-role-alert":"Veuillez d'abord ajouter des rôles", @@ -475,6 +476,7 @@ "signature-saved-alert" :"Signature enregistrée avec succès.", "fill-field":"Veuillez remplir ce champ", "error-template":"Erreur : modèle introuvable ! ", + "error":"Erreur", "invalid-document" :"Erreur : document invalide !", "document-not-found" :"Document introuvable !", "document-signed-alert-1" :"Vous avez signé le document avec succès. Vous pouvez télécharger ou imprimer une copie du document partiellement signé. Une copie du document signé numériquement sera envoyée au propriétaire par e-mail une fois qu'il sera signé par tous les signataires.", diff --git a/apps/OpenSign/src/components/pdf/SelectLanguage.js b/apps/OpenSign/src/components/pdf/SelectLanguage.js index 64a0adc09..247a5160b 100644 --- a/apps/OpenSign/src/components/pdf/SelectLanguage.js +++ b/apps/OpenSign/src/components/pdf/SelectLanguage.js @@ -1,3 +1,4 @@ +import i18next from "i18next"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -7,7 +8,7 @@ function SelectLanguage() { { value: "en", text: "English" }, { value: "fr", text: "Français" } ]; - const [lang, setLang] = useState("en"); + const [lang, setLang] = useState(i18next.language || "en"); // This function put query that helps to // change the language const handleChangeLang = (e) => { @@ -15,11 +16,11 @@ function SelectLanguage() { i18n.changeLanguage(e.target.value); }; return ( - <div className={`flex justify-center items-center mt-4`}> + <div className={`flex justify-center items-center mt-3 pb-2 md:pb-0 `}> <select value={lang} onChange={handleChangeLang} - className="op-select op-select-bordered w-[15%] bg-white pt-0" + className="op-select op-select-bordered md:w-[15%] w-[50%] bg-white op-select-sm " > <option disabled selected> select diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index f4e89373a..566050160 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -710,7 +710,7 @@ function SignYourSelf() { setIsUiLoading(false); if (err && err.message.includes("is encrypted.")) { setIsAlert({ - header: "Error", + header: t("error"), isShow: true, alertMessage: t("encrypted-pdf-alert") }); @@ -721,13 +721,13 @@ function SignYourSelf() { "PKCS#12 MAC could not be verified. Invalid password?" ) { setIsAlert({ - header: "Error", + header: t("error"), isShow: true, - alertMessage: `PFX file password is invalid.` + alertMessage: t("encrypted-pdf-alert-1") }); } else { setIsAlert({ - header: "Error", + header: t("error"), isShow: true, alertMessage: t("something-went-wrong-mssg") }); @@ -739,7 +739,7 @@ function SignYourSelf() { console.log("err in embedselfsign ", err); setIsUiLoading(false); setIsAlert({ - header: "Error", + header: t("error"), isShow: true, alertMessage: t("something-went-wrong-mssg") }); From dc4c6ceff50f590a9b49b176b1e4203fc8f60ac1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:28:12 +0000 Subject: [PATCH 08/28] build(deps): bump @lottiefiles/dotlottie-react in /apps/OpenSign Bumps [@lottiefiles/dotlottie-react](https://github.com/LottieFiles/dotlottie-web/tree/HEAD/packages/react) from 0.8.5 to 0.8.6. - [Release notes](https://github.com/LottieFiles/dotlottie-web/releases) - [Changelog](https://github.com/LottieFiles/dotlottie-web/blob/main/packages/react/CHANGELOG.md) - [Commits](https://github.com/LottieFiles/dotlottie-web/commits/@lottiefiles/dotlottie-react@0.8.6/packages/react) --- updated-dependencies: - dependency-name: "@lottiefiles/dotlottie-react" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSign/package-lock.json | 16 ++++++++-------- apps/OpenSign/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index bc08f9281..8165abb21 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "dependencies": { "@formkit/auto-animate": "^0.8.2", - "@lottiefiles/dotlottie-react": "^0.8.5", + "@lottiefiles/dotlottie-react": "^0.8.6", "@radix-ui/themes": "^3.1.1", "@react-pdf/renderer": "^3.4.4", "@reduxjs/toolkit": "^2.2.7", @@ -3610,11 +3610,11 @@ "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==" }, "node_modules/@lottiefiles/dotlottie-react": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-react/-/dotlottie-react-0.8.5.tgz", - "integrity": "sha512-n2/lsjqijma+dUZpNXoqVLNFOY81gzLi596pQJcCAOYVTI9mzoDnCGLA6S5XwSInDlF+tprEkftmyFEmGOIwfA==", + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-react/-/dotlottie-react-0.8.6.tgz", + "integrity": "sha512-Xy4IYU7auoQ+PTc6sESviK6Izh1LgCK710LcRehyQArjYMw/4SxfNB6sdX5qVdGeBbo/JbM9tOAd1MULEmfebQ==", "dependencies": { - "@lottiefiles/dotlottie-web": "0.30.1", + "@lottiefiles/dotlottie-web": "0.30.2", "debounce": "^2.0.0" }, "peerDependencies": { @@ -3623,9 +3623,9 @@ } }, "node_modules/@lottiefiles/dotlottie-web": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.30.1.tgz", - "integrity": "sha512-D5ZpD4XteU/SwJacnkcALwpSUK0I456uvg1fxdBn5F+DIAbkbcacSsA8E3ISLD1dBhWCds+nIeh8DnLFrALLNw==" + "version": "0.30.2", + "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.30.2.tgz", + "integrity": "sha512-HAUDPouNGqSIB+6b72bSmv6AC+RpMKk5RAzd9G2Wj9m/+pZRlQTFRUYBMqcRgkCtXIOagkgtwQw9fMg1/a4gxQ==" }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index a203eb53e..1fc269637 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@formkit/auto-animate": "^0.8.2", - "@lottiefiles/dotlottie-react": "^0.8.5", + "@lottiefiles/dotlottie-react": "^0.8.6", "@radix-ui/themes": "^3.1.1", "@react-pdf/renderer": "^3.4.4", "@reduxjs/toolkit": "^2.2.7", From bd2e8be186cf0024779e3411aaf577763448aab8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:28:23 +0000 Subject: [PATCH 09/28] build(deps-dev): bump lint-staged in /apps/OpenSign Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.2.7 to 15.2.8. - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md) - [Commits](https://github.com/lint-staged/lint-staged/compare/v15.2.7...v15.2.8) --- updated-dependencies: - dependency-name: lint-staged dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSign/package-lock.json | 22 +++++++++++----------- apps/OpenSign/package.json | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index bc08f9281..951056ee5 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -72,7 +72,7 @@ "eslint": "^8.57.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.34.3", - "lint-staged": "^15.2.7", + "lint-staged": "^15.2.8", "mini-css-extract-plugin": "^2.9.0", "postcss": "^8.4.40", "prettier": "^3.3.3", @@ -16319,21 +16319,21 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/lint-staged": { - "version": "15.2.7", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.7.tgz", - "integrity": "sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==", + "version": "15.2.8", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.8.tgz", + "integrity": "sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==", "dev": true, "dependencies": { "chalk": "~5.3.0", "commander": "~12.1.0", - "debug": "~4.3.4", + "debug": "~4.3.6", "execa": "~8.0.1", - "lilconfig": "~3.1.1", - "listr2": "~8.2.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", "micromatch": "~4.0.7", "pidtree": "~0.6.0", "string-argv": "~0.3.2", - "yaml": "~2.4.2" + "yaml": "~2.5.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -25725,9 +25725,9 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", "bin": { "yaml": "bin.mjs" }, diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index a203eb53e..7b75b42c0 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -104,7 +104,7 @@ "eslint": "^8.57.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.34.3", - "lint-staged": "^15.2.7", + "lint-staged": "^15.2.8", "mini-css-extract-plugin": "^2.9.0", "postcss": "^8.4.40", "prettier": "^3.3.3", From 99305b418561bd3e23c33830fabcb60976296d81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:28:35 +0000 Subject: [PATCH 10/28] build(deps): bump react-tooltip from 5.27.1 to 5.28.0 in /apps/OpenSign Bumps [react-tooltip](https://github.com/ReactTooltip/react-tooltip) from 5.27.1 to 5.28.0. - [Release notes](https://github.com/ReactTooltip/react-tooltip/releases) - [Changelog](https://github.com/ReactTooltip/react-tooltip/blob/master/CHANGELOG.md) - [Commits](https://github.com/ReactTooltip/react-tooltip/compare/v5.27.1...v5.28.0) --- updated-dependencies: - dependency-name: react-tooltip dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSign/package-lock.json | 8 ++++---- apps/OpenSign/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index bc08f9281..b4ab839ab 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -44,7 +44,7 @@ "react-scrollbars-custom": "^4.1.1", "react-select": "^5.8.0", "react-signature-canvas": "^1.0.6", - "react-tooltip": "^5.27.1", + "react-tooltip": "^5.28.0", "react-web-share": "^2.0.2", "reactour": "^1.19.4", "redux": "^5.0.1", @@ -21557,9 +21557,9 @@ } }, "node_modules/react-tooltip": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.27.1.tgz", - "integrity": "sha512-a+micPXcMOMt11CYlwJD4XShcqGziasHco4NPe1OFw298WBTILMyzUgNC1LAFViAe791JdHNVSJIpzhZm2MvDA==", + "version": "5.28.0", + "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.28.0.tgz", + "integrity": "sha512-R5cO3JPPXk6FRbBHMO0rI9nkUG/JKfalBSQfZedZYzmqaZQgq7GLzF8vcCWx6IhUCKg0yPqJhXIzmIO5ff15xg==", "dependencies": { "@floating-ui/dom": "^1.6.1", "classnames": "^2.3.0" diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index a203eb53e..d1e134756 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -39,7 +39,7 @@ "react-scrollbars-custom": "^4.1.1", "react-select": "^5.8.0", "react-signature-canvas": "^1.0.6", - "react-tooltip": "^5.27.1", + "react-tooltip": "^5.28.0", "react-web-share": "^2.0.2", "reactour": "^1.19.4", "redux": "^5.0.1", From 36dc1fb3e93d4c83fe5c5269e50f8595630e725e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:28:51 +0000 Subject: [PATCH 11/28] build(deps): bump react-router-dom in /apps/OpenSign Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.25.1 to 6.26.0. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.26.0/packages/react-router-dom) --- updated-dependencies: - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSign/package-lock.json | 26 +++++++++++++------------- apps/OpenSign/package.json | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index bc08f9281..a0bc7f70d 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -39,7 +39,7 @@ "react-quill": "^2.0.0", "react-redux": "^9.1.2", "react-rnd": "^10.4.11", - "react-router-dom": "^6.25.1", + "react-router-dom": "^6.26.0", "react-scripts": "5.0.1", "react-scrollbars-custom": "^4.1.1", "react-select": "^5.8.0", @@ -5406,9 +5406,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.18.0.tgz", - "integrity": "sha512-L3jkqmqoSVBVKHfpGZmLrex0lxR5SucGA0sUfFzGctehw+S/ggL9L/0NnC5mw6P8HUWpFZ3nQw3cRApjjWx9Sw==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.0.tgz", + "integrity": "sha512-zDICCLKEwbVYTS6TjYaWtHXxkdoUvD/QXvyVZjGCsWz5vyH7aFeONlPffPdW+Y/t6KT0MgXb2Mfjun9YpWN1dA==", "engines": { "node": ">=14.0.0" } @@ -20726,11 +20726,11 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/react-router": { - "version": "6.25.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.25.1.tgz", - "integrity": "sha512-u8ELFr5Z6g02nUtpPAggP73Jigj1mRePSwhS/2nkTrlPU5yEkH1vYzWNyvSnSzeeE2DNqWdH+P8OhIh9wuXhTw==", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.0.tgz", + "integrity": "sha512-wVQq0/iFYd3iZ9H2l3N3k4PL8EEHcb0XlU2Na8nEwmiXgIUElEH6gaJDtUQxJ+JFzmIXaQjfdpcGWaM6IoQGxg==", "dependencies": { - "@remix-run/router": "1.18.0" + "@remix-run/router": "1.19.0" }, "engines": { "node": ">=14.0.0" @@ -20740,12 +20740,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.25.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.25.1.tgz", - "integrity": "sha512-0tUDpbFvk35iv+N89dWNrJp+afLgd+y4VtorJZuOCXK0kkCWjEvb3vTJM++SYvMEpbVwXKf3FjeVveVEb6JpDQ==", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.0.tgz", + "integrity": "sha512-RRGUIiDtLrkX3uYcFiCIxKFWMcWQGMojpYZfcstc63A1+sSnVgILGIm9gNUA6na3Fm1QuPGSBQH2EMbAZOnMsQ==", "dependencies": { - "@remix-run/router": "1.18.0", - "react-router": "6.25.1" + "@remix-run/router": "1.19.0", + "react-router": "6.26.0" }, "engines": { "node": ">=14.0.0" diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index a203eb53e..d6a09bcd3 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -34,7 +34,7 @@ "react-quill": "^2.0.0", "react-redux": "^9.1.2", "react-rnd": "^10.4.11", - "react-router-dom": "^6.25.1", + "react-router-dom": "^6.26.0", "react-scripts": "5.0.1", "react-scrollbars-custom": "^4.1.1", "react-select": "^5.8.0", From 65a800701c7999de576d26d1c87227e471c988a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:57:47 +0000 Subject: [PATCH 12/28] build(deps): bump aws-sdk in /apps/OpenSignServer Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1665.0 to 2.1667.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1665.0...v2.1667.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSignServer/package-lock.json | 8 ++++---- apps/OpenSignServer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/OpenSignServer/package-lock.json b/apps/OpenSignServer/package-lock.json index f6d41a123..cf29e77f3 100644 --- a/apps/OpenSignServer/package-lock.json +++ b/apps/OpenSignServer/package-lock.json @@ -15,7 +15,7 @@ "@signpdf/placeholder-pdf-lib": "^3.2.4", "@signpdf/signer-p12": "^3.2.4", "@signpdf/signpdf": "^3.2.4", - "aws-sdk": "^2.1665.0", + "aws-sdk": "^2.1667.0", "axios": "^1.7.2", "cors": "^2.8.5", "dotenv": "^16.4.5", @@ -4134,9 +4134,9 @@ } }, "node_modules/aws-sdk": { - "version": "2.1665.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1665.0.tgz", - "integrity": "sha512-IhEcdGmiplF3l/pCROxEYIdi0s+LZ2VkbMAq3RgoXTHxY5cgqVRNaqsEsgIHev2Clxa9V08HttnIERTIUqb1+Q==", + "version": "2.1667.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1667.0.tgz", + "integrity": "sha512-hE4FmdZRMc3bYeC5LUAAU/ryYpjhEm1xdi4aVtUiZ14rrfMd0li6XQIM00a9ctZwDJpwJppcSXfDj6bVBCzvXQ==", "hasInstallScript": true, "dependencies": { "buffer": "4.9.2", diff --git a/apps/OpenSignServer/package.json b/apps/OpenSignServer/package.json index aa3de58a5..5401383e7 100644 --- a/apps/OpenSignServer/package.json +++ b/apps/OpenSignServer/package.json @@ -24,7 +24,7 @@ "@signpdf/placeholder-pdf-lib": "^3.2.4", "@signpdf/signer-p12": "^3.2.4", "@signpdf/signpdf": "^3.2.4", - "aws-sdk": "^2.1665.0", + "aws-sdk": "^2.1667.0", "axios": "^1.7.2", "cors": "^2.8.5", "dotenv": "^16.4.5", From 4284b2402bdb341a0652fd66ecaaea2e362fadfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:06:27 +0000 Subject: [PATCH 13/28] build(deps): bump axios from 1.7.2 to 1.7.3 in /apps/OpenSignServer Bumps [axios](https://github.com/axios/axios) from 1.7.2 to 1.7.3. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.7.2...v1.7.3) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSignServer/package-lock.json | 8 ++++---- apps/OpenSignServer/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/OpenSignServer/package-lock.json b/apps/OpenSignServer/package-lock.json index cf29e77f3..f04159e09 100644 --- a/apps/OpenSignServer/package-lock.json +++ b/apps/OpenSignServer/package-lock.json @@ -16,7 +16,7 @@ "@signpdf/signer-p12": "^3.2.4", "@signpdf/signpdf": "^3.2.4", "aws-sdk": "^2.1667.0", - "axios": "^1.7.2", + "axios": "^1.7.3", "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2", @@ -4176,9 +4176,9 @@ "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==" }, "node_modules/axios": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", - "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", + "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/apps/OpenSignServer/package.json b/apps/OpenSignServer/package.json index 5401383e7..bb2179345 100644 --- a/apps/OpenSignServer/package.json +++ b/apps/OpenSignServer/package.json @@ -25,7 +25,7 @@ "@signpdf/signer-p12": "^3.2.4", "@signpdf/signpdf": "^3.2.4", "aws-sdk": "^2.1667.0", - "axios": "^1.7.2", + "axios": "^1.7.3", "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2", From 4c7d771bb373a1ca879f92efb8df9b2c655cb8fc Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Tue, 6 Aug 2024 17:02:16 +0530 Subject: [PATCH 14/28] fix: apply language support in profile also and save in database, issue of text translate in guest login flow and other place --- .../public/locales/en/translation.json | 21 ++ .../public/locales/fr/translation.json | 28 +- .../src/components/opensigndrive/DriveBody.js | 6 +- apps/OpenSign/src/components/pdf/PrevNext.js | 6 +- .../src/components/pdf/SelectLanguage.js | 19 +- .../src/components/pdf/TextFontSetting.js | 2 +- .../src/components/pdf/WidgetNameModal.js | 8 +- apps/OpenSign/src/i18n.js | 4 +- apps/OpenSign/src/layout/HomeLayout.js | 8 +- apps/OpenSign/src/pages/ChangePassword.js | 6 +- apps/OpenSign/src/pages/Dashboard.js | 2 +- apps/OpenSign/src/pages/GuestLogin.js | 264 +++++++++--------- apps/OpenSign/src/pages/Login.js | 8 +- apps/OpenSign/src/pages/Opensigndrive.js | 2 +- apps/OpenSign/src/pages/PdfRequestFiles.js | 3 +- apps/OpenSign/src/pages/PlaceHolderSign.js | 4 +- apps/OpenSign/src/pages/SignyourselfPdf.js | 3 +- apps/OpenSign/src/pages/UserProfile.js | 97 ++++--- ...40806141611-update_contracts_users_cjs.cjs | 31 ++ 19 files changed, 320 insertions(+), 202 deletions(-) create mode 100644 apps/OpenSignServer/databases/migrations/20240806141611-update_contracts_users_cjs.cjs diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 12f91e257..f8cef4d9f 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -38,6 +38,7 @@ "upgrade-to":"Upgrade to", "plan":"Plan", "subscribe-card-plan":"Sign 100 docs using API. Only $0.15/doc after that.", + "user-name-limit-char":"To have a username less than 8 character please subscribe", "tour-content":"Don't show this again", "pro":"PRO", "team":"TEAM", @@ -181,6 +182,13 @@ "next":"Next", "select-folder":"Select Folder", "OpenSign-drive":"OpenSign™ Drive", + "drive-document-status":{ + "Completed":"Completed", + "Declined":"Declined", + "Draft":"Draft", + "Expired":"Expired", + "In Progress":"In Progress" + }, "select-folder-help" :"If you do not select a folder, your signed document will be saved in the Main OpenSign drive folder.", "no-data":"No data found", "save-here":"Save Here", @@ -296,6 +304,7 @@ "enter-otp":"Enter OTP", "verify":"Verify", "resend":"Resend", + "verify-email":"Please verify your email !", "send-otp":" Send OTP", "otp-placeholder":"Enter OTP received over email", @@ -332,9 +341,17 @@ "email-mssg":" Recipients added here will get a copy of the signed document.", "email-error-1":" please provide correct email address", "email-error-2" :"You can only send to ten recipients at a time.", + "Email-verified-alert-1":"Email is verified.", + "Email-verified-alert-2" :"Email is already verified.", "upload-stamp-image":"Upload stamp image", "draw":"Draw", "type":"Type", + "color-type":{ + "red":"red", + "blue":"blue", + "black":"black", + "yellow":"yellow" + }, "my-initials":"My Initials", "upload":"Upload", "initial-teb":"Initials", @@ -516,6 +533,10 @@ "generated-on":"Generated On", "text-field":"Text field", "font-size":"Font size", + "widget-status":{ + "Required":"Required", + "Optional":"Optional" + }, "all-right":"All Rights Reserved", "version":"version", "social-media":{ diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 7740f4be4..874eb785f 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -39,6 +39,7 @@ "pro":"PRO", "plan":"Plan", "subscribe-card-plan":"Signez 100 documents à l'aide de l'API. Seulement 0,15 $/doc par la suite.", + "user-name-limit-char" :"Pour avoir un nom d'utilisateur de moins de 8 caractères s'il vous plaît s'abonner", "tour-content":"Ne montre plus ça", "team":"ÉQUIPE", "docs":"Documents", @@ -179,6 +180,13 @@ "next":"Suivant", "select-folder" :"Sélectionner le dossier", "OpenSign-drive":"Lecteur OpenSign™", + "drive-document-status":{ + "Completed":"Complété", + "Declined":"Diminué", + "Draft":"Brouillon", + "Expired":"Expiré", + "In Progress":"En cours" + }, "select-folder-help" :"Si vous ne sélectionnez pas de dossier, votre document signé sera enregistré dans le dossier du lecteur principal OpenSign.", "no-data" :"Aucune donnée disponible", "save-here":"Enregistrer ici", @@ -308,7 +316,7 @@ "date":"date", "text":"texte", "text input":"saisie de texte", - "checkbox":"checkbocase à cocher", + "checkbox":"case à cocher", "dropdown":"dérouler", "radio button":"bouton radio", "image": "image", @@ -330,9 +338,17 @@ "email-mssg" :"Les destinataires ajoutés ici recevront une copie du document signé.", "email-error-1" :"veuillez fournir une adresse e-mail correcte", "email-error-2" :"Vous ne pouvez envoyer qu'à dix destinataires à la fois.", + "Email-verified-alert-1" :"L'e-mail est vérifié.", + "Email-verified-alert-2" :"L'e-mail est déjà vérifié.", "upload-stamp-image":"Télécharger l'image du tampon", "draw":"Dessiner", - "type":"Type", + "type":"Taper", + "color-type":{ + "red":"rouge", + "blue":"bleu", + "black":"noir", + "yellow":"jaune" + }, "my-initials" :"Mes initiales", "upload" :"Télécharger", "initial-teb":"Initiales", @@ -455,7 +471,7 @@ "password-update-alert-2" :"Votre mot de passe actuel est manquant ou incorrect.", "password-update-alert-3" :"Votre mot de passe actuel est manquant ou incorrect.", "password-update-alert-4" :"Votre mot de passe et votre mot de passe de confirmation ne correspondent pas.", - "current-password":"Current Password", + "current-password":"mot de passe actuel", "new-password" :"nouveau mot de passe", "confirm-password":"Confirmez le mot de passe", "file-alert-1":"La taille du fichier sélectionné est trop grande. Veuillez sélectionner un fichier inférieur à", @@ -514,6 +530,10 @@ "generated-on" :"Généré le", "text-field" :"Champ de texte", "font-size" :"Taille de police", + "widget-status":{ + "Required":"Requis", + "Optional":"Facultative" + }, "all-right" :"Tous droits réservés", "version" :"version", "social-media":{ @@ -553,7 +573,7 @@ "template-placeholder-4":"Faites glisser l'espace réservé pour un rôle n'importe où sur le document. N'oubliez pas qu'il apparaîtra dans la même couleur que le nom du destinataire pour une référence facile.", "template-placeholder-5":"Cliquer sur 'Suivant' stockera le modèle actuel. Après l'enregistrement, vous serez invité à créer un nouveau document à partir de ce modèle si vous le souhaitez.", "webhook-1":"Mettez à niveau maintenant pour définir le webhook", - "Need your Signature":"En cliquant sur cette carte, vous accéderez à la liste des documents en attente de révision.", + "Need your Signature":"En cliquant sur cette carte, vous accéderez à la liste des documents en attente de révision.", "Out for signatures":"En cliquant sur cette carte, vous accéderez à une liste de documents en attente de signature.", "Recent signature requests": "Voici une liste de documents qui attendent votre signature.", "Recently sent for signatures":"Il s'agit d'une liste de documents que vous avez envoyés à d'autres parties pour signature.", diff --git a/apps/OpenSign/src/components/opensigndrive/DriveBody.js b/apps/OpenSign/src/components/opensigndrive/DriveBody.js index c3e67947d..37f11c55c 100644 --- a/apps/OpenSign/src/components/opensigndrive/DriveBody.js +++ b/apps/OpenSign/src/components/opensigndrive/DriveBody.js @@ -350,7 +350,7 @@ function DriveBody(props) { </td> <td>{createddate}</td> <td>Pdf</td> - <td>{status}</td> + <td>{t(`drive-document-status.${status}`)}</td> <td> <i onClick={(e) => { @@ -526,7 +526,9 @@ function DriveBody(props) { <strong className="text-[13px]"> {t("report-heading.Status")}:{" "} </strong> - <span className="text-[12px] font-medium"> {status}</span> + <span className="text-[12px] font-medium"> + {t(`drive-document-status.${status}`)} + </span> <br /> <strong className="text-[13px]"> {t("report-heading.created-date")}:{" "} diff --git a/apps/OpenSign/src/components/pdf/PrevNext.js b/apps/OpenSign/src/components/pdf/PrevNext.js index d4a6a93d2..0154b1b3f 100644 --- a/apps/OpenSign/src/components/pdf/PrevNext.js +++ b/apps/OpenSign/src/components/pdf/PrevNext.js @@ -19,10 +19,9 @@ function PrevNext({ pageNumber, allPages, changePage }) { disabled={pageNumber <= 1} onClick={previousPage} > - <span className="block lg:hidden"> + <span className="block"> <i className="fa-light fa-backward" aria-hidden="true"></i> </span> - <span className="lg:block hidden 2xl:text-[30px]">{t("prev")}</span> </button> <span className="text-xs text-base-content font-medium mx-2 2xl:text-[30px]"> {pageNumber || (allPages ? 1 : "--")} {t("of")} {allPages || "--"} @@ -32,10 +31,9 @@ function PrevNext({ pageNumber, allPages, changePage }) { disabled={pageNumber >= allPages} onClick={nextPage} > - <span className="block lg:hidden"> + <span className="block"> <i className="fa-light fa-forward" aria-hidden="true"></i> </span> - <span className="lg:block hidden 2xl:text-[30px]">{t("next")}</span> </button> </div> ); diff --git a/apps/OpenSign/src/components/pdf/SelectLanguage.js b/apps/OpenSign/src/components/pdf/SelectLanguage.js index 247a5160b..19ddeb5de 100644 --- a/apps/OpenSign/src/components/pdf/SelectLanguage.js +++ b/apps/OpenSign/src/components/pdf/SelectLanguage.js @@ -2,25 +2,34 @@ import i18next from "i18next"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -function SelectLanguage() { +function SelectLanguage(props) { const { i18n } = useTranslation(); const languages = [ { value: "en", text: "English" }, { value: "fr", text: "Français" } ]; const [lang, setLang] = useState(i18next.language || "en"); - // This function put query that helps to - // change the language + // This function put query that helps to change the language const handleChangeLang = (e) => { setLang(e.target.value); i18n.changeLanguage(e.target.value); + props?.updateExtUser && + props.updateExtUser({ + language: e.target.value + }); }; return ( - <div className={`flex justify-center items-center mt-3 pb-2 md:pb-0 `}> + <div + className={`${ + !props.isProfile && " mt-3 pb-2 md:pb-0 " + } flex justify-center items-center `} + > <select value={lang} onChange={handleChangeLang} - className="op-select op-select-bordered md:w-[15%] w-[50%] bg-white op-select-sm " + className={`${ + !props.isProfile && " md:w-[15%] w-[50%]" + } op-select op-select-bordered bg-white op-select-sm`} > <option disabled selected> select diff --git a/apps/OpenSign/src/components/pdf/TextFontSetting.js b/apps/OpenSign/src/components/pdf/TextFontSetting.js index 7fde02cf7..972e7a932 100644 --- a/apps/OpenSign/src/components/pdf/TextFontSetting.js +++ b/apps/OpenSign/src/components/pdf/TextFontSetting.js @@ -47,7 +47,7 @@ function TextFontSetting(props) { {fontColorArr.map((color, ind) => { return ( <option value={color} key={ind}> - {color} + {t(`color-type.${color}`)} </option> ); })} diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js index db49e061b..295425642 100644 --- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js +++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js @@ -240,7 +240,9 @@ const WidgetNameModal = (props) => { formdata.status.toLowerCase() === data.toLowerCase() } /> - <div className="text-[13px] font-medium">{data}</div> + <div className="text-[13px] font-medium"> + {t(`widget-status.${data}`)} + </div> </div> ); })} @@ -268,7 +270,7 @@ const WidgetNameModal = (props) => { "email" ].includes(props.defaultdata?.type) && ( <div className="flex items-center mb-[0.75rem]"> - <span>Font size:</span> + <span>{t("font-size")}:</span> <select className="ml-[7px] op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content text-xs" value={ @@ -298,7 +300,7 @@ const WidgetNameModal = (props) => { {fontColorArr.map((color, ind) => { return ( <option value={color} key={ind}> - {color} + {t(`color-type.${color}`)} </option> ); })} diff --git a/apps/OpenSign/src/i18n.js b/apps/OpenSign/src/i18n.js index e3f72ed27..402079441 100644 --- a/apps/OpenSign/src/i18n.js +++ b/apps/OpenSign/src/i18n.js @@ -11,9 +11,9 @@ i18n fallbackLng: "en", // Fallback to English if no other language is detected detection: { // Order and from where user language should be detected - order: ["navigator", "htmlTag", "path", "subdomain"], + order: ["localStorage", "navigator", "htmlTag", "path", "subdomain"], // Cache user language on - caches: ["localStorage", "cookie"] + caches: ["localStorage"] }, debug: true, interpolation: { diff --git a/apps/OpenSign/src/layout/HomeLayout.js b/apps/OpenSign/src/layout/HomeLayout.js index 3c6bc356b..4e58fa93e 100644 --- a/apps/OpenSign/src/layout/HomeLayout.js +++ b/apps/OpenSign/src/layout/HomeLayout.js @@ -17,7 +17,7 @@ import { showHeader } from "../redux/reducers/showHeader"; import { useTranslation } from "react-i18next"; const HomeLayout = () => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -34,6 +34,12 @@ const HomeLayout = () => { const [, setCookie] = useCookies(["accesstoken", "main_Domain"]); const tenantId = localStorage.getItem("TenantId"); + + useEffect(() => { + const language = localStorage.getItem("i18nextLng"); + i18n.changeLanguage(language); + }, []); + useEffect(() => { if (!tenantId) { setIsUserValid(false); diff --git a/apps/OpenSign/src/pages/ChangePassword.js b/apps/OpenSign/src/pages/ChangePassword.js index b78918a61..83781c168 100644 --- a/apps/OpenSign/src/pages/ChangePassword.js +++ b/apps/OpenSign/src/pages/ChangePassword.js @@ -72,7 +72,7 @@ function ChangePassword() { value={currentpassword} onChange={(e) => setCurrentPassword(e.target.value)} className="op-input op-input-bordered op-input-sm text-xs w-full" - placeholder="Current Password" + placeholder={t("current-password")} required /> </div> @@ -86,7 +86,7 @@ function ChangePassword() { value={newpassword} onChange={(e) => setnewpassword(e.target.value)} className="op-input op-input-bordered op-input-sm text-xs w-full" - placeholder="New Password" + placeholder={t("new-password")} required /> </div> @@ -100,7 +100,7 @@ function ChangePassword() { className="op-input op-input-bordered op-input-sm text-xs w-full" value={confirmpassword} onChange={(e) => setconfirmpassword(e.target.value)} - placeholder="Confirm Password" + placeholder={t("confirm-password")} required /> </div> diff --git a/apps/OpenSign/src/pages/Dashboard.js b/apps/OpenSign/src/pages/Dashboard.js index 9c9648b4e..79947bd64 100644 --- a/apps/OpenSign/src/pages/Dashboard.js +++ b/apps/OpenSign/src/pages/Dashboard.js @@ -42,7 +42,7 @@ const Dashboard = () => { .map((col) => { return { selector: `[data-tut=${col.widget.data.tourSection}]`, - content: t(`tour-mssg.${col.widget.data.label}`), + content: t(`tour-mssg.${col.widget.label}`), position: "top" // style: { backgroundColor: "#abd4d2" }, }; diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index f197f7044..777adef6a 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -8,6 +8,7 @@ import { appInfo } from "../constant/appinfo"; import Parse from "parse"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; +import SelectLanguage from "../components/pdf/SelectLanguage"; function GuestLogin() { const { t } = useTranslation(); @@ -181,153 +182,156 @@ function GuestLogin() { setContact((prev) => ({ ...prev, [e.target.name]: e.target.value })); }; return ( - <div className="p-[2rem]"> - {isLoading ? ( - <div className="flex flex-col justify-center items-center h-[100vh]"> - <Loader /> - <span className="text-[13px] text-[gray]">{isLoading.message}</span> - </div> - ) : ( - <div className="m-1 md:m-2 p-[30px] text-base-content bg-base-100 op-card shadow-md"> - <div className="md:w-[250px] md:h-[66px] inline-block overflow-hidden mt-2 mb-11"> - {appLogo && ( - <img src={appLogo} className="object-contain" alt="logo" /> - )} + <div className="p-14"> + <div> + {isLoading ? ( + <div className="flex flex-col justify-center items-center h-[100vh]"> + <Loader /> + <span className="text-[13px] text-[gray]">{isLoading.message}</span> </div> - {contactId ? ( - <> - {!EnterOTP ? ( - <div className="w-full md:w-[50%] text-base-content"> - <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> - <legend className="text-[12px] text-[#878787] mt-2 mb-1"> - {t("guest-email-alert")} - </legend> - <div className="p-[20px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md"> + ) : ( + <div className="m-1 md:m-2 p-[30px] text-base-content bg-base-100 op-card shadow-md"> + <div className="md:w-[250px] md:h-[66px] inline-block overflow-hidden mt-2 mb-11"> + {appLogo && ( + <img src={appLogo} className="object-contain" alt="logo" /> + )} + </div> + {contactId ? ( + <> + {!EnterOTP ? ( + <div className="w-full md:w-[50%] text-base-content"> + <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> + <legend className="text-[12px] text-[#878787] mt-2 mb-1"> + {t("guest-email-alert")} + </legend> + <div className="p-[20px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md"> + <input + type="email" + name="mobile" + value={email} + className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full disabled:text-[#5c5c5c] text-xs" + disabled + /> + </div> + <div className="mt-3"> + <button + className="op-btn op-btn-primary" + onClick={(e) => handleSendOTPBtn(e)} + disabled={loading} + > + {loading ? t("loading") : t("get-verification-code")} + </button> + </div> + </div> + ) : ( + <form + className="w-full md:w-[50%] text-base-content" + onSubmit={VerifyOTP} + > + <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> + <legend className="text-[12px] text-[#878787] mt-2"> + {t("get-verification-code-2")} + </legend> + <div className="p-[20px] pt-[15px] outline outline-1 outline-slate-300/50 op-card my-2 shadow-md"> + <p className="text-sm">{t("enter-verification-code")}</p> + <input + type="number" + className="mt-2 op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" + name="OTP" + value={OTP} + onChange={(e) => setOTP(e.target.value)} + /> + </div> + <div className="mt-2.5"> + <button + className="op-btn op-btn-primary" + type="submit" + disabled={loading} + > + {loading ? t("loading") : t("verify")} + </button> + </div> + </form> + )} + </> + ) : ( + <div className="w-full md:w-[50%] text-base-content"> + <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> + <legend className="text-[12px] text-[#878787] mt-2"> + {t("provide-your-details")} + </legend> + <form + className="p-[20px] pt-[15px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md" + onSubmit={handleUserData} + > + <div className="mb-2"> + <label + htmlFor="name" + className="block text-xs text-gray-700 font-semibold" + > + {t("name")} + <span className="text-[red] text-[13px]"> *</span> + </label> + <input + type="text" + name="name" + value={contact.name} + onChange={handleInputChange} + className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" + disabled={loading} + required + /> + </div> + <div className="mb-2"> + <label + htmlFor="email" + className="block text-xs text-gray-700 font-semibold" + > + {t("email")} + <span className="text-[red] text-[13px]"> *</span> + </label> <input type="email" - name="mobile" - value={email} - className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full disabled:text-[#5c5c5c] text-xs" + name="email" + value={contact.email} + onChange={handleInputChange} + className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" + required disabled /> </div> - <div className="mt-3"> - <button - className="op-btn op-btn-primary" - onClick={(e) => handleSendOTPBtn(e)} - disabled={loading} + <div className="mt-2.5"> + <label + htmlFor="phone" + className="block text-xs text-gray-700 font-semibold" > - {loading ? t("loading") : t("get-verification-code")} - </button> - </div> - </div> - ) : ( - <form - className="w-full md:w-[50%] text-base-content" - onSubmit={VerifyOTP} - > - <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> - <legend className="text-[12px] text-[#878787] mt-2"> - {t("get-verification-code-2")} - </legend> - <div className="p-[20px] pt-[15px] outline outline-1 outline-slate-300/50 op-card my-2 shadow-md"> - <p className="text-sm">{t("enter-verification-code")}</p> + {t("phone")} + </label> <input - type="number" - className="mt-2 op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" - name="OTP" - value={OTP} - onChange={(e) => setOTP(e.target.value)} + type="text" + name="phone" + value={contact.phone} + onChange={handleInputChange} + className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" + disabled={loading} /> </div> - <div className="mt-2.5"> + <div className="mt-2 flex justify-start"> <button - className="op-btn op-btn-primary" type="submit" + className="op-btn op-btn-primary" disabled={loading} > - {loading ? t("loading") : t("verify")} + {loading ? t("loading") : t("next")} </button> </div> </form> - )} - </> - ) : ( - <div className="w-full md:w-[50%] text-base-content"> - <h1 className="text-2xl md:text-[30px]">{t("welcome")}</h1> - <legend className="text-[12px] text-[#878787] mt-2"> - {t("provide-your-details")} - </legend> - <form - className="p-[20px] pt-[15px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md" - onSubmit={handleUserData} - > - <div className="mb-2"> - <label - htmlFor="name" - className="block text-xs text-gray-700 font-semibold" - > - {t("name")} - <span className="text-[red] text-[13px]"> *</span> - </label> - <input - type="text" - name="name" - value={contact.name} - onChange={handleInputChange} - className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" - disabled={loading} - required - /> - </div> - <div className="mb-2"> - <label - htmlFor="email" - className="block text-xs text-gray-700 font-semibold" - > - {t("email")} - <span className="text-[red] text-[13px]"> *</span> - </label> - <input - type="email" - name="email" - value={contact.email} - onChange={handleInputChange} - className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" - required - disabled - /> - </div> - <div className="mt-2.5"> - <label - htmlFor="phone" - className="block text-xs text-gray-700 font-semibold" - > - {t("phone")} - </label> - <input - type="text" - name="phone" - value={contact.phone} - onChange={handleInputChange} - className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" - disabled={loading} - /> - </div> - <div className="mt-2 flex justify-start"> - <button - type="submit" - className="op-btn op-btn-primary" - disabled={loading} - > - {loading ? t("loading") : t("next")} - </button> - </div> - </form> - </div> - )} - </div> - )} + </div> + )} + </div> + )} + </div> + <SelectLanguage /> </div> ); } diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 5c82dcbcf..0fb6fd3c5 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -19,7 +19,7 @@ import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; import SelectLanguage from "../components/pdf/SelectLanguage"; function Login() { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -115,8 +115,14 @@ function Login() { `/${menu.pageType}/${menu.pageId}`; let _role = _currentRole.replace("contracts_", ""); localStorage.setItem("_user_role", _role); + const checkLanguage = extUser?.get("Language"); + if (checkLanguage) { + checkLanguage && i18n.changeLanguage(checkLanguage); + } + const results = [extUser]; const extUser_str = JSON.stringify(results); + localStorage.setItem("Extand_Class", extUser_str); const extInfo = JSON.parse(JSON.stringify(extUser)); localStorage.setItem("userEmail", extInfo.Email); diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js index 4fed29604..10def42fc 100644 --- a/apps/OpenSign/src/pages/Opensigndrive.js +++ b/apps/OpenSign/src/pages/Opensigndrive.js @@ -192,7 +192,7 @@ function Opensigndrive() { setTourData(tourConfigs); } if (!docId) { - setFolderName([{ name: "OpenSign™ Drive", objectId: "" }]); + setFolderName([{ name: t("OpenSign-drive"), objectId: "" }]); } } catch (e) { setIsAlert({ diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 01a784497..421a46463 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -208,11 +208,12 @@ function PdfRequestFiles(props) { }); if (resEmail?.message === "Email is verified.") { setIsEmailVerified(true); + alert(t("Email-verified-alert-1")); } else if (resEmail?.message === "Email is already verified.") { setIsEmailVerified(true); + alert(t("Email-verified-alert-2")); } setOtp(""); - alert(resEmail.message); setIsVerifyModal(false); //handleRecipientSign(); } catch (error) { diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index e2c186950..51c9ee4b8 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -912,7 +912,7 @@ function PlaceHolderSign() { if (!signatureExist) { isSignatureExist = false; setIsSendAlert({ - mssg: t("sure"), + mssg: "sure", alert: true }); } @@ -936,7 +936,7 @@ function PlaceHolderSign() { } } else { setIsSendAlert({ - mssg: t("sure"), + mssg: "sure", alert: true }); } diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index 566050160..7fc9f6ec7 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -593,11 +593,12 @@ function SignYourSelf() { }); if (resEmail?.message === "Email is verified.") { setIsEmailVerified(true); + alert(t("Email-verified-alert-1")); } else if (resEmail?.message === "Email is already verified.") { setIsEmailVerified(true); + alert(t("Email-verified-alert-2")); } setOtp(""); - alert(resEmail.message); setIsVerifyModal(false); // handleRecipientSign(); } catch (error) { diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index a69ea8447..d5380b7d5 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -17,6 +17,7 @@ import Upgrade from "../primitives/Upgrade"; import ModalUi from "../primitives/ModalUi"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; +import SelectLanguage from "../components/pdf/SelectLanguage"; function UserProfile() { const navigate = useNavigate(); @@ -164,38 +165,43 @@ function UserProfile() { // `updateExtUser` is used to update user details in extended class const updateExtUser = async (obj) => { - const extData = JSON.parse(localStorage.getItem("Extand_Class")); - const ExtUserId = extData[0].objectId; - const body = { - Phone: obj?.Phone || "", - Name: obj.Name, - HeaderDocId: isDisableDocId, - JobTitle: jobTitle, - Company: company, - UserName: publicUserName || "", - Tagline: tagLine || "" - }; + try { + const extData = JSON.parse(localStorage.getItem("Extand_Class")); + const ExtUserId = extData[0].objectId; + const body = { + Phone: obj?.Phone || "", + Name: obj.Name, + HeaderDocId: isDisableDocId, + JobTitle: jobTitle, + Company: company, + UserName: publicUserName || "", + Tagline: tagLine || "", + Language: obj?.language || "" + }; - await axios.put( - parseBaseUrl + "classes/contracts_Users/" + ExtUserId, - body, - { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": parseAppId, - "X-Parse-Session-Token": localStorage.getItem("accesstoken") + await axios.put( + parseBaseUrl + "classes/contracts_Users/" + ExtUserId, + body, + { + headers: { + "Content-Type": "application/json", + "X-Parse-Application-Id": parseAppId, + "X-Parse-Session-Token": localStorage.getItem("accesstoken") + } } - } - ); - const res = await Parse.Cloud.run("getUserDetails", { - email: extData[0].Email - }); + ); + const res = await Parse.Cloud.run("getUserDetails", { + email: extData[0].Email + }); - const json = JSON.parse(JSON.stringify([res])); - const extRes = JSON.stringify(json); - localStorage.setItem("Extand_Class", extRes); - previousPublicUserName.current = publicUserName; - // console.log("updateRes ", updateRes); + const json = JSON.parse(JSON.stringify([res])); + const extRes = JSON.stringify(json); + localStorage.setItem("Extand_Class", extRes); + previousPublicUserName.current = publicUserName; + // console.log("updateRes ", updateRes); + } catch (e) { + console.log("error in save data in contracts_Users class"); + } }; // file upload function const fileUpload = async (file) => { @@ -267,11 +273,12 @@ function UserProfile() { }); if (resEmail?.message === "Email is verified.") { setIsEmailVerified(true); + alert(t("Email-verified-alert-1")); } else if (resEmail?.message === "Email is already verified.") { setIsEmailVerified(true); + alert(t("Email-verified-alert-2")); } setOtp(""); - alert(resEmail.message); setIsVerifyModal(false); } catch (error) { alert(error.message); @@ -359,6 +366,17 @@ function UserProfile() { </div> </div> <ul className="w-full flex flex-col p-2 text-sm"> + <li + className={`flex justify-between items-center border-t-[1px] border-gray-300 break-all ${ + editmode ? "py-1.5" : "py-2" + }`} + > + <span className="font-semibold">{t("language")}:</span>{" "} + <SelectLanguage + isProfile={true} + updateExtUser={updateExtUser} + /> + </li> <li className={`flex justify-between items-center border-t-[1px] border-gray-300 break-all ${ editmode ? "py-1.5" : "py-2" @@ -590,7 +608,7 @@ function UserProfile() { {isVerifyModal && ( <ModalUi isOpen - title={"OTP verification"} + title={t("otp-verification")} handleClose={handleCloseVerifyModal} > {otpLoader ? ( @@ -600,26 +618,26 @@ function UserProfile() { ) : ( <form onSubmit={(e) => handleVerifyEmail(e)}> <div className="px-6 py-3 text-base-content"> - <label className="mb-2">Enter OTP</label> + <label className="mb-2">{t("enter-otp")}</label> <input required type="tel" pattern="[0-9]{4}" className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs" - placeholder="Enter OTP received over email" + placeholder={t("otp-placeholder")} value={otp} onChange={(e) => setOtp(e.target.value)} /> </div> <div className="px-6 mb-3"> <button type="submit" className="op-btn op-btn-primary"> - Verify + {t("verify")} </button> <button className="op-btn op-btn-secondary ml-2" onClick={(e) => handleResend(e)} > - Resend + {t("resend")} </button> </div> </form> @@ -639,11 +657,10 @@ function UserProfile() { <div className="op-card op-bg-primary text-primary-content w-full shadow-lg"> <div className="op-card-body"> - <h2 className="op-card-title">Upgrade to Plan</h2> - <p> - To have a username less than 8 character please - subscribe - </p> + <h2 className="op-card-title"> + {t("upgrade-to")} {t("plan")} + </h2> + <p>{t("user-name-limit-char")}</p> <div className="op-card-actions justify-end"> <button onClick={() => navigate("/subscription")} diff --git a/apps/OpenSignServer/databases/migrations/20240806141611-update_contracts_users_cjs.cjs b/apps/OpenSignServer/databases/migrations/20240806141611-update_contracts_users_cjs.cjs new file mode 100644 index 000000000..e0a2b0a36 --- /dev/null +++ b/apps/OpenSignServer/databases/migrations/20240806141611-update_contracts_users_cjs.cjs @@ -0,0 +1,31 @@ +/** + * + * @param {Parse} Parse + */ +exports.up = async Parse => { + // TODO: set className here + const className = 'contracts_Users'; + const schema = new Parse.Schema(className); + schema.addString('Language'); + // TODO: Set the schema here + // Example: + // schema.addString('name').addNumber('cash'); + + return schema.update(); +}; + +/** + * + * @param {Parse} Parse + */ +exports.down = async Parse => { + // TODO: set className here + const className = 'contracts_Users'; + const schema = new Parse.Schema(className); + schema.deleteField('Language'); + // TODO: Set the schema here + // Example: + // schema.deleteField('name').deleteField('cash'); + + return schema.update(); +}; From dd85ce7cfeb9208ca72ad6faee253f036371002c Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Tue, 6 Aug 2024 20:25:26 +0530 Subject: [PATCH 15/28] fix: after create new user selected language change in en-USA --- apps/OpenSign/src/i18n.js | 2 +- apps/OpenSign/src/pages/PlanSubscriptions.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/OpenSign/src/i18n.js b/apps/OpenSign/src/i18n.js index 402079441..d49c227d1 100644 --- a/apps/OpenSign/src/i18n.js +++ b/apps/OpenSign/src/i18n.js @@ -11,7 +11,7 @@ i18n fallbackLng: "en", // Fallback to English if no other language is detected detection: { // Order and from where user language should be detected - order: ["localStorage", "navigator", "htmlTag", "path", "subdomain"], + order: ["localStorage", "navigator"], // Cache user language on caches: ["localStorage"] }, diff --git a/apps/OpenSign/src/pages/PlanSubscriptions.js b/apps/OpenSign/src/pages/PlanSubscriptions.js index 1987048f4..105221ee7 100644 --- a/apps/OpenSign/src/pages/PlanSubscriptions.js +++ b/apps/OpenSign/src/pages/PlanSubscriptions.js @@ -16,7 +16,7 @@ const listItemStyle = { }; const PlanSubscriptions = () => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const [yearlyVisible, setYearlyVisible] = useState(true); const [isLoader, setIsLoader] = useState(true); @@ -61,8 +61,14 @@ const PlanSubscriptions = () => { phone; useEffect(() => { setIsLoader(false); + detectLanguage(); // eslint-disable-next-line }, []); + const detectLanguage = () => { + const detectedLanguage = i18n.language || "en"; + i18n.changeLanguage(detectedLanguage); + localStorage.setItem("i18nextLng", detectedLanguage); + }; const handleFreePlan = async (item) => { if (item.url) { From 6a229aabaf5db108220676bb0737bf06e6ada26b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:32:51 +0000 Subject: [PATCH 16/28] build(deps-dev): bump postcss Bumps the npm_and_yarn group in /apps/OpenSign with 1 update: [postcss](https://github.com/postcss/postcss). Updates `postcss` from 8.4.40 to 8.4.41 - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.40...8.4.41) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> --- apps/OpenSign/package-lock.json | 8 ++++---- apps/OpenSign/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index 06a3dab4c..4fa890657 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -74,7 +74,7 @@ "eslint-plugin-react": "^7.34.3", "lint-staged": "^15.2.8", "mini-css-extract-plugin": "^2.9.0", - "postcss": "^8.4.40", + "postcss": "^8.4.41", "prettier": "^3.3.3", "pretty-quick": "^4.0.0", "tailwindcss": "^3.4.7", @@ -18224,9 +18224,9 @@ } }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "funding": [ { "type": "opencollective", diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index 0d6ac347b..6f8a1c763 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -106,7 +106,7 @@ "eslint-plugin-react": "^7.34.3", "lint-staged": "^15.2.8", "mini-css-extract-plugin": "^2.9.0", - "postcss": "^8.4.40", + "postcss": "^8.4.41", "prettier": "^3.3.3", "pretty-quick": "^4.0.0", "tailwindcss": "^3.4.7", From 76b90f9bc052ea0811b7786f0b826df38639c9a4 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <prafull.navkar@nxglabs.com> Date: Wed, 7 Aug 2024 13:45:49 +0530 Subject: [PATCH 17/28] fix: something went wrong error in signpdf --- apps/OpenSign/src/components/AddTeam.js | 4 +- apps/OpenSign/src/components/AddUser.js | 4 +- .../src/components/dashboard/DashboardCard.js | 16 ++----- apps/OpenSign/src/constant/Utils.js | 48 ++++++------------- apps/OpenSign/src/json/plansArr.js | 8 ++++ apps/OpenSign/src/layout/HomeLayout.js | 5 +- apps/OpenSign/src/pages/AddAdmin.js | 5 +- apps/OpenSign/src/pages/GuestLogin.js | 3 +- apps/OpenSign/src/pages/Login.js | 14 ++---- apps/OpenSign/src/pages/Opensigndrive.js | 5 +- apps/OpenSign/src/pages/PdfRequestFiles.js | 15 ++---- apps/OpenSign/src/pages/Pgsignup.js | 9 +--- apps/OpenSign/src/pages/PlaceHolderSign.js | 3 +- apps/OpenSign/src/pages/SSOVerify.js | 5 +- apps/OpenSign/src/pages/Signup.js | 5 +- apps/OpenSign/src/pages/SignyourselfPdf.js | 2 +- .../OpenSign/src/pages/TemplatePlaceholder.js | 14 ++---- apps/OpenSign/src/pages/UserList.js | 6 +-- apps/OpenSign/src/pages/UserProfile.js | 4 +- apps/OpenSign/src/pages/Webhook.js | 4 +- .../src/primitives/GetReportDisplay.js | 5 +- .../cloud/parsefunction/GetPublicTemplate.js | 15 ++++-- .../cloud/parsefunction/getUserDetails.js | 48 +++++++++++++------ apps/OpenSignServer/index.js | 10 ++-- apps/OpenSignServer/runmigrate.js | 37 -------------- 25 files changed, 106 insertions(+), 188 deletions(-) delete mode 100644 apps/OpenSignServer/runmigrate.js diff --git a/apps/OpenSign/src/components/AddTeam.js b/apps/OpenSign/src/components/AddTeam.js index a76ac98f5..d5f205285 100644 --- a/apps/OpenSign/src/components/AddTeam.js +++ b/apps/OpenSign/src/components/AddTeam.js @@ -125,10 +125,10 @@ const AddTeam = (props) => { }; return ( - <div className="shadow-md rounded-box my-[1px] p-3 bg-[#ffffff]"> + <div className="shadow-md rounded-box my-[1px] p-3 bg-base-100 relative"> <Title title="Add Team" /> {isLoader && ( - <div className="fixed inset-0 flex justify-center items-center bg-black bg-opacity-30 z-50 rounded-box"> + <div className="absolute w-full h-full inset-0 flex justify-center items-center bg-base-content/30 z-50"> <Loader /> </div> )} diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js index 2413ad30f..b74110c26 100644 --- a/apps/OpenSign/src/components/AddUser.js +++ b/apps/OpenSign/src/components/AddUser.js @@ -48,9 +48,7 @@ const AddUser = (props) => { }; const checkUserExist = async () => { try { - const res = await Parse.Cloud.run("getUserDetails", { - email: formdata.email - }); + const res = await Parse.Cloud.run("getUserDetails"); if (res) { return true; } else { diff --git a/apps/OpenSign/src/components/dashboard/DashboardCard.js b/apps/OpenSign/src/components/dashboard/DashboardCard.js index f8017ac91..fce726af0 100644 --- a/apps/OpenSign/src/components/dashboard/DashboardCard.js +++ b/apps/OpenSign/src/components/dashboard/DashboardCard.js @@ -23,17 +23,12 @@ const DashboardCard = (props) => { sessionToken: localStorage.getItem("accesstoken") }; let body = {}; - let currentUser; - let currentUser1 = Parse.User.current(); - currentUser = currentUser1.id; let res; if (localStorage.getItem("Extand_Class")) { let data = JSON.parse(localStorage.getItem("Extand_Class")); res = data[0]; } else { - res = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + res = await Parse.Cloud.run("getUserDetails"); if (res) res = res.toJSON(); } if (res) { @@ -94,9 +89,7 @@ const DashboardCard = (props) => { let data = JSON.parse(localStorage.getItem("Extand_Class")); resr = data[0]; } else { - resr = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + resr = await Parse.Cloud.run("getUserDetails"); if (resr) resr = resr.toJSON(); } @@ -218,15 +211,12 @@ const DashboardCard = (props) => { if (restr.includes("#")) { try { - const currentUser = Parse.User.current(); let res; if (localStorage.getItem("Extand_Class")) { let data = JSON.parse(localStorage.getItem("Extand_Class")); res = data[0]; } else { - let resr = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + let resr = await Parse.Cloud.run("getUserDetails"); if (res) res = resr.toJSON(); } diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index da49cf199..5453c4461 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -6,6 +6,7 @@ import Parse from "parse"; import { appInfo } from "./appinfo"; import { saveAs } from "file-saver"; import printModule from "print-js"; +import { validplan } from "../json/plansArr"; export const fontsizeArr = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]; export const fontColorArr = ["red", "black", "blue", "yellow"]; @@ -90,13 +91,7 @@ export async function checkIsSubscribedTeam() { if (res.plan === "freeplan") { return false; } else if (res.billingDate) { - const plan = - res.plan === "team-weekly" || - res.plan === "team-yearly" || - res.plan === "teams-monthly" || - res.plan === "teams-yearly" || - res.plan === "enterprise-monthly" || - res.plan === "enterprise-yearly"; + const plan = validplan[res.plan] || false; if (plan && new Date(res.billingDate) > new Date()) { return true; } else { @@ -192,32 +187,19 @@ export const pdfNewWidthFun = (divRef) => { }; //`contractUsers` function is used to get contract_User details -export const contractUsers = async (email) => { - const data = { - email: email - }; - const userDetails = await axios - .post(`${localStorage.getItem("baseUrl")}functions/getUserDetails`, data, { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - sessionToken: localStorage.getItem("accesstoken") - } - }) - .then((Listdata) => { - const json = Listdata.data; - let data = []; - if (json && json.result) { - data.push(json.result); - } - return data; - }) - .catch((err) => { - console.log("Err in getUserDetails cloud function", err); - return "Error: Something went wrong!"; - }); - - return userDetails; +export const contractUsers = async () => { + try { + const userDetails = await Parse.Cloud.run("getUserDetails"); + let data = []; + if (userDetails) { + const json = JSON.parse(JSON.stringify(userDetails)); + data.push(json); + } + return data; + } catch (err) { + console.log("Err in getUserDetails cloud function", err); + return "Error: Something went wrong!"; + } }; //function for resize image and update width and height for mulitisigners diff --git a/apps/OpenSign/src/json/plansArr.js b/apps/OpenSign/src/json/plansArr.js index e3f8d7691..77a573e8a 100644 --- a/apps/OpenSign/src/json/plansArr.js +++ b/apps/OpenSign/src/json/plansArr.js @@ -163,4 +163,12 @@ const plans = [ } ]; +export const validplan = { + "team-weekly": true, + "team-yearly": true, + "teams-monthly": true, + "teams-yearly": true, + "enterprise-monthly": true, + "enterprise-yearly": true +}; export default plans; diff --git a/apps/OpenSign/src/layout/HomeLayout.js b/apps/OpenSign/src/layout/HomeLayout.js index 89f748c31..57c421e59 100644 --- a/apps/OpenSign/src/layout/HomeLayout.js +++ b/apps/OpenSign/src/layout/HomeLayout.js @@ -212,10 +212,7 @@ const HomeLayout = () => { }; async function checkTourStatus() { - const currentUser = Parse.User.current(); - const cloudRes = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + const cloudRes = await Parse.Cloud.run("getUserDetails"); const res = { data: cloudRes.toJSON() }; if (res.data && res.data.TourStatus && res.data.TourStatus.length > 0) { const tourStatus = res.data.TourStatus; diff --git a/apps/OpenSign/src/pages/AddAdmin.js b/apps/OpenSign/src/pages/AddAdmin.js index 7f65feadb..546057ec2 100644 --- a/apps/OpenSign/src/pages/AddAdmin.js +++ b/apps/OpenSign/src/pages/AddAdmin.js @@ -165,10 +165,7 @@ const AddAdmin = () => { // Check extended class user role and tenentId try { const userSettings = appInfo.settings; - const currentUser = Parse.User.current(); - const extUser = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + const extUser = await Parse.Cloud.run("getUserDetails"); if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; if (!IsDisabled) { diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index 7b34175df..bfc8f3391 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -124,8 +124,9 @@ function GuestLogin() { setLoading(false); } else { let _user = user.data.result; + await Parse.User.become(_user.sessionToken); const parseId = localStorage.getItem("parseAppId"); - const contractUserDetails = await contractUsers(_user.email); + const contractUserDetails = await contractUsers(); localStorage.setItem("UserInformation", JSON.stringify(_user)); localStorage.setItem( `Parse/${parseId}/currentUser`, diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 1b03909e8..88408b6cf 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -93,10 +93,7 @@ function Login() { // Check extended class user role and tenentId try { const userSettings = appInfo.settings; - const currentUser = Parse.User.current(); - await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }) + await Parse.Cloud.run("getUserDetails") .then(async (extUser) => { if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; @@ -279,10 +276,7 @@ function Login() { // Check extended class user role and tenentId try { const userSettings = appInfo.settings; - const currentUser = Parse.User.current(); - await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }) + await Parse.Cloud.run("getUserDetails") .then(async (extUser) => { if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; @@ -408,9 +402,7 @@ function Login() { localStorage.setItem("profileImg", ""); } const userSettings = appInfo.settings; - await Parse.Cloud.run("getUserDetails", { - email: _user.email - }).then(async (extUser) => { + await Parse.Cloud.run("getUserDetails").then(async (extUser) => { if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; if (!IsDisabled) { diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js index 1dc2a8de6..f675b0ea5 100644 --- a/apps/OpenSign/src/pages/Opensigndrive.js +++ b/apps/OpenSign/src/pages/Opensigndrive.js @@ -496,10 +496,7 @@ function Opensigndrive() { }; //function to use check tour status of open sign drive async function checkTourStatus() { - const currentUser = Parse.User.current(); - const cloudRes = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + const cloudRes = await Parse.Cloud.run("getUserDetails"); const res = { data: cloudRes.toJSON() }; if (res.data && res.data.TourStatus && res.data.TourStatus.length > 0) { const tourStatus = res.data.TourStatus; diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index ecde27342..48de2bcea 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -551,13 +551,8 @@ function PdfRequestFiles(props) { setRequestSignTour(true); } else { //else condition to check current user exist in contracts_Users class and check tour message status - //if not then check user exist in contracts_Contactbook class and check tour message status - const localuser = localStorage.getItem( - `Parse/${localStorage.getItem("parseAppId")}/currentUser` - ); - const currentUser = JSON.parse(localuser); - const currentUserEmail = currentUser.email; - const res = await contractUsers(currentUserEmail); + //if not then check user exist in contracts_Contactbook class and check tour message statu + const res = await contractUsers(); if (res === "Error: Something went wrong!") { setHandleError("Error: Something went wrong!"); } else if (res[0] && res?.length) { @@ -869,8 +864,7 @@ function PdfRequestFiles(props) { //get ExistUserPtr object id of user class to get tenantDetails const objectId = pdfDetails?.[0]?.ExtUserPtr?.UserId?.objectId; //get ExistUserPtr email to get userDetails - const currentUserEmail = pdfDetails?.[0]?.ExtUserPtr?.Email; - const res = await contractUsers(currentUserEmail); + const res = await contractUsers(); let activeMailAdapter = ""; if (res === "Error: Something went wrong!") { setHandleError("Error: Something went wrong!"); @@ -1546,7 +1540,8 @@ function PdfRequestFiles(props) { } else { let _user = user.data.result; const parseId = localStorage.getItem("parseAppId"); - const contractUserDetails = await contractUsers(_user.email); + await Parse.User.become(_user.sessionToken); + const contractUserDetails = await contractUsers(); localStorage.setItem("UserInformation", JSON.stringify(_user)); localStorage.setItem( `Parse/${parseId}/currentUser`, diff --git a/apps/OpenSign/src/pages/Pgsignup.js b/apps/OpenSign/src/pages/Pgsignup.js index 7e5c97637..e1ce4ef89 100644 --- a/apps/OpenSign/src/pages/Pgsignup.js +++ b/apps/OpenSign/src/pages/Pgsignup.js @@ -71,9 +71,7 @@ const PgSignUp = () => { if (res) { localStorage.removeItem("userDetails"); try { - const extUser = await Parse.Cloud.run("getUserDetails", { - email: userDetails.email - }); + const extUser = await Parse.Cloud.run("getUserDetails"); const userRole = extUser?.get("UserRole"); const _currentRole = userRole; const _role = _currentRole.replace("contracts_", ""); @@ -230,10 +228,7 @@ const PgSignUp = () => { // Check extended class user role and tenentId try { const userSettings = appInfo.settings; - const currentUser = Parse.User.current(); - const extUser = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + const extUser = await Parse.Cloud.run("getUserDetails"); if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; if (!IsDisabled) { diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 675868847..dd2a50de2 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -404,8 +404,7 @@ function PlaceHolderSign() { }; setIsLoading(loadObj); } - const currentUserEmail = documentData[0]?.ExtUserPtr?.Email; - const res = await contractUsers(currentUserEmail); + const res = await contractUsers(); if (res === "Error: Something went wrong!") { const loadObj = { isLoad: false diff --git a/apps/OpenSign/src/pages/SSOVerify.js b/apps/OpenSign/src/pages/SSOVerify.js index b2ab6701d..2e8311b3e 100644 --- a/apps/OpenSign/src/pages/SSOVerify.js +++ b/apps/OpenSign/src/pages/SSOVerify.js @@ -149,10 +149,7 @@ const SSOVerify = () => { // Check extended class user role and tenentId try { const userSettings = appInfo.settings; - const currentUser = Parse.User.current(); - await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }) + await Parse.Cloud.run("getUserDetails") .then(async (extUser) => { if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; diff --git a/apps/OpenSign/src/pages/Signup.js b/apps/OpenSign/src/pages/Signup.js index 916360548..a06026612 100644 --- a/apps/OpenSign/src/pages/Signup.js +++ b/apps/OpenSign/src/pages/Signup.js @@ -192,10 +192,7 @@ const Signup = () => { // Check extended class user role and tenentId try { const userSettings = appInfo.settings; - const currentUser = Parse.User.current(); - await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }) + await Parse.Cloud.run("getUserDetails") .then(async (extUser) => { if (extUser) { const IsDisabled = extUser?.get("IsDisabled") || false; diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index 93b9591e7..bc3c20383 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -293,7 +293,7 @@ function SignYourSelf() { setHandleError("Error: Something went wrong!"); setIsLoading(loadObj); }); - const contractUsersRes = await contractUsers(jsonSender.email); + const contractUsersRes = await contractUsers(); if (contractUsersRes === "Error: Something went wrong!") { const loadObj = { isLoad: false diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js index 68e39dfc7..36da3b58f 100644 --- a/apps/OpenSign/src/pages/TemplatePlaceholder.js +++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js @@ -153,14 +153,6 @@ const TemplatePlaceholder = () => { const [fontColor, setFontColor] = useState(); const [zoomPercent, setZoomPercent] = useState(0); const [scale, setScale] = useState(1); - const senderUser = - localStorage.getItem( - `Parse/${localStorage.getItem("parseAppId")}/currentUser` - ) && - localStorage.getItem( - `Parse/${localStorage.getItem("parseAppId")}/currentUser` - ); - const jsonSender = JSON.parse(senderUser); useEffect(() => { fetchTemplate(); @@ -317,7 +309,7 @@ const TemplatePlaceholder = () => { setHandleError("Error: Something went wrong!"); } } - const res = await contractUsers(jsonSender.email); + const res = await contractUsers(); if (res[0] && res.length) { setSignerUserId(res[0].objectId); setCurrentEmail(res[0].Email); @@ -1544,8 +1536,8 @@ const TemplatePlaceholder = () => { /> </div> ) : ( - <div className="w-[23%] bg-[#FFFFFF] min-h-screen overflow-y-auto hide-scrollbar"> - <div className={`max-h-screen`}> + <div className="w-[23%] bg-base-100 min-h-screen overflow-y-auto hide-scrollbar"> + <div className="max-h-screen"> <SignerListPlace isMailSend={isMailSend} signerPos={signerPos} diff --git a/apps/OpenSign/src/pages/UserList.js b/apps/OpenSign/src/pages/UserList.js index c0351acc3..2df84f6ae 100644 --- a/apps/OpenSign/src/pages/UserList.js +++ b/apps/OpenSign/src/pages/UserList.js @@ -221,9 +221,9 @@ const UserList = () => { <thead className="text-[14px]"> <tr className="border-y-[1px]"> {heading?.map((item, index) => ( - <React.Fragment key={index}> - <th className="px-4 py-2">{item}</th> - </React.Fragment> + <th key={index} className="px-4 py-2"> + {item} + </th> ))} </tr> </thead> diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index df48555cf..578ad5bd2 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -313,9 +313,7 @@ function UserProfile() { ) : ( <div className="flex justify-center items-center w-full relative"> {userNameError && ( - <div - className={`z-[1000] fixed top-[50%] transform border-[1px] text-sm border-[#f0a8a8] bg-[#f4bebe] text-[#c42121] rounded py-[.75rem] px-[1.25rem]`} - > + <div className="z-[1000] fixed top-[50%] transform border-[1px] text-sm border-[#f0a8a8] bg-[#f4bebe] text-[#c42121] rounded py-[.75rem] px-[1.25rem]"> {userNameError} </div> )} diff --git a/apps/OpenSign/src/pages/Webhook.js b/apps/OpenSign/src/pages/Webhook.js index 9b6668dad..92a2f3d5a 100644 --- a/apps/OpenSign/src/pages/Webhook.js +++ b/apps/OpenSign/src/pages/Webhook.js @@ -32,14 +32,12 @@ function Webhook() { }, []); const fetchWebhook = async () => { - const email = Parse.User.current().getEmail(); if (isEnableSubscription) { const getIsSubscribe = await checkIsSubscribed(); setIsSubscribe(getIsSubscribe); } - const params = { email: email }; try { - const extRes = await Parse.Cloud.run("getUserDetails", params); + const extRes = await Parse.Cloud.run("getUserDetails"); if (extRes) { setWebhook(extRes.get("Webhook")); } diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index 533fbc671..9d2ffc9c4 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -526,10 +526,7 @@ const ReportTable = (props) => { }; async function checkTourStatus() { - const currentUser = Parse.User.current(); - const cloudRes = await Parse.Cloud.run("getUserDetails", { - email: currentUser.get("email") - }); + const cloudRes = await Parse.Cloud.run("getUserDetails"); const res = { data: cloudRes.toJSON() }; if (res.data && res.data.TourStatus && res.data.TourStatus.length > 0) { const tourStatus = res.data.TourStatus; diff --git a/apps/OpenSignServer/cloud/parsefunction/GetPublicTemplate.js b/apps/OpenSignServer/cloud/parsefunction/GetPublicTemplate.js index 684bd39e6..a33d04bc0 100644 --- a/apps/OpenSignServer/cloud/parsefunction/GetPublicTemplate.js +++ b/apps/OpenSignServer/cloud/parsefunction/GetPublicTemplate.js @@ -22,11 +22,16 @@ async function GetPublicTemplate(request) { templatQuery.notEqualTo('IsArchive', true); const getTemplate = await templatQuery.find({ useMasterKey: true }); - const extend_Res = await Parse.Cloud.run('getUserDetails', { - email: user.get('email'), - }); - if (extend_Res) { - return { template: getTemplate, user: user, extend_User: extend_Res }; + const extcls = new Parse.Query('contracts_Users'); + extcls.equalTo('email', user.get('email')); + const res = await extcls.first({ useMasterKey: true }); + if (res) { + const _res = JSON.parse(JSON.stringify(_res)); + return { + template: getTemplate, + user: user, + extend_User: { Tagline: _res?.Tagline || '', SearchIndex: _res?.SearchIndex || '' }, + }; } else { throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Template not found'); } diff --git a/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js b/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js index 286a18c6e..39eb19c5f 100644 --- a/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js +++ b/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js @@ -1,19 +1,39 @@ async function getUserDetails(request) { - try { - const userId = request.params.userId; - const userQuery = new Parse.Query('contracts_Users'); - userQuery.equalTo('Email', request.params.email); - userQuery.include('TenantId'); - userQuery.include('UserId'); - userQuery.exclude('google_refresh_token') - if (userId) { - userQuery.equalTo('CreatedBy', { __type: 'Pointer', className: '_User', objectId: userId }); + const reqEmail = request.params.email; + if (reqEmail || request.user) { + try { + const userId = request.params.userId; + const userQuery = new Parse.Query('contracts_Users'); + if (request?.user) { + const email = request.user.get('email'); + userQuery.equalTo('Email', email); + } else { + userQuery.equalTo('Email', reqEmail); + } + userQuery.include('TenantId'); + userQuery.include('UserId'); + userQuery.exclude('google_refresh_token'); + if (userId) { + userQuery.equalTo('CreatedBy', { __type: 'Pointer', className: '_User', objectId: userId }); + } + const res = await userQuery.first({ useMasterKey: true }); + if (res) { + if (reqEmail) { + return { objectId: res.id }; + } else { + return res; + } + } else { + return ''; + } + } catch (err) { + console.log('Err ', err); + const code = err?.code || 400; + const msg = err?.message || 'Something went wrong.'; + throw new Parse.Error(code, msg); } - const res = await userQuery.first({ useMasterKey: true }); - return res; - } catch (err) { - console.log('Err ', err); - return err; + } else { + throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'User is not authenticated.'); } } export default getUserDetails; diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js index 670b7d64c..2f4208db2 100644 --- a/apps/OpenSignServer/index.js +++ b/apps/OpenSignServer/index.js @@ -17,7 +17,7 @@ import { exec } from 'child_process'; import { createTransport } from 'nodemailer'; import { app as v1 } from './cloud/customRoute/v1/apiV1.js'; import { PostHog } from 'posthog-node'; -import { smtpenable, smtpsecure, useLocal } from './Utils.js'; +import { cloudServerUrl, smtpenable, smtpsecure, useLocal } from './Utils.js'; import { SSOAuth } from './auth/authadapter.js'; let fsAdapter; if (useLocal !== 'true') { @@ -98,9 +98,9 @@ export const config = { maxUploadSize: '30mb', masterKey: process.env.MASTER_KEY, //Add your master key here. Keep it secret! masterKeyIps: ['0.0.0.0/0', '::/0'], // '::1' - serverURL: 'http://localhost:8080/app', // Don't forget to change to https if needed + serverURL: cloudServerUrl, // Don't forget to change to https if needed verifyUserEmails: false, - publicServerURL: process.env.SERVER_URL || 'http://localhost:8080/app', + publicServerURL: process.env.SERVER_URL || cloudServerUrl, // Your apps name. This will appear in the subject and body of the emails that are sent. appName: 'Opensign', allowClientClassCreation: false, @@ -219,8 +219,8 @@ if (!process.env.TESTING) { // console.log('isWindows', isWindows); const migrate = isWindows - ? `set APPLICATION_ID=${process.env.APP_ID}&& set SERVER_URL=http://localhost:8080/app&& set MASTER_KEY=${process.env.MASTER_KEY}&& npx parse-dbtool migrate` - : `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=http://localhost:8080/app MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`; + ? `set APPLICATION_ID=${process.env.APP_ID}&& set SERVER_URL=${cloudServerUrl}&& set MASTER_KEY=${process.env.MASTER_KEY}&& npx parse-dbtool migrate` + : `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=${cloudServerUrl} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`; exec(migrate, (error, stdout, stderr) => { if (error) { console.error(`Error: ${error.message}`); diff --git a/apps/OpenSignServer/runmigrate.js b/apps/OpenSignServer/runmigrate.js deleted file mode 100644 index 1757b0e1b..000000000 --- a/apps/OpenSignServer/runmigrate.js +++ /dev/null @@ -1,37 +0,0 @@ -// const { exec } = require('child_process'); -import { exec } from 'child_process'; - -const migrate = - 'APPLICATION_ID=legadranaxn SERVER_URL=http://localhost:8080/app MASTER_KEY=XnAwPDRQQyMr npx parse-dbtool migrate'; -// `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=${process.env.SERVER_URL} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`; - -exec(migrate, (error, stdout, stderr) => { - if (error) { - console.error(`Error: ${error.message}`); - return; - } - - if (stderr) { - console.error(`Error: ${stderr}`); - return; - } - - console.log(`Command output: ${stdout}`); -}); - -// const seeder = -// 'APPLICATION_ID=legadranaxn SERVER_URL=http://localhost:8080/app MASTER_KEY=XnAwPDRQQyMr npx parse-dbtool seed'; - -// exec(seeder, (error, stdout, stderr) => { -// if (error) { -// console.error(`Error: ${error.message}`); -// return; -// } - -// if (stderr) { -// console.error(`Error: ${stderr}`); -// return; -// } - -// console.log(`Command output: ${stdout}`); -// }); From 8d1be554d488b606628f37736178e6b97123a199 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 7 Aug 2024 14:00:52 +0530 Subject: [PATCH 18/28] fix: input validation warning translation issue --- .../public/locales/en/translation.json | 1 + .../public/locales/fr/translation.json | 1 + apps/OpenSign/src/components/AddSigner.js | 2 ++ apps/OpenSign/src/components/AddTeam.js | 1 + apps/OpenSign/src/components/AddUser.js | 6 ++++ apps/OpenSign/src/components/Header.js | 7 +++-- apps/OpenSign/src/components/LoginFacebook.js | 6 ++++ apps/OpenSign/src/components/LoginGoogle.js | 9 ++++-- .../components/pdf/DropdownWidgetOption.js | 10 ++++++ .../src/components/pdf/EditTemplate.js | 4 +++ apps/OpenSign/src/components/pdf/EmailBody.js | 1 + .../src/components/pdf/EmailComponent.js | 6 ++++ .../src/components/pdf/VerifyEmail.js | 3 ++ .../src/components/pdf/WidgetNameModal.js | 1 + .../components/shared/fields/CreateFolder.js | 1 + apps/OpenSign/src/constant/Utils.js | 6 ++++ apps/OpenSign/src/pages/AddAdmin.js | 30 ++++++++++++++++-- apps/OpenSign/src/pages/ChangePassword.js | 3 ++ apps/OpenSign/src/pages/ForgetPassword.js | 3 ++ apps/OpenSign/src/pages/Form.js | 18 +++++++++++ apps/OpenSign/src/pages/GuestLogin.js | 14 +++++++-- apps/OpenSign/src/pages/Login.js | 23 +++++++++++++- apps/OpenSign/src/pages/Opensigndrive.js | 3 ++ apps/OpenSign/src/pages/PdfRequestFiles.js | 11 ++++++- apps/OpenSign/src/pages/Pgsignup.js | 6 ++++ apps/OpenSign/src/pages/SSOVerify.js | 9 ++++++ apps/OpenSign/src/pages/Signup.js | 31 +++++++++++++++++-- apps/OpenSign/src/pages/TeamList.js | 5 +++ .../src/pages/UpdateExistUserAdmin.js | 6 ++++ apps/OpenSign/src/pages/UserProfile.js | 3 ++ apps/OpenSign/src/primitives/AddContact.js | 2 ++ .../src/primitives/GetReportDisplay.js | 5 +++ apps/OpenSign/src/primitives/ValidateRoute.js | 4 +++ 33 files changed, 226 insertions(+), 15 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index f8cef4d9f..8c71f25a9 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -14,6 +14,7 @@ "tagline":"Tagline ", "has-requested-you-to-sign":"has requested you to sign", "has-requested-you-to-review-and-sign":" has requested you to review and sign", + "input-required":"Please fill out this field.", "sort-order" :{ "Ascending":"Ascending", "Descending":"Descending", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 874eb785f..ae1c5af71 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -14,6 +14,7 @@ "tagline":"Slogan", "has-requested-you-to-sign":" vous a demandé de signer", "has-requested-you-to-review-and-sign":"vous a demandé de consulter et de signer", + "input-required":"Veuillez remplir ce champ.", "sort-order" :{ "Ascending":"Ascendant", "Descending":"Descendant", diff --git a/apps/OpenSign/src/components/AddSigner.js b/apps/OpenSign/src/components/AddSigner.js index 4b1e0e9c1..1f49e9753 100644 --- a/apps/OpenSign/src/components/AddSigner.js +++ b/apps/OpenSign/src/components/AddSigner.js @@ -233,6 +233,7 @@ const AddSigner = (props) => { onChange={(e) => setName(e.target.value)} required disabled={addYourself} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> </div> @@ -247,6 +248,7 @@ const AddSigner = (props) => { value={email} onChange={(e) => setEmail(e.target.value?.toLowerCase())} required + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} disabled={addYourself} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> diff --git a/apps/OpenSign/src/components/AddTeam.js b/apps/OpenSign/src/components/AddTeam.js index 088e13edd..1f214b01c 100644 --- a/apps/OpenSign/src/components/AddTeam.js +++ b/apps/OpenSign/src/components/AddTeam.js @@ -150,6 +150,7 @@ const AddTeam = (props) => { name="name" value={formdata.name} onChange={(e) => handleChange(e)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js index b8b2bcdee..74eeb63cb 100644 --- a/apps/OpenSign/src/components/AddUser.js +++ b/apps/OpenSign/src/components/AddUser.js @@ -273,6 +273,7 @@ const AddUser = (props) => { name="name" value={formdata.name} onChange={(e) => handleChange(e)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> @@ -290,6 +291,7 @@ const AddUser = (props) => { name="email" value={formdata.email} onChange={(e) => handleChange(e)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> @@ -343,6 +345,9 @@ const AddUser = (props) => { onChange={(e) => handleChange(e)} name="team" className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs" + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required > <option defaultValue={""} value={""}> @@ -369,6 +374,7 @@ const AddUser = (props) => { onChange={(e) => handleChange(e)} name="role" className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs" + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required > <option defaultValue={""} value={""}> diff --git a/apps/OpenSign/src/components/Header.js b/apps/OpenSign/src/components/Header.js index 31968315b..f6e5bebac 100644 --- a/apps/OpenSign/src/components/Header.js +++ b/apps/OpenSign/src/components/Header.js @@ -8,13 +8,14 @@ import { checkIsSubscribed, checkIsSubscribedTeam, getAppLogo, - openInNewTab + openInNewTab, + saveLanguageInLocal } from "../constant/Utils"; import { isEnableSubscription, isStaging } from "../constant/const"; import { useTranslation } from "react-i18next"; const Header = ({ showSidebar }) => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const { width } = useWindowSize(); let username = localStorage.getItem("username"); @@ -69,7 +70,7 @@ const Header = ({ showSidebar }) => { let appid = localStorage.getItem("parseAppId"); localStorage.clear(); - + saveLanguageInLocal(i18n); localStorage.setItem("appLogo", applogo); localStorage.setItem("defaultmenuid", defaultmenuid); localStorage.setItem("PageLanding", PageLanding); diff --git a/apps/OpenSign/src/components/LoginFacebook.js b/apps/OpenSign/src/components/LoginFacebook.js index edfe43dc7..b74e1da8b 100644 --- a/apps/OpenSign/src/components/LoginFacebook.js +++ b/apps/OpenSign/src/components/LoginFacebook.js @@ -161,6 +161,9 @@ const LoginFacebook = ({ Phone: e.target.value }) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> @@ -180,6 +183,9 @@ const LoginFacebook = ({ Company: e.target.value }) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/components/LoginGoogle.js b/apps/OpenSign/src/components/LoginGoogle.js index 5dbf2845e..72c6b701b 100644 --- a/apps/OpenSign/src/components/LoginGoogle.js +++ b/apps/OpenSign/src/components/LoginGoogle.js @@ -5,6 +5,7 @@ import { useScript } from "../hook/useScript"; import ModalUi from "../primitives/ModalUi"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; +import { saveLanguageInLocal } from "../constant/Utils"; /* * `GoogleSignInBtn`as it's name indicates it render google sign in button * and in this `useScript` in which we have created for generate google sign button @@ -17,7 +18,7 @@ const GoogleSignInBtn = ({ thirdpartyLoader, setThirdpartyLoader }) => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const [isModal, setIsModal] = useState(false); const googleBtn = useRef(); const [userDetails, setUserDetails] = useState({ @@ -57,6 +58,7 @@ const GoogleSignInBtn = ({ let userSettings = localStorage.getItem("userSettings"); localStorage.clear(); + saveLanguageInLocal(i18n); localStorage.setItem("baseUrl", baseUrl); localStorage.setItem("parseAppId", appid); @@ -181,7 +183,7 @@ const GoogleSignInBtn = ({ let appid = localStorage.getItem("parseAppId"); localStorage.clear(); - + saveLanguageInLocal(i18n); localStorage.setItem("appLogo", applogo); localStorage.setItem("defaultmenuid", defaultmenuid); localStorage.setItem("PageLanding", PageLanding); @@ -214,6 +216,7 @@ const GoogleSignInBtn = ({ Phone: e.target.value }) } + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> @@ -232,6 +235,7 @@ const GoogleSignInBtn = ({ Company: e.target.value }) } + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> @@ -250,6 +254,7 @@ const GoogleSignInBtn = ({ Destination: e.target.value }) } + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js index 45d9e497c..dfa1a9687 100644 --- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js +++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js @@ -161,6 +161,7 @@ function DropdownWidgetOption(props) { <span className="text-[red] text-[13px]"> *</span> </label> <input + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required defaultValue={dropdownName} value={dropdownName} @@ -199,6 +200,9 @@ function DropdownWidgetOption(props) { /> )} <input + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" type="text" @@ -231,6 +235,9 @@ function DropdownWidgetOption(props) { <Upgrade /> )} <input + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required defaultValue={0} value={minCount} @@ -251,6 +258,9 @@ function DropdownWidgetOption(props) { {t("maximum-check")} </label> <input + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required defaultValue={0} value={maxCount} diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.js b/apps/OpenSign/src/components/pdf/EditTemplate.js index 4b381a480..9481771fb 100644 --- a/apps/OpenSign/src/components/pdf/EditTemplate.js +++ b/apps/OpenSign/src/components/pdf/EditTemplate.js @@ -80,6 +80,7 @@ const EditTemplate = ({ template, onSuccess }) => { name="Name" value={formData.Name} onChange={(e) => handleStrInput(e)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> @@ -174,6 +175,9 @@ const EditTemplate = ({ template, onSuccess }) => { name="RemindOnceInEvery" className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" onChange={handleStrInput} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/components/pdf/EmailBody.js b/apps/OpenSign/src/components/pdf/EmailBody.js index 8df4e951d..834f31344 100644 --- a/apps/OpenSign/src/components/pdf/EmailBody.js +++ b/apps/OpenSign/src/components/pdf/EmailBody.js @@ -15,6 +15,7 @@ export function EmailBody(props) { </label> <input required + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} value={props.requestSubject} onChange={(e) => props.setRequestSubject(e.target.value)} placeholder='${senderName} has requested you to sign "${documentName}"' diff --git a/apps/OpenSign/src/components/pdf/EmailComponent.js b/apps/OpenSign/src/components/pdf/EmailComponent.js index 330d657b3..24341ca13 100644 --- a/apps/OpenSign/src/components/pdf/EmailComponent.js +++ b/apps/OpenSign/src/components/pdf/EmailComponent.js @@ -247,6 +247,9 @@ function EmailComponent({ onChange={handleEmailValue} onKeyDown={handleEnterPress} onBlur={() => emailValue && handleEnterPress("add")} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> )} @@ -261,6 +264,9 @@ function EmailComponent({ onKeyDown={handleEnterPress} placeholder="Add an email address and hit enter" onBlur={() => emailValue && handleEnterPress("add")} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/components/pdf/VerifyEmail.js b/apps/OpenSign/src/components/pdf/VerifyEmail.js index 08b0401b1..026cb5054 100644 --- a/apps/OpenSign/src/components/pdf/VerifyEmail.js +++ b/apps/OpenSign/src/components/pdf/VerifyEmail.js @@ -20,6 +20,9 @@ function VerifyEmail(props) { <div className="px-6 py-3 text-base-content"> <label className="mb-2">{t("enter-otp")}</label> <input + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required type="tel" pattern="[0-9]{4}" diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js index 295425642..77fd78a21 100644 --- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js +++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js @@ -124,6 +124,7 @@ const WidgetNameModal = (props) => { name="name" value={formdata.name} onChange={(e) => handleChange(e)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> diff --git a/apps/OpenSign/src/components/shared/fields/CreateFolder.js b/apps/OpenSign/src/components/shared/fields/CreateFolder.js index 3f7448eab..fa6d9e23e 100644 --- a/apps/OpenSign/src/components/shared/fields/CreateFolder.js +++ b/apps/OpenSign/src/components/shared/fields/CreateFolder.js @@ -134,6 +134,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={name} onChange={(e) => setName(e.target.value)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index fa0636681..70feec313 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -2242,3 +2242,9 @@ export const getContainerScale = (pdfOriginalWH, pageNumber, containerWH) => { const containerScale = containerWH?.width / getPdfPageWidth?.width || 1; return containerScale; }; + +//function to get current laguage and set it in local +export const saveLanguageInLocal = (i18n) => { + const detectedLanguage = i18n.language || "en"; + localStorage.setItem("i18nextLng", detectedLanguage); +}; diff --git a/apps/OpenSign/src/pages/AddAdmin.js b/apps/OpenSign/src/pages/AddAdmin.js index b37d08417..48e128abc 100644 --- a/apps/OpenSign/src/pages/AddAdmin.js +++ b/apps/OpenSign/src/pages/AddAdmin.js @@ -2,7 +2,11 @@ import React, { useEffect, useState } from "react"; import Parse from "parse"; import { appInfo } from "../constant/appinfo"; import { NavLink, useNavigate } from "react-router-dom"; -import { getAppLogo, openInNewTab } from "../constant/Utils"; +import { + getAppLogo, + openInNewTab, + saveLanguageInLocal +} from "../constant/Utils"; import { useDispatch } from "react-redux"; import { showTenant } from "../redux/reducers/ShowTenant"; import Loader from "../primitives/Loader"; @@ -10,7 +14,7 @@ import Title from "../components/Title"; import { useTranslation } from "react-i18next"; const AddAdmin = () => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const dispatch = useDispatch(); const [showPassword, setShowPassword] = useState(false); @@ -63,6 +67,7 @@ const AddAdmin = () => { const userSettings = localStorage.getItem("userSettings"); localStorage.clear(); + saveLanguageInLocal(i18n); localStorage.setItem("baseUrl", baseUrl); localStorage.setItem("parseAppId", appid); localStorage.setItem("appLogo", applogo); @@ -292,6 +297,9 @@ const AddAdmin = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={name} onChange={(e) => setName(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -305,6 +313,9 @@ const AddAdmin = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={email} onChange={(e) => setEmail(e.target.value?.toLowerCase())} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -317,6 +328,9 @@ const AddAdmin = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={phone} onChange={(e) => setPhone(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -329,6 +343,9 @@ const AddAdmin = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={company} onChange={(e) => setCompany(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -341,6 +358,9 @@ const AddAdmin = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={jobTitle} onChange={(e) => setJobTitle(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -355,6 +375,9 @@ const AddAdmin = () => { name="password" value={password} onChange={(e) => handlePasswordChange(e)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <span @@ -401,6 +424,9 @@ const AddAdmin = () => { id="termsandcondition" checked={isAuthorize} onChange={(e) => setIsAuthorize(e.target.checked)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <label diff --git a/apps/OpenSign/src/pages/ChangePassword.js b/apps/OpenSign/src/pages/ChangePassword.js index 83781c168..6bdda6586 100644 --- a/apps/OpenSign/src/pages/ChangePassword.js +++ b/apps/OpenSign/src/pages/ChangePassword.js @@ -73,6 +73,7 @@ function ChangePassword() { onChange={(e) => setCurrentPassword(e.target.value)} className="op-input op-input-bordered op-input-sm text-xs w-full" placeholder={t("current-password")} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> @@ -87,6 +88,7 @@ function ChangePassword() { onChange={(e) => setnewpassword(e.target.value)} className="op-input op-input-bordered op-input-sm text-xs w-full" placeholder={t("new-password")} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> @@ -101,6 +103,7 @@ function ChangePassword() { value={confirmpassword} onChange={(e) => setconfirmpassword(e.target.value)} placeholder={t("confirm-password")} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required /> </div> diff --git a/apps/OpenSign/src/pages/ForgetPassword.js b/apps/OpenSign/src/pages/ForgetPassword.js index b1eb53336..183d70356 100644 --- a/apps/OpenSign/src/pages/ForgetPassword.js +++ b/apps/OpenSign/src/pages/ForgetPassword.js @@ -109,6 +109,9 @@ function ForgotPassword() { className="op-input op-input-bordered op-input-sm w-full" value={state.email} onChange={handleChange} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.js index c10190972..c11e67544 100644 --- a/apps/OpenSign/src/pages/Form.js +++ b/apps/OpenSign/src/pages/Form.js @@ -594,6 +594,9 @@ const Forms = (props) => { onChange={(e) => handleStrInput(e)} className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs" placeholder="Enter pdf password" + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <p @@ -674,6 +677,9 @@ const Forms = (props) => { ? "application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/png,image/jpeg" : "application/pdf,image/png,image/jpeg" } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> {process.env.REACT_APP_DROPBOX_API_KEY && ( @@ -697,6 +703,9 @@ const Forms = (props) => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={formData.Name} onChange={(e) => handleStrInput(e)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> @@ -728,6 +737,9 @@ const Forms = (props) => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={formData.Note} onChange={(e) => handleStrInput(e)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> @@ -750,6 +762,9 @@ const Forms = (props) => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={formData.TimeToCompleteDays} onChange={(e) => handleStrInput(e)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> @@ -848,6 +863,9 @@ const Forms = (props) => { name="remindOnceInEvery" className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" onChange={handleStrInput} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index 777adef6a..183988057 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -2,7 +2,11 @@ import React, { useState, useEffect } from "react"; import { useNavigate, useParams } from "react-router-dom"; import axios from "axios"; import { isEnableSubscription } from "../constant/const"; -import { contractUsers, getAppLogo } from "../constant/Utils"; +import { + contractUsers, + getAppLogo, + saveLanguageInLocal +} from "../constant/Utils"; import logo from "../assets/images/logo.png"; import { appInfo } from "../constant/appinfo"; import Parse from "parse"; @@ -11,7 +15,7 @@ import { useTranslation } from "react-i18next"; import SelectLanguage from "../components/pdf/SelectLanguage"; function GuestLogin() { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const { id, userMail, contactBookId, base64url } = useParams(); const navigate = useNavigate(); const [email, setEmail] = useState(userMail); @@ -43,6 +47,7 @@ function GuestLogin() { } localStorage.clear(); + saveLanguageInLocal(i18n); const parseId = appInfo.appId; const newServer = `${appInfo.baseUrl}/`; localStorage.setItem("baseUrl", newServer); @@ -207,7 +212,7 @@ function GuestLogin() { <div className="p-[20px] outline outline-1 outline-slate-300/50 my-2 op-card shadow-md"> <input type="email" - name="mobile" + name="email" value={email} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full disabled:text-[#5c5c5c] text-xs" disabled @@ -279,6 +284,9 @@ function GuestLogin() { onChange={handleInputChange} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" disabled={loading} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index cd24019a5..c3fc6cb90 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -14,10 +14,16 @@ import Alert from "../primitives/Alert"; import { appInfo } from "../constant/appinfo"; import { fetchAppInfo } from "../redux/reducers/infoReducer"; import { showTenant } from "../redux/reducers/ShowTenant"; -import { fetchSubscription, getAppLogo, openInNewTab } from "../constant/Utils"; +import { + fetchSubscription, + getAppLogo, + openInNewTab, + saveLanguageInLocal +} from "../constant/Utils"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; import SelectLanguage from "../components/pdf/SelectLanguage"; + function Login() { const { t, i18n } = useTranslation(); const navigate = useNavigate(); @@ -584,6 +590,7 @@ function Login() { let appid = localStorage.getItem("parseAppId"); localStorage.clear(); + saveLanguageInLocal(i18n); localStorage.setItem("appLogo", applogo); localStorage.setItem("defaultmenuid", defaultmenuid); @@ -662,6 +669,9 @@ function Login() { value={state.email} onChange={handleChange} required + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } /> <hr className="my-1 border-none" /> {!isLoginSSO && ( @@ -680,6 +690,11 @@ function Login() { value={state.password} autoComplete="current-password" onChange={handleChange} + onInvalid={(e) => + e.target.setCustomValidity( + t("input-required") + ) + } required /> <span @@ -807,6 +822,9 @@ function Login() { Company: e.target.value }) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> @@ -830,6 +848,9 @@ function Login() { Destination: e.target.value }) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js index 10def42fc..1ce94408f 100644 --- a/apps/OpenSign/src/pages/Opensigndrive.js +++ b/apps/OpenSign/src/pages/Opensigndrive.js @@ -572,6 +572,9 @@ function Opensigndrive() { <span className="text-[red]">*</span> </label> <input + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required className="op-input op-input-bordered op-input-sm" type="text" diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 421a46463..2ee1821c9 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -1048,7 +1048,7 @@ function PdfRequestFiles(props) { console.log("err in request signing", err); setIsAlert({ isShow: true, - alertMessage: `Something went wrong.` + alertMessage: t("something-went-wrong-mssg") }); } } @@ -1729,6 +1729,9 @@ function PdfRequestFiles(props) { name="otp" className="grow" placeholder="Enter Verification Code" + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required value={otp} onChange={(e) => setOtp(e.target.value)} @@ -1774,6 +1777,9 @@ function PdfRequestFiles(props) { value={contact.name} onChange={handleInputChange} placeholder="name" + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required disabled={loading} /> @@ -1795,6 +1801,9 @@ function PdfRequestFiles(props) { value={contact.email} onChange={handleInputChange} placeholder="Email" + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required disabled={loading} /> diff --git a/apps/OpenSign/src/pages/Pgsignup.js b/apps/OpenSign/src/pages/Pgsignup.js index 95474b18f..d243645b5 100644 --- a/apps/OpenSign/src/pages/Pgsignup.js +++ b/apps/OpenSign/src/pages/Pgsignup.js @@ -309,6 +309,9 @@ const PgSignUp = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={formData.password} onChange={handlePassowordChange} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <label htmlFor="confirmPassword"> @@ -328,6 +331,9 @@ const PgSignUp = () => { }} value={formData.confirmPassword} onChange={handleConFirmPassowordChange} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <div diff --git a/apps/OpenSign/src/pages/SSOVerify.js b/apps/OpenSign/src/pages/SSOVerify.js index 469164fef..a78a8d2a6 100644 --- a/apps/OpenSign/src/pages/SSOVerify.js +++ b/apps/OpenSign/src/pages/SSOVerify.js @@ -277,6 +277,9 @@ const SSOVerify = () => { }) } disabled={isLoader} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <p className="text-[10px] text-[red] ml-2"> @@ -299,6 +302,9 @@ const SSOVerify = () => { }) } disabled={isLoader} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> @@ -319,6 +325,9 @@ const SSOVerify = () => { }) } disabled={isLoader} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> </div> diff --git a/apps/OpenSign/src/pages/Signup.js b/apps/OpenSign/src/pages/Signup.js index 7bc062175..56268c5ef 100644 --- a/apps/OpenSign/src/pages/Signup.js +++ b/apps/OpenSign/src/pages/Signup.js @@ -11,13 +11,17 @@ import { useDispatch } from "react-redux"; import { fetchAppInfo } from "../redux/reducers/infoReducer"; import { showTenant } from "../redux/reducers/ShowTenant"; import { isEnableSubscription } from "../constant/const"; -import { getAppLogo, openInNewTab } from "../constant/Utils"; +import { + getAppLogo, + openInNewTab, + saveLanguageInLocal +} from "../constant/Utils"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; import SelectLanguage from "../components/pdf/SelectLanguage"; const Signup = () => { const { width } = useWindowSize(); - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); const dispatch = useDispatch(); @@ -52,7 +56,7 @@ const Signup = () => { let userSettings = localStorage.getItem("userSettings"); localStorage.clear(); - + saveLanguageInLocal(i18n); localStorage.setItem("baseUrl", baseUrl); localStorage.setItem("parseAppId", appid); localStorage.setItem("appLogo", applogo); @@ -347,6 +351,9 @@ const Signup = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={name} onChange={(e) => setName(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -362,6 +369,9 @@ const Signup = () => { onChange={(e) => setEmail(e.target.value?.toLowerCase()) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -374,6 +384,9 @@ const Signup = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={phone} onChange={(e) => setPhone(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -386,6 +399,9 @@ const Signup = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={company} onChange={(e) => setCompany(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -398,6 +414,9 @@ const Signup = () => { className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" value={jobTitle} onChange={(e) => setJobTitle(e.target.value)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -412,6 +431,9 @@ const Signup = () => { name="password" value={password} onChange={(e) => handlePasswordChange(e)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <span @@ -462,6 +484,9 @@ const Signup = () => { id="termsandcondition" checked={isAuthorize} onChange={(e) => setIsAuthorize(e.target.checked)} + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <label diff --git a/apps/OpenSign/src/pages/TeamList.js b/apps/OpenSign/src/pages/TeamList.js index e5fd5509c..94e9b47fc 100644 --- a/apps/OpenSign/src/pages/TeamList.js +++ b/apps/OpenSign/src/pages/TeamList.js @@ -366,6 +366,11 @@ const TeamList = () => { onChange={(e) => handleEditChange(e, item) } + onInvalid={(e) => + e.target.setCustomValidity( + t("input-required") + ) + } required /> <button diff --git a/apps/OpenSign/src/pages/UpdateExistUserAdmin.js b/apps/OpenSign/src/pages/UpdateExistUserAdmin.js index c66100d73..52a49a075 100644 --- a/apps/OpenSign/src/pages/UpdateExistUserAdmin.js +++ b/apps/OpenSign/src/pages/UpdateExistUserAdmin.js @@ -122,6 +122,9 @@ const UpdateExistUserAdmin = () => { email: e.target.value?.toLowerCase() })) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> <hr className="my-2 border-none" /> @@ -139,6 +142,9 @@ const UpdateExistUserAdmin = () => { masterkey: e.target.value })) } + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required /> diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index d5380b7d5..51a98b713 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -620,6 +620,9 @@ function UserProfile() { <div className="px-6 py-3 text-base-content"> <label className="mb-2">{t("enter-otp")}</label> <input + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } required type="tel" pattern="[0-9]{4}" diff --git a/apps/OpenSign/src/primitives/AddContact.js b/apps/OpenSign/src/primitives/AddContact.js index 5e5c661e5..5d6d848e7 100644 --- a/apps/OpenSign/src/primitives/AddContact.js +++ b/apps/OpenSign/src/primitives/AddContact.js @@ -206,6 +206,7 @@ const AddContact = (props) => { id="name" value={name} onChange={(e) => setName(e.target.value)} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required disabled={addYourself} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -221,6 +222,7 @@ const AddContact = (props) => { id="email" value={email} onChange={(e) => setEmail(e.target.value?.toLowerCase())} + onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} required disabled={addYourself} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs lowercase" diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index cf546c041..49b0c4b6a 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -1813,6 +1813,11 @@ const ReportTable = (props) => { item ) } + onInvalid={(e) => + e.target.setCustomValidity( + t("input-required") + ) + } required /> </div> diff --git a/apps/OpenSign/src/primitives/ValidateRoute.js b/apps/OpenSign/src/primitives/ValidateRoute.js index 0e85afed1..23caa01ca 100644 --- a/apps/OpenSign/src/primitives/ValidateRoute.js +++ b/apps/OpenSign/src/primitives/ValidateRoute.js @@ -1,7 +1,10 @@ import React, { useEffect } from "react"; import Parse from "parse"; import { Outlet } from "react-router-dom"; +import { saveLanguageInLocal } from "../constant/Utils"; +import { useTranslation } from "react-i18next"; const ValidateRoute = () => { + const { i18n } = useTranslation(); useEffect(() => { (async () => { if (localStorage.getItem("accesstoken")) { @@ -30,6 +33,7 @@ const ValidateRoute = () => { let appid = localStorage.getItem("parseAppId"); localStorage.clear(); + saveLanguageInLocal(i18n); localStorage.setItem("appLogo", applogo); localStorage.setItem("defaultmenuid", defaultmenuid); From 89f4626fce5fa81794514fcbc253063824e9d25e Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 7 Aug 2024 14:43:15 +0530 Subject: [PATCH 19/28] checking error --- apps/OpenSign/src/pages/Login.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 38a4b5c80..95a2f59b6 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -105,6 +105,7 @@ function Login() { await Parse.Cloud.run("getUserDetails") .then(async (extUser) => { if (extUser) { + console.log("extUser", extUser, extUser?.get("IsDisabled")); const IsDisabled = extUser?.get("IsDisabled") || false; if (!IsDisabled) { const userRole = extUser?.get("UserRole"); @@ -614,7 +615,7 @@ function Login() { return ( <div> - <Title title="Login Page" /> + <Title title={"Login Page"} /> {state.loading && ( <div aria-live="assertive" From 095e616e4cf6a37e0d4c0ab30e7adee43a184410 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 7 Aug 2024 14:47:37 +0530 Subject: [PATCH 20/28] fix: refactor code --- .../public/locales/fr/translation.json | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index ae1c5af71..b74ac45e3 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -40,7 +40,7 @@ "pro":"PRO", "plan":"Plan", "subscribe-card-plan":"Signez 100 documents à l'aide de l'API. Seulement 0,15 $/doc par la suite.", - "user-name-limit-char" :"Pour avoir un nom d'utilisateur de moins de 8 caractères s'il vous plaît s'abonner", + "user-name-limit-char" :"Pour avoir un nom d'utilisateur de moins de 8 caractères s'il vous plaît s'abonner", "tour-content":"Ne montre plus ça", "team":"ÉQUIPE", "docs":"Documents", @@ -359,8 +359,8 @@ "contact-delete-alert" :"Êtes-vous sûr de vouloir supprimer ce contact ?", "reset-password" :"Le lien de réinitialisation du mot de passe a été envoyé à votre identifiant de messagerie", "reset-password-alert-2" :"Veuillez configurer l'adaptateur de messagerie", - "reset-password-alert-3" :"Réinitialisez votre mot de passe", - "faild-animation" :"Échec du chargement de l'animation", + "reset-password-alert-3" :"Réinitialisez votre mot de passe", + "faild-animation" :"Échec du chargement de l'animation", "apply" :"Appliquer", "copy-type":{ "All pages":"Toutes les pages", @@ -449,43 +449,43 @@ "sign-up-form" :"Formulaire d'inscription", "sign-up":"S'inscrire", "folder-already-exist!" :"le dossier existe déjà !", - "please-select-position!" :"Veuillez sélectionner un poste !", + "please-select-position!" :"Veuillez sélectionner un poste !", "default-sign-alert" :"Êtes-vous sûr de vouloir vous connecter automatiquement à tous les emplacements demandés ? ", "Your-Signature":"Votre signature", - "auto-sign-all" :"Tout signer automatiquement", + "auto-sign-all" :"Tout signer automatiquement", "generating-certificate":"Génération du certificat", - "pdf-download" :"Téléchargement PDF", + "pdf-download" :"Téléchargement PDF", "generate-certificate-alert" :" Votre certificat d'achèvement est en cours de génération. Veuillez patienter quelques instants. Si le téléchargement ne démarre pas sous peu, cliquez à nouveau sur le bouton. ", "folder-already-exist":"Le dossier existe déjà !", "folder-created-successfully":"Dossier créé avec succès !", "fill-folder-name":"Veuillez indiquer le nom du dossier", "already-exists-this-username":"Un utilisateur existe déjà avec ce nom d'utilisateur !", "verification-code-sent" :"Un e-mail de vérification a été envoyé à votre adresse e-mail !", - "registered-user-successfully" :"Utilisateur enregistré avec succès.", - "role-not-found" :"Rôle introuvable.", - "do-not-access" :"Vous n'y avez pas accès, veuillez contacter l'administrateur.", + "registered-user-successfully" :"Utilisateur enregistré avec succès.", + "role-not-found" :"Rôle introuvable.", + "do-not-access" :"Vous n'y avez pas accès, veuillez contacter l'administrateur.", "add-admin" :"Ajouter un administrateur", - "opensign-setup" :"Configuration d'Opensign", + "opensign-setup" :"Configuration d'Opensign", "join-discord" :"Rejoignez notre serveur Discord", "admin-already-exist":"L'administrateur existe déjà.", - "password-update-alert-1" :"Mot de passe mis à jour avec succès.", - "password-update-alert-2" :"Votre mot de passe actuel est manquant ou incorrect.", - "password-update-alert-3" :"Votre mot de passe actuel est manquant ou incorrect.", - "password-update-alert-4" :"Votre mot de passe et votre mot de passe de confirmation ne correspondent pas.", + "password-update-alert-1" :"Mot de passe mis à jour avec succès.", + "password-update-alert-2" :"Votre mot de passe actuel est manquant ou incorrect.", + "password-update-alert-3" :"Votre mot de passe actuel est manquant ou incorrect.", + "password-update-alert-4" :"Votre mot de passe et votre mot de passe de confirmation ne correspondent pas.", "current-password":"mot de passe actuel", - "new-password" :"nouveau mot de passe", + "new-password" :"nouveau mot de passe", "confirm-password":"Confirmez le mot de passe", "file-alert-1":"La taille du fichier sélectionné est trop grande. Veuillez sélectionner un fichier inférieur à", "file-alert-2" :"Veuillez sélectionner un fichier.", - "file-alert-3" :"Veuillez patienter pendant le téléchargement du document." , + "file-alert-3" :"Veuillez patienter pendant le téléchargement du document.", "enter-pdf-password" :"Entrez le mot de passe PDF" , - "correct-password" :"Veuillez fournir un mot de passe correct", + "correct-password" :"Veuillez fournir un mot de passe correct", "decrypting-pdf" :"Décryptage du pdf, veuillez patienter...", "invalid-otp" :"OTP invalide", "user-not-found" :"Utilisateur non trouvé!", "enter-otp-alert" :"Veuillez saisir OTP !", "get-verification-code" :"Obtenir le code de vérification", - "get-verification-code-2" :"Vous recevrez un code de vérification par e-mail", + "get-verification-code-2" :"Vous recevrez un code de vérification par e-mail", "enter-verification-code" :"Entrez le code de vérification", "provide-your-details" :"Fournissez vos coordonnées", "provide-email" :"Veuillez fournir un e-mail.", From 23c2b4b20417434fb2696b75faeb8abbf9e38b03 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 7 Aug 2024 14:51:43 +0530 Subject: [PATCH 21/28] fix: remove console --- apps/OpenSign/src/pages/Login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 95a2f59b6..12e2923c9 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -105,7 +105,7 @@ function Login() { await Parse.Cloud.run("getUserDetails") .then(async (extUser) => { if (extUser) { - console.log("extUser", extUser, extUser?.get("IsDisabled")); + // console.log("extUser", extUser, extUser?.get("IsDisabled")); const IsDisabled = extUser?.get("IsDisabled") || false; if (!IsDisabled) { const userRole = extUser?.get("UserRole"); From eb345b5ca27d4db91c2ed85ca012f49c070c5a91 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 7 Aug 2024 15:50:54 +0530 Subject: [PATCH 22/28] fix: after filled any input value still show warning of empty field --- apps/OpenSign/src/components/AddSigner.js | 2 ++ apps/OpenSign/src/components/AddTeam.js | 1 + apps/OpenSign/src/components/AddUser.js | 4 ++++ apps/OpenSign/src/components/LoginFacebook.js | 2 ++ apps/OpenSign/src/components/LoginGoogle.js | 3 +++ apps/OpenSign/src/components/pdf/DropdownWidgetOption.js | 4 ++++ apps/OpenSign/src/components/pdf/EditTemplate.js | 2 ++ apps/OpenSign/src/components/pdf/EmailBody.js | 1 + apps/OpenSign/src/components/pdf/EmailComponent.js | 2 ++ apps/OpenSign/src/components/pdf/VerifyEmail.js | 1 + apps/OpenSign/src/components/pdf/WidgetNameModal.js | 1 + apps/OpenSign/src/components/shared/fields/CreateFolder.js | 1 + apps/OpenSign/src/pages/AddAdmin.js | 7 +++++++ apps/OpenSign/src/pages/ChangePassword.js | 3 +++ apps/OpenSign/src/pages/ForgetPassword.js | 1 + apps/OpenSign/src/pages/Form.js | 6 ++++++ apps/OpenSign/src/pages/GuestLogin.js | 1 + apps/OpenSign/src/pages/Login.js | 4 ++++ apps/OpenSign/src/pages/Opensigndrive.js | 1 + apps/OpenSign/src/pages/PdfRequestFiles.js | 3 +++ apps/OpenSign/src/pages/Pgsignup.js | 2 ++ apps/OpenSign/src/pages/SSOVerify.js | 3 +++ apps/OpenSign/src/pages/Signup.js | 7 +++++++ apps/OpenSign/src/pages/TeamList.js | 3 +++ apps/OpenSign/src/pages/UpdateExistUserAdmin.js | 2 ++ apps/OpenSign/src/pages/UserProfile.js | 1 + apps/OpenSign/src/primitives/AddContact.js | 2 ++ apps/OpenSign/src/primitives/GetReportDisplay.js | 3 +++ 28 files changed, 73 insertions(+) diff --git a/apps/OpenSign/src/components/AddSigner.js b/apps/OpenSign/src/components/AddSigner.js index 1f49e9753..8f4eb528d 100644 --- a/apps/OpenSign/src/components/AddSigner.js +++ b/apps/OpenSign/src/components/AddSigner.js @@ -234,6 +234,7 @@ const AddSigner = (props) => { required disabled={addYourself} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> </div> @@ -249,6 +250,7 @@ const AddSigner = (props) => { onChange={(e) => setEmail(e.target.value?.toLowerCase())} required onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} disabled={addYourself} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> diff --git a/apps/OpenSign/src/components/AddTeam.js b/apps/OpenSign/src/components/AddTeam.js index bdf0c33f1..caf75af0a 100644 --- a/apps/OpenSign/src/components/AddTeam.js +++ b/apps/OpenSign/src/components/AddTeam.js @@ -151,6 +151,7 @@ const AddTeam = (props) => { value={formdata.name} onChange={(e) => handleChange(e)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js index e424d6446..346501207 100644 --- a/apps/OpenSign/src/components/AddUser.js +++ b/apps/OpenSign/src/components/AddUser.js @@ -272,6 +272,7 @@ const AddUser = (props) => { value={formdata.name} onChange={(e) => handleChange(e)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> @@ -290,6 +291,7 @@ const AddUser = (props) => { value={formdata.email} onChange={(e) => handleChange(e)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> @@ -346,6 +348,7 @@ const AddUser = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required > <option defaultValue={""} value={""}> @@ -373,6 +376,7 @@ const AddUser = (props) => { name="role" className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs" onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required > <option defaultValue={""} value={""}> diff --git a/apps/OpenSign/src/components/LoginFacebook.js b/apps/OpenSign/src/components/LoginFacebook.js index b74e1da8b..369b91e34 100644 --- a/apps/OpenSign/src/components/LoginFacebook.js +++ b/apps/OpenSign/src/components/LoginFacebook.js @@ -164,6 +164,7 @@ const LoginFacebook = ({ onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -186,6 +187,7 @@ const LoginFacebook = ({ onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/components/LoginGoogle.js b/apps/OpenSign/src/components/LoginGoogle.js index 72c6b701b..0ecf246bd 100644 --- a/apps/OpenSign/src/components/LoginGoogle.js +++ b/apps/OpenSign/src/components/LoginGoogle.js @@ -217,6 +217,7 @@ const GoogleSignInBtn = ({ }) } onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -236,6 +237,7 @@ const GoogleSignInBtn = ({ }) } onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -255,6 +257,7 @@ const GoogleSignInBtn = ({ }) } onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js index dfa1a9687..b831176fe 100644 --- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js +++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js @@ -162,6 +162,7 @@ function DropdownWidgetOption(props) { </label> <input onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required defaultValue={dropdownName} value={dropdownName} @@ -203,6 +204,7 @@ function DropdownWidgetOption(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" type="text" @@ -238,6 +240,7 @@ function DropdownWidgetOption(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required defaultValue={0} value={minCount} @@ -261,6 +264,7 @@ function DropdownWidgetOption(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required defaultValue={0} value={maxCount} diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.js b/apps/OpenSign/src/components/pdf/EditTemplate.js index 9481771fb..e7bb6fa87 100644 --- a/apps/OpenSign/src/components/pdf/EditTemplate.js +++ b/apps/OpenSign/src/components/pdf/EditTemplate.js @@ -81,6 +81,7 @@ const EditTemplate = ({ template, onSuccess }) => { value={formData.Name} onChange={(e) => handleStrInput(e)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" /> @@ -178,6 +179,7 @@ const EditTemplate = ({ template, onSuccess }) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/components/pdf/EmailBody.js b/apps/OpenSign/src/components/pdf/EmailBody.js index 834f31344..f01e3c17a 100644 --- a/apps/OpenSign/src/components/pdf/EmailBody.js +++ b/apps/OpenSign/src/components/pdf/EmailBody.js @@ -16,6 +16,7 @@ export function EmailBody(props) { <input required onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} value={props.requestSubject} onChange={(e) => props.setRequestSubject(e.target.value)} placeholder='${senderName} has requested you to sign "${documentName}"' diff --git a/apps/OpenSign/src/components/pdf/EmailComponent.js b/apps/OpenSign/src/components/pdf/EmailComponent.js index 24341ca13..a41f82cbb 100644 --- a/apps/OpenSign/src/components/pdf/EmailComponent.js +++ b/apps/OpenSign/src/components/pdf/EmailComponent.js @@ -250,6 +250,7 @@ function EmailComponent({ onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> )} @@ -267,6 +268,7 @@ function EmailComponent({ onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/components/pdf/VerifyEmail.js b/apps/OpenSign/src/components/pdf/VerifyEmail.js index 026cb5054..e61ed1402 100644 --- a/apps/OpenSign/src/components/pdf/VerifyEmail.js +++ b/apps/OpenSign/src/components/pdf/VerifyEmail.js @@ -23,6 +23,7 @@ function VerifyEmail(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required type="tel" pattern="[0-9]{4}" diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js index 77fd78a21..2329f596c 100644 --- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js +++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js @@ -125,6 +125,7 @@ const WidgetNameModal = (props) => { value={formdata.name} onChange={(e) => handleChange(e)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/components/shared/fields/CreateFolder.js b/apps/OpenSign/src/components/shared/fields/CreateFolder.js index fa6d9e23e..d40c698ab 100644 --- a/apps/OpenSign/src/components/shared/fields/CreateFolder.js +++ b/apps/OpenSign/src/components/shared/fields/CreateFolder.js @@ -135,6 +135,7 @@ const CreateFolder = ({ parentFolderId, onSuccess, folderCls }) => { value={name} onChange={(e) => setName(e.target.value)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/pages/AddAdmin.js b/apps/OpenSign/src/pages/AddAdmin.js index b483c3ce0..82c5da286 100644 --- a/apps/OpenSign/src/pages/AddAdmin.js +++ b/apps/OpenSign/src/pages/AddAdmin.js @@ -297,6 +297,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -313,6 +314,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -328,6 +330,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -343,6 +346,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -358,6 +362,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -375,6 +380,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <span @@ -424,6 +430,7 @@ const AddAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <label diff --git a/apps/OpenSign/src/pages/ChangePassword.js b/apps/OpenSign/src/pages/ChangePassword.js index 6bdda6586..d903c504b 100644 --- a/apps/OpenSign/src/pages/ChangePassword.js +++ b/apps/OpenSign/src/pages/ChangePassword.js @@ -74,6 +74,7 @@ function ChangePassword() { className="op-input op-input-bordered op-input-sm text-xs w-full" placeholder={t("current-password")} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -89,6 +90,7 @@ function ChangePassword() { className="op-input op-input-bordered op-input-sm text-xs w-full" placeholder={t("new-password")} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -104,6 +106,7 @@ function ChangePassword() { onChange={(e) => setconfirmpassword(e.target.value)} placeholder={t("confirm-password")} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/pages/ForgetPassword.js b/apps/OpenSign/src/pages/ForgetPassword.js index 183d70356..0bab81f53 100644 --- a/apps/OpenSign/src/pages/ForgetPassword.js +++ b/apps/OpenSign/src/pages/ForgetPassword.js @@ -112,6 +112,7 @@ function ForgotPassword() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.js index c11e67544..7f88b9856 100644 --- a/apps/OpenSign/src/pages/Form.js +++ b/apps/OpenSign/src/pages/Form.js @@ -597,6 +597,7 @@ const Forms = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <p @@ -680,6 +681,7 @@ const Forms = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> {process.env.REACT_APP_DROPBOX_API_KEY && ( @@ -706,6 +708,7 @@ const Forms = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -740,6 +743,7 @@ const Forms = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -765,6 +769,7 @@ const Forms = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -866,6 +871,7 @@ const Forms = (props) => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index 69bf4fa33..60913b843 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -288,6 +288,7 @@ function GuestLogin() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 12e2923c9..43f085a19 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -665,6 +665,7 @@ function Login() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} /> <hr className="my-1 border-none" /> {!isLoginSSO && ( @@ -688,6 +689,7 @@ function Login() { t("input-required") ) } + onInput={(e) => e.target.setCustomValidity("")} required /> <span @@ -818,6 +820,7 @@ function Login() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -844,6 +847,7 @@ function Login() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js index dc635ea01..ecf4e0bcb 100644 --- a/apps/OpenSign/src/pages/Opensigndrive.js +++ b/apps/OpenSign/src/pages/Opensigndrive.js @@ -572,6 +572,7 @@ function Opensigndrive() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required className="op-input op-input-bordered op-input-sm" type="text" diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 7915b145b..1e77ff05a 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -1727,6 +1727,7 @@ function PdfRequestFiles(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required value={otp} onChange={(e) => setOtp(e.target.value)} @@ -1775,6 +1776,7 @@ function PdfRequestFiles(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required disabled={loading} /> @@ -1799,6 +1801,7 @@ function PdfRequestFiles(props) { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required disabled={loading} /> diff --git a/apps/OpenSign/src/pages/Pgsignup.js b/apps/OpenSign/src/pages/Pgsignup.js index 679ef4bd2..1ba337614 100644 --- a/apps/OpenSign/src/pages/Pgsignup.js +++ b/apps/OpenSign/src/pages/Pgsignup.js @@ -307,6 +307,7 @@ const PgSignUp = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <label htmlFor="confirmPassword"> @@ -329,6 +330,7 @@ const PgSignUp = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <div diff --git a/apps/OpenSign/src/pages/SSOVerify.js b/apps/OpenSign/src/pages/SSOVerify.js index 2bbd16fa3..263367c61 100644 --- a/apps/OpenSign/src/pages/SSOVerify.js +++ b/apps/OpenSign/src/pages/SSOVerify.js @@ -277,6 +277,7 @@ const SSOVerify = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <p className="text-[10px] text-[red] ml-2"> @@ -302,6 +303,7 @@ const SSOVerify = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> @@ -325,6 +327,7 @@ const SSOVerify = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> </div> diff --git a/apps/OpenSign/src/pages/Signup.js b/apps/OpenSign/src/pages/Signup.js index 9b6819daf..e5fb83431 100644 --- a/apps/OpenSign/src/pages/Signup.js +++ b/apps/OpenSign/src/pages/Signup.js @@ -351,6 +351,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -369,6 +370,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -384,6 +386,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -399,6 +402,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -414,6 +418,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -431,6 +436,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <span @@ -484,6 +490,7 @@ const Signup = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <label diff --git a/apps/OpenSign/src/pages/TeamList.js b/apps/OpenSign/src/pages/TeamList.js index 94e9b47fc..65e7359e6 100644 --- a/apps/OpenSign/src/pages/TeamList.js +++ b/apps/OpenSign/src/pages/TeamList.js @@ -371,6 +371,9 @@ const TeamList = () => { t("input-required") ) } + onInput={(e) => + e.target.setCustomValidity("") + } required /> <button diff --git a/apps/OpenSign/src/pages/UpdateExistUserAdmin.js b/apps/OpenSign/src/pages/UpdateExistUserAdmin.js index 52a49a075..50b104c99 100644 --- a/apps/OpenSign/src/pages/UpdateExistUserAdmin.js +++ b/apps/OpenSign/src/pages/UpdateExistUserAdmin.js @@ -125,6 +125,7 @@ const UpdateExistUserAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> <hr className="my-2 border-none" /> @@ -145,6 +146,7 @@ const UpdateExistUserAdmin = () => { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required /> diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index 2fda9861d..1392a7435 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -621,6 +621,7 @@ function UserProfile() { onInvalid={(e) => e.target.setCustomValidity(t("input-required")) } + onInput={(e) => e.target.setCustomValidity("")} required type="tel" pattern="[0-9]{4}" diff --git a/apps/OpenSign/src/primitives/AddContact.js b/apps/OpenSign/src/primitives/AddContact.js index 5d6d848e7..73c9b7d2a 100644 --- a/apps/OpenSign/src/primitives/AddContact.js +++ b/apps/OpenSign/src/primitives/AddContact.js @@ -207,6 +207,7 @@ const AddContact = (props) => { value={name} onChange={(e) => setName(e.target.value)} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required disabled={addYourself} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs" @@ -223,6 +224,7 @@ const AddContact = (props) => { value={email} onChange={(e) => setEmail(e.target.value?.toLowerCase())} onInvalid={(e) => e.target.setCustomValidity(t("input-required"))} + onInput={(e) => e.target.setCustomValidity("")} required disabled={addYourself} className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs lowercase" diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index b6ce68836..ac17cb183 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -1815,6 +1815,9 @@ const ReportTable = (props) => { t("input-required") ) } + onInput={(e) => + e.target.setCustomValidity("") + } required /> </div> From 74792a9c2117eb22fafb00444c8fa41b4920683b Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 7 Aug 2024 16:08:02 +0530 Subject: [PATCH 23/28] refactor code --- apps/OpenSign/src/i18n.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/OpenSign/src/i18n.js b/apps/OpenSign/src/i18n.js index d49c227d1..e82bfc4ce 100644 --- a/apps/OpenSign/src/i18n.js +++ b/apps/OpenSign/src/i18n.js @@ -10,12 +10,13 @@ i18n .init({ fallbackLng: "en", // Fallback to English if no other language is detected detection: { - // Order and from where user language should be detected + // Specifies the default language to fall back to if the detected language is not available. order: ["localStorage", "navigator"], - // Cache user language on + // Defines where the detected language should be cached. caches: ["localStorage"] }, - debug: true, + //Enables debug mode, which outputs detailed logs to the console about the translation process. + debug: false, interpolation: { escapeValue: false // Not needed for react as it escapes by default }, From d22322be866a5837363c9a94ccc652ff9d24d998 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <93375423+prafull-opensignlabs@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:28:31 +0530 Subject: [PATCH 24/28] fix: not able to create user using add user form --- apps/OpenSign/src/components/AddUser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js index b74110c26..2413ad30f 100644 --- a/apps/OpenSign/src/components/AddUser.js +++ b/apps/OpenSign/src/components/AddUser.js @@ -48,7 +48,9 @@ const AddUser = (props) => { }; const checkUserExist = async () => { try { - const res = await Parse.Cloud.run("getUserDetails"); + const res = await Parse.Cloud.run("getUserDetails", { + email: formdata.email + }); if (res) { return true; } else { From d74dc2f4ca41b7f9b64ff52de8781511bdbb61ca Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Thu, 8 Aug 2024 12:54:05 +0530 Subject: [PATCH 25/28] fix:improve readability by updating some French words --- .../public/locales/en/translation.json | 8 +- .../public/locales/fr/translation.json | 102 +++++++++--------- apps/OpenSign/src/script/PublicTemplate.js | 8 +- 3 files changed, 57 insertions(+), 61 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 8c71f25a9..af4497936 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -29,7 +29,7 @@ }, "action":"Action", "add":"Add", - "add-new-folder":"ajouter un nouveau dossier", + "add-new-folder":"Add a new folder", "disable-documentId":"Disable DocumentId", "edit":"Edit", "change-password":"Change Password", @@ -125,7 +125,7 @@ "Share with team":"Share with team", "Share":"Share", "View":"View", - "option":"option" + "option":"Option" }, "report-heading":{ "Sr.No":"Sr.No", @@ -146,7 +146,6 @@ "Status":"Status", "created-date":"Created Date", "Type":"Type" - }, "report-help":{ "Draft Documents": "These are documents you have started but have not finalized for sending.", @@ -305,7 +304,6 @@ "enter-otp":"Enter OTP", "verify":"Verify", "resend":"Resend", - "verify-email":"Please verify your email !", "send-otp":" Send OTP", "otp-placeholder":"Enter OTP received over email", @@ -370,7 +368,7 @@ "All pages but last":"All pages but last", "All pages but first":"All pages but first" }, - "options":"options", + "options":"Options", "minimun-check":"Minimun check", "maximum-check":"Maximum check", "default-value":"Default value", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index b74ac45e3..9ba28201c 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -1,12 +1,12 @@ { "create-account": "Créer un compte", - "login": "se connecter", + "login": "Se Connecter", "language":"Langue", - "name":"Nom", + "name":"Nom et Prénom", "phone":"Téléphone", "email":"E-mail", - "company":"Entreprise", - "job-title":"Titre d'emploi", + "company":"Organisation", + "job-title":"Votre Fonction", "profile":"Profil", "is-email-verified":"L'e-mail est-il vérifié", "log-out" :"Déconnexion", @@ -18,7 +18,7 @@ "sort-order" :{ "Ascending":"Ascendant", "Descending":"Descendant", - "Name":"Nom", + "Name":"Nom et Prénom", "Date":"Date" }, "context-menu": { @@ -28,26 +28,26 @@ "Delete": "Supprimer" }, "action":"Action", - "add":"ajouter", - "add-new-folder":"ajouter un nouveau dossier", - "disable-documentId":"Désactiver l'ID de document", + "add":"Ajouter", + "add-new-folder":"Ajouter un nouveau dossier", + "disable-documentId":"Désactiver l'ID du document", "edit":"Modifier", - "change-password":"Changer le mot de passe", + "change-password":"Changer votre mot de passe", "save":"Sauvegarder", "cancel":"Annuler", "upgrade-now":"Mettre à jour maintenant", "upgrade-to" :"Mettre à niveau vers", "pro":"PRO", - "plan":"Plan", + "plan":"Offre", "subscribe-card-plan":"Signez 100 documents à l'aide de l'API. Seulement 0,15 $/doc par la suite.", "user-name-limit-char" :"Pour avoir un nom d'utilisateur de moins de 8 caractères s'il vous plaît s'abonner", - "tour-content":"Ne montre plus ça", + "tour-content":"Ne plus afficher", "team":"ÉQUIPE", "docs":"Documents", "session-expired" :"Votre session a expiré.", "user":"Utilisateur", "public-profile-help":"Il s'agit de votre URL publique. Copiez-le ou partagez-le avec le signataire et vous pourrez voir tous vos modèles définis publiquement.", - "tagline-help":"Ce slogan apparaîtra sur votre profil public OpenSign par exemple. https://opensign.me/alex", + "tagline-help":"Ce surnom apparaîtra sur votre profil public OpenSign par exemple. https://opensign.me/alex", "welcome":"Content de te revoir!", "Login-to-your-account" :"Se connecter à son compte", "password" :"Mot de passe", @@ -58,13 +58,13 @@ "login-page":"Page de connexion", "or":"OU", "signup-page":"Page d'inscription", - "password-length":"Le mot de passe doit être 8 Longs caractères", - "password-case":"Le mot de passe doit contenir lettre majuscule, lettre minuscule, chiffre", + "password-length":"Le mot de passe doit être de plus de 8 caractères", + "password-case":"Le mot de passe doit contenir une lettre majuscule, minuscule et un chiffre ", "password-special-char":"Le mot de passe doit contenir un caractère spécial", - "agreee":"je suis d'accord avec le", + "agreee":"Je suis d'accord avec le", "term":"Conditions d'utilisation", "subscribe-to-opensign":"Abonnez-vous à la newsletter OpenSign", - "register" :"Registre", + "register" :"S'enregistrer ", "sidebar": { "Dashboard": "Tableau de bord", "Sign yourself": "signez vous-même", @@ -77,11 +77,11 @@ "OpenSign™ Drive":"Lecteur OpenSign™", "Reports":"Rapports", "Reports-Children" :{ - "Need your sign": "Besoin de signer", + "Need your sign": "Besoin de votre signature", "In Progress": "En cours", "Completed":"Complété", "Drafts": "Brouillons", - "Declined": "a refusé", + "Declined":"Signature refusé", "Expired":"Expiré", "Contactbook":"Carnet de contacts" }, @@ -90,17 +90,17 @@ "My Signature": "Ma signature", "API Token":"Jeton API", "Webhook":"Webhook", - "Teams":"Équipes", + "Teams":"Équipe", "Users":"Utilisateurs" } }, "dashboard-card":{ "Need your Signature":"Besoin de votre signature", - "Out for signatures":"En quête de signatures" + "Out for signatures":"En attente de Signature" }, "report-name":{ - "Draft Documents":"Projets de documents", - "Need your sign":"Besoin de votre signe", + "Draft Documents":"Brouillons", + "Need your sign": "Besoin de votre signature", "In-progress documents":"Documents en cours", "Completed Documents":"Documents complétés", "Declined Documents":"Documents refusés", @@ -110,11 +110,11 @@ "Drafts":"Brouillons", "Contactbook":"Carnet de contacts", "Templates":"Modèles", - "Teams":"Teams", + "Teams":"Équipe", "Users":"Utilisateurs" }, "report-heading":{ - "Sr.No":"Sr. Non", + "Sr.No":"Numéro du document", "Title":"Titre", "Email":"E-mail", "Phone":"Téléphone", @@ -128,14 +128,14 @@ "Active":"Actif", "Role":"Rôle", "Team":"Équipe", - "Name":"Nom", + "Name":"Nom et Prénom", "Status":"Statut", "created-date":"Date de création", - "Type":"Taper" + "Type":"Saisir" }, "btnLabel":{ - "sign":"signe", - "Resend":"Renvoyer", + "sign":"Signer", + "Resend":"Relancer", "Revoke":"Révoquer", "Delete":"Supprimer", "Use":"Utiliser", @@ -144,11 +144,11 @@ "Share with team":"Partager avec l'équipe", "Share":"Partager", "View":"Voir", - "option":"option" + "option":"Option" }, "report-help":{ "Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.", - "Need your sign": "Voici une liste de documents qui attendent votre signature", + "Need your sign": "Voici une liste de documents ou votre signature est requise", "In-progress documents": "Il s'agit d'une liste de documents que vous avez envoyés à d'autres parties pour signature.", "Completed Documents": "Il s'agit d'une liste de documents signés par toutes les parties.", "Declined Documents": "Il s'agit d'une liste de documents qui ont été refusés par l'un des signataires.", @@ -168,7 +168,7 @@ "document-title":"Titre du document", "description":"Description", "time-to-complete":"Temps de réalisation (jours)", - "send-in-order":"Envoyer dans la commande", + "send-in-order":"Envoyer dans l'ordre ?", "send-in-order-help":{ "p1":"Choisissez la manière dont vous souhaitez que les demandes de signature soient envoyées aux signataires du document :", "p2":"La sélection de cette option enverra initialement la demande de signature au premier signataire. Une fois que le premier signataire a terminé sa partie, le prochain signataire de la séquence recevra la demande. Ce processus se poursuit jusqu'à ce que tous les signataires aient signé le document. Cette méthode garantit que le document est signé dans un ordre spécifique.", @@ -183,21 +183,21 @@ "OpenSign-drive":"Lecteur OpenSign™", "drive-document-status":{ "Completed":"Complété", - "Declined":"Diminué", + "Declined": "Refuser", "Draft":"Brouillon", "Expired":"Expiré", "In Progress":"En cours" }, "select-folder-help" :"Si vous ne sélectionnez pas de dossier, votre document signé sera enregistré dans le dossier du lecteur principal OpenSign.", - "no-data" :"Aucune donnée disponible", + "no-data" :"Aucune données disponible", "save-here":"Enregistrer ici", "back" :"Retour", "add-folder" :"Ajouter le dossier", - "create-folder":"Créer le dossier", - "parent-folder" :"Dossier parent", - "create":"Créer", - "signers" :"Signataires", - "signers-help" :"Commencez à saisir le nom d'un contact pour voir les signataires suggérés par vos contacts enregistrés ou en ajouter de nouveaux. Organisez l'ordre de signature en ajoutant des signataires dans l'ordre souhaité. Utilisez le bouton « + » pour inclure les signataires et le « x » pour les supprimer. Chaque signataire recevra un e-mail invité à signer le document dans l'ordre indiqué.", + "create-folder":"Créer le dossier", + "parent-folder" :"Dossier Parent", + "create":"Créer", + "signers" :"Signataires", + "signers-help" :"Commencez à saisir le nom d'un contact pour voir les signataires suggérés par vos contacts enregistrés ou en ajouter de nouveaux. Organisez l'ordre de signature en ajoutant des signataires dans l'ordre souhaité. Utilisez le bouton « + » pour inclure les signataires et le « x » pour les supprimer. Chaque signataire recevra un e-mail invité à signer le document dans l'ordre indiqué.", "add-signer":"Ajouter un signataire", "contact-not-found" :"Contact introuvable", "add-yourself":"Ajoutez-vous", @@ -214,7 +214,7 @@ "regenerate-token":"Régénérer le jeton", "generate-token" :"Générer un jeton", "view-docs" :"Afficher les documents" , - "generate-token-alert":"Êtes-vous sûr de vouloir régénérer le jeton, il expirera à l'ancienne jeton?", + "generate-token-alert":"Êtes-vous sûr de vouloir régénérer le jeton, votre ancien jeton sera supprimer?", "yes" :"Oui", "copied" :"Copié", "wrong-mssg":"Quelque chose c'est mal passé. Merci d'essayer plus tard.", @@ -235,7 +235,7 @@ "no-data-avaliable" :"pas de données disponibles", "add-team":"Ajouter une équipe", "page-not-found" :"Page non trouvée", - "users-from-teams" :"utilisateurs de Teams", + "users-from-teams" :"utilisateurs de votre Équipe", "user-status":"Statut de l'utilisateur", "activate" :"Activer", "deactivate":"désactiver", @@ -309,11 +309,11 @@ "loading-doc":"Chargement du document..", "widgets-name":{ "signature":"signature", - "stamp":"estampiller", + "stamp":"tampon", "initials":"initiales", - "name":"nom", - "job title":"titre d'emploi", - "company":"entreprise", + "name":"nom et Prénom", + "job title":"votre fonction", + "company":"organisation", "date":"date", "text":"texte", "text input":"saisie de texte", @@ -364,7 +364,7 @@ "apply" :"Appliquer", "copy-type":{ "All pages":"Toutes les pages", - "All pages but last": "Toutes les pages sauf la dernière", + "All pages but last":"Toutes les pages sauf la dernière", "All pages but first":"Toutes les pages sauf la première" }, "options": "Possibilités", @@ -378,8 +378,8 @@ "alert":"Alerte", "zoom-in":"Agrandir", "zoom-out" :"Dézoomer", - "document-signed-alert" :"Félicitations ! 🎉 Ce document a été signé avec succès par vous !", - "otp-sent-alert" :"OTP envoyé sur votre email", + "document-signed-alert" :"Félicitations ! 🎉 Votre document à bien été signer!", + "otp-sent-alert" :"Le code OTP a bien été envoyer sur votre adresse Email", "fields-required" :"Champs obligatoires", "signature-widget-alert-1" :"Veuillez vous assurer qu'au moins un widget de signature a été ajouté", "signature-widget-alert-2" :"Veuillez vous assurer que tous les champs sont remplis avec précision et répondent à toutes les exigences.", @@ -398,7 +398,7 @@ "add-role" :"Ajouter un rôle", "role-ex" :"Ex : Client, RH, Directeur, Manager, Étudiant, etc.", "add/choose-signer":"Ajouter/Choisir un signataire", - "choose-from-contacts":"Choisissez parmi les contacts", + "choose-from-contacts":"Choisissez parmis les contacts", "select-signer":"Veuillez sélectionner le signataire", "edit-template" :"Modifier le modèle", "widget-info" :"Informations sur les widgets", @@ -426,17 +426,17 @@ "placeholder-alert-7" :"Veuillez sélectionner le signataire pour ajouter un espace réservé !", "email-subject":"Sujet du courriel", "email-body":"corps de l'e-mail", - "email-placeholder" :"ajouter le corps de l'e-mail", + "email-placeholder" :"Ajouter le corps de l'e-mail", "reset-to-default" :"Réinitialiser aux valeurs par défaut", "cutomize-email":"Personnaliser l'e-mail", "upgrade-to-customize-email":"Mise à niveau pour personnaliser l'e-mail", "sign-url" :"Signer l'URL", - "Mails Sent" :"Mails envoyés", + "Mails Sent" :"Mails envoyés avec succès !", "document-alert" :"Alerte document", "owner-subscription-expired":"L'abonnement du propriétaire a expiré.", "subscription-expired" :"Abonnement expiré", "alert-message" :"Message d'alerte", - "document-decline" :"Document-refus", + "document-decline" :"Document-refusé", "decline-alert-1":"Etes-vous sûr de vouloir refuser ce document ?", "decline-alert-2": "Vous avez refusé ce document !", "decline-alert-3": "Vous ne pouvez pas signer ce document car il a été refusé/révoqué.", diff --git a/apps/OpenSign/src/script/PublicTemplate.js b/apps/OpenSign/src/script/PublicTemplate.js index c76252f6b..3ef08df4c 100644 --- a/apps/OpenSign/src/script/PublicTemplate.js +++ b/apps/OpenSign/src/script/PublicTemplate.js @@ -18,11 +18,9 @@ const PublicScriptFileWrapper = ({ initialProps }) => { return <PdfRequestFiles {...props} />; }; -const appId = - //"legadranaxn"; - "opensign"; -const serverUrl = "http://localhost:8080/app"; -//"https://app.opensignlabs.com/api/app"; +const appId = "legadranaxn"; +// "opensign"; +const serverUrl = "https://app.opensignlabs.com/api/app"; // "https://staging-app.opensignlabs.com/api/app"; localStorage.setItem("baseUrl", `${serverUrl}/`); localStorage.setItem("parseAppId", appId); From 4373fddaa884d926822a8b2a5cb774925228a15e Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <93375423+prafull-opensignlabs@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:58:38 +0530 Subject: [PATCH 26/28] fix: Error while calling webhook --- .../cloud/customRoute/saveSubscription.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/OpenSignServer/cloud/customRoute/saveSubscription.js b/apps/OpenSignServer/cloud/customRoute/saveSubscription.js index dfdca0c2b..214bb3707 100644 --- a/apps/OpenSignServer/cloud/customRoute/saveSubscription.js +++ b/apps/OpenSignServer/cloud/customRoute/saveSubscription.js @@ -1,9 +1,9 @@ export default async function saveSubscription(request, response) { - const SubscriptionId = request.body.data.subscription.subscription_id; + const SubscriptionId = request.body?.data?.subscription?.subscription_id; const body = request.body; - const Email = request.body.data.subscription.customer.email; - const Next_billing_date = request.body.data.subscription.next_billing_at; - const planCode = request.body.data.subscription.plan.plan_code + const Email = request.body.data?.subscription?.customer?.email; + const Next_billing_date = request.body?.data?.subscription?.next_billing_at; + const planCode = request.body?.data?.subscription?.plan?.plan_code; try { const extUserCls = new Parse.Query('contracts_Users'); @@ -22,7 +22,11 @@ export default async function saveSubscription(request, response) { updateSubscription.id = subscription.id; updateSubscription.set('SubscriptionId', SubscriptionId); updateSubscription.set('SubscriptionDetails', body); - updateSubscription.set('Next_billing_date', new Date(Next_billing_date)); + if (Next_billing_date) { + updateSubscription.set('Next_billing_date', new Date(Next_billing_date)); + } else { + updateSubscription.unset('Next_billing_date'); + } updateSubscription.set('PlanCode', planCode); await updateSubscription.save(null, { useMasterKey: true }); return response.status(200).json({ status: 'update subscription!' }); @@ -45,7 +49,11 @@ export default async function saveSubscription(request, response) { className: 'partners_Tenant', objectId: extUser.get('TenantId').id, }); - createSubscription.set('Next_billing_date', new Date(Next_billing_date)); + if (Next_billing_date) { + createSubscription.set('Next_billing_date', new Date(Next_billing_date)); + } else { + createSubscription.unset('Next_billing_date'); + } createSubscription.set('PlanCode', planCode); await createSubscription.save(null, { useMasterKey: true }); return response.status(200).json({ status: 'create subscription!' }); From 28fe1fafd60ee75cda92cbdefc5ceca82e37be75 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <93375423+prafull-opensignlabs@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:14:56 +0530 Subject: [PATCH 27/28] fix: not able update user profile --- apps/OpenSignServer/cloud/parsefunction/getUserDetails.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js b/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js index 39eb19c5f..030a84f17 100644 --- a/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js +++ b/apps/OpenSignServer/cloud/parsefunction/getUserDetails.js @@ -4,11 +4,11 @@ async function getUserDetails(request) { try { const userId = request.params.userId; const userQuery = new Parse.Query('contracts_Users'); - if (request?.user) { + if (reqEmail) { + userQuery.equalTo('Email', reqEmail); + } else { const email = request.user.get('email'); userQuery.equalTo('Email', email); - } else { - userQuery.equalTo('Email', reqEmail); } userQuery.include('TenantId'); userQuery.include('UserId'); From a9ab25e9c2d17037ef148a232cad8e3b65f175f8 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <93375423+prafull-opensignlabs@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:57:01 +0530 Subject: [PATCH 28/28] fix: not able to update company --- apps/OpenSign/src/pages/UserProfile.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index 1392a7435..1c383d840 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -190,9 +190,7 @@ function UserProfile() { } } ); - const res = await Parse.Cloud.run("getUserDetails", { - email: extData[0].Email - }); + const res = await Parse.Cloud.run("getUserDetails"); const json = JSON.parse(JSON.stringify([res])); const extRes = JSON.stringify(json);