Skip to content

Commit

Permalink
update err message
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwenxuan authored and zhouwenxuan committed Dec 16, 2024
1 parent 661d171 commit dc45c4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/dialog/move-dirent-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MoveDirent extends React.Component {
moveItems = () => {
let { repoID } = this.props;
let { selectedRepo, selectedPath } = this.state;
let message = 'Invalid destination path';
let message = gettext('Invalid destination path');

if (!selectedRepo || selectedPath === '') {
this.setErrMessage(message);
Expand Down Expand Up @@ -132,7 +132,7 @@ class MoveDirent extends React.Component {
});

if (isChildPath) {
message = 'Can not move folder %(src)s to its subfolder %(des)s';
message = gettext('Can not move folder %(src)s to its subfolder %(des)s');
message = message.replace('%(src)s', moveDirentPath);
message = message.replace('%(des)s', selectedPath);
this.setErrMessage(message);
Expand All @@ -147,7 +147,7 @@ class MoveDirent extends React.Component {
let { repoID } = this.props;
let { selectedRepo, selectedPath } = this.state;
let direntPath = Utils.joinPath(this.props.path, this.props.dirent.name);
let message = 'Invalid destination path';
let message = gettext('Invalid destination path');

if (!selectedRepo || (selectedRepo.repo_id === repoID && selectedPath === '')) {
this.setErrMessage(message);
Expand Down Expand Up @@ -196,7 +196,7 @@ class MoveDirent extends React.Component {
};

setErrMessage = (message) => {
this.setState({ errMessage: gettext(message) });
this.setState({ errMessage: message });
};

clearErrMessage = () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/dialog/select-dirent-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SelectDirentBody extends React.Component {

createFolder = (fullPath) => {
if (!this.props.selectedRepo) {
this.props.setErrMessage('Please select a library or folder first.');
this.props.setErrMessage(gettext('Please select a library or folder first.'));
return;
}
this.newFolderName = fullPath.split('/').pop();
Expand Down

0 comments on commit dc45c4d

Please sign in to comment.