diff --git a/web/src/Setting.js b/web/src/Setting.js
index 3e9f560c..0543e3c4 100644
--- a/web/src/Setting.js
+++ b/web/src/Setting.js
@@ -920,7 +920,7 @@ export function getClickable(text) {
return (
{
copy(text);
- showMessage("success", "Copied to clipboard");
+ showMessage("success", i18next.t("general:Copied to clipboard successfully"));
}}>
{text}
@@ -1171,7 +1171,7 @@ export function renderLogo(application) {
function isSigninMethodEnabled(application, signinMethod) {
if (application && application.signinMethods) {
- return application.signinMethods.filter(item => item.name === signinMethod && item.rule !== "Hide-Password").length > 0;
+ return application.signinMethods.filter(item => item.name === signinMethod && item.rule !== "Hide password").length > 0;
} else {
return false;
}
@@ -1550,25 +1550,25 @@ export function getDefaultHtmlEmailContent() {
export function getCurrencyText(product) {
if (product?.currency === "USD") {
- return i18next.t("product:USD");
+ return i18next.t("currency:USD");
} else if (product?.currency === "CNY") {
- return i18next.t("product:CNY");
+ return i18next.t("currency:CNY");
} else if (product?.currency === "EUR") {
- return i18next.t("product:EUR");
+ return i18next.t("currency:EUR");
} else if (product?.currency === "JPY") {
- return i18next.t("product:JPY");
+ return i18next.t("currency:JPY");
} else if (product?.currency === "GBP") {
- return i18next.t("product:GBP");
+ return i18next.t("currency:GBP");
} else if (product?.currency === "AUD") {
- return i18next.t("product:AUD");
+ return i18next.t("currency:AUD");
} else if (product?.currency === "CAD") {
- return i18next.t("product:CAD");
+ return i18next.t("currency:CAD");
} else if (product?.currency === "CHF") {
- return i18next.t("product:CHF");
+ return i18next.t("currency:CHF");
} else if (product?.currency === "HKD") {
- return i18next.t("product:HKD");
+ return i18next.t("currency:HKD");
} else if (product?.currency === "SGD") {
- return i18next.t("product:SGD");
+ return i18next.t("currency:SGD");
} else {
return "(Unknown currency)";
}
diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js
index 78ff6357..0740dedd 100644
--- a/web/src/auth/LoginPage.js
+++ b/web/src/auth/LoginPage.js
@@ -1150,7 +1150,7 @@ class LoginPage extends React.Component {
]);
application?.signinMethods?.forEach((signinMethod) => {
- if (signinMethod.rule === "Hide-Password") {
+ if (signinMethod.rule === "Hide password") {
return;
}
const item = itemsMap.get(generateItemKey(signinMethod.name, signinMethod.rule));
diff --git a/web/src/auth/Obfuscator.js b/web/src/auth/Obfuscator.js
index 79837fb4..42881ca7 100644
--- a/web/src/auth/Obfuscator.js
+++ b/web/src/auth/Obfuscator.js
@@ -46,17 +46,17 @@ function encrypt(cipher, key, iv, password) {
export function checkPasswordObfuscator(passwordObfuscatorType, passwordObfuscatorKey) {
if (passwordObfuscatorType === undefined) {
- return i18next.t("organization:failed to get password obfuscator");
+ return "passwordObfuscatorType should not be undefined";
} else if (passwordObfuscatorType === "Plain" || passwordObfuscatorType === "") {
return "";
} else if (passwordObfuscatorType === "AES" || passwordObfuscatorType === "DES") {
if (passwordObfuscatorKeyRegexes[passwordObfuscatorType].test(passwordObfuscatorKey)) {
return "";
} else {
- return `${i18next.t("organization:The password obfuscator key doesn't match the regex")}: ${passwordObfuscatorKeyRegexes[passwordObfuscatorType].source}`;
+ return `The password obfuscator key doesn't match the regex: ${passwordObfuscatorKeyRegexes[passwordObfuscatorType].source}`;
}
} else {
- return `${i18next.t("organization:unsupported password obfuscator type")}: ${passwordObfuscatorType}`;
+ return `unsupported password obfuscator type: ${passwordObfuscatorType}`;
}
}
diff --git a/web/src/common/CasdoorAppConnector.js b/web/src/common/CasdoorAppConnector.js
index f39c32c3..a68e9eea 100644
--- a/web/src/common/CasdoorAppConnector.js
+++ b/web/src/common/CasdoorAppConnector.js
@@ -14,6 +14,7 @@
import React from "react";
import {Alert, Button, QRCode} from "antd";
+import copy from "copy-to-clipboard";
import * as Setting from "../Setting";
import i18next from "i18next";
@@ -62,12 +63,8 @@ export const CasdoorAppUrl = ({accessToken}) => {
return;
}
- try {
- await navigator.clipboard.writeText(qrUrl);
- Setting.showMessage("success", i18next.t("general:Copied to clipboard"));
- } catch (err) {
- Setting.showMessage("error", i18next.t("general:Failed to copy"));
- }
+ copy(qrUrl);
+ Setting.showMessage("success", i18next.t("general:Copied to clipboard successfully"));
};
if (error) {
@@ -82,14 +79,9 @@ export const CasdoorAppUrl = ({accessToken}) => {
alignItems: "center",
marginBottom: "10px",
}}>
- {i18next.t("general:URL String")}
{window.isSecureContext && (
-