Web: Components/People: fixed translation in PasswordInput

This commit is contained in:
Artem Tarasov 2021-04-07 14:41:46 +03:00
parent 13c9e5b0b6
commit 3ee7541e54
5 changed files with 17 additions and 6 deletions

View File

@ -243,6 +243,15 @@ class PasswordInput extends React.Component {
return !equal(this.props, nextProps) || !equal(this.state, nextState);
}
componentDidUpdate(prevProps, prevState) {
if (
prevProps.clipActionResource !== this.props.clipActionResource &&
this.state.copyLabel !== this.props.clipCopiedResource
) {
this.setState({ copyLabel: this.props.clipActionResource });
}
}
renderTextTooltip = (settings, length, digits, capital, special) => {
return (
<>
@ -415,6 +424,7 @@ class PasswordInput extends React.Component {
hideNewPasswordButton,
isDisabled,
} = this.props;
const { copyLabel, disableCopyAction } = this.state;
return (

View File

@ -12,6 +12,7 @@
"UpdatingProcess": "Updating...",
"CancelButton": "Cancel",
"CopyEmailAndPassword": "Copy e-mail & password",
"CopiedResourceText": "Copied",
"UserType": "Type",
"AddButton": "Add",
"ContactInformation": "Contact information",
@ -42,9 +43,7 @@
"ErrorPasswordNoUpperCase": "capital letters",
"ErrorPasswordNoSpecialSymbols": "special characters",
"ErrorPasswordLength": "from {{from}} to {{to}} characters",
"CustomCreation": "{{user}} (creation)",
"ActivationLink": "Activation link",
"AddPhoto": "Add photo",
"TemporaryPassword": "Temporary password",
@ -61,4 +60,4 @@
"Calendar": "Calendar",
"ViewAccess": "View",
"ProfileAction": "Profile action"
}
}

View File

@ -12,6 +12,7 @@
"UpdatingProcess": "Обновление...",
"CancelButton": "Отмена",
"CopyEmailAndPassword": "Копировать email и пароль",
"CopiedResourceText": "Скопировано",
"UserType": "Тип",
"AddButton": "Добавить",
"ContactInformation": "Контактные данные",
@ -41,9 +42,7 @@
"ErrorPasswordNoUpperCase": "заглавные буквы",
"ErrorPasswordNoSpecialSymbols": "специальные символы",
"ErrorPasswordLength": "от {{from}} до {{to}} символов",
"CustomCreation": "{{user}} (создание)",
"ActivationLink": "Ссылка для активации",
"AddPhoto": "Добавить фотографию",
"TemporaryPassword": "Временный пароль",
@ -60,4 +59,4 @@
"Calendar": "Календарь",
"ViewAccess": "Просмотр",
"ProfileAction": "Работа с профилем"
}
}

View File

@ -32,6 +32,7 @@ class PasswordField extends React.Component {
inputTabIndex,
copyLinkText,
copiedResourceText,
t,
} = this.props;
@ -60,6 +61,7 @@ class PasswordField extends React.Component {
inputTabIndex={inputTabIndex}
onChange={inputOnChange}
clipActionResource={copyLinkText}
clipCopiedResource={copiedResourceText}
clipEmailResource={`${t("Email")}: `}
clipPasswordResource={`${t("Password")}: `}
tooltipPasswordTitle={`${t("ErrorPasswordMessage")}:`}

View File

@ -524,6 +524,7 @@ class CreateUserForm extends React.Component {
inputIsDisabled={isLoading || profile.passwordType === "link"}
inputOnChange={this.onInputChange}
copyLinkText={t("CopyEmailAndPassword")}
copiedResourceText={t("CopiedResourceText")}
inputTabIndex={4}
passwordSettings={passwordSettings}
t={t}