1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

fix translation and warnings

This commit is contained in:
Michael An
2019-05-15 14:56:46 +08:00
parent 7adccf7ee0
commit 93a99421bc
17 changed files with 26 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import copy from 'copy-to-clipboard';
import { Button, Form, FormGroup, FormText, Label, Input, InputGroup, InputGroupAddon, Alert } from 'reactstrap';
import { Button, Form, FormGroup, Label, Input, InputGroup, InputGroupAddon, Alert } from 'reactstrap';
import { gettext, shareLinkPasswordMinLength } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';

View File

@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Alert } from 'reactstrap';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import FileChooser from '../file-chooser/file-chooser';
const propTypes = {

View File

@@ -70,7 +70,7 @@ class InsertRepoImageDialog extends React.Component {
<div className="insert-image-container col-6">
{imageUrl ?
<img src={imageUrl} className='d-inline-block mh-100 mw-100' alt=''/> :
<span>{gettext("No preview")}</span>
<span>{gettext('No preview')}</span>
}
</div>
</div>

View File

@@ -99,7 +99,7 @@ class InvitePeopleDialog extends React.Component {
<label htmlFor="emails">{gettext('Emails')}</label>
<Input
type="text" id="emails"
placeholder={gettext("Emails, separated by ','")}
placeholder={gettext('Emails, separated by \',\'')}
value={this.state.emails}
onChange={this.handleEmailsChange}
onKeyDown={this.handleKeyDown}

View File

@@ -388,7 +388,7 @@ class FileChooser extends React.Component {
<Fragment>
{isPro && (
<div className="file-chooser-search-input">
<Input className="search-input" placeholder={gettext('Search...')} className="mb-2" type='text' value={this.state.searchInfo} onChange={this.onSearchInfoChanged}></Input>
<Input className="search-input mb-2" placeholder={gettext('Search...')} type='text' value={this.state.searchInfo} onChange={this.onSearchInfoChanged}></Input>
{this.state.searchInfo.length !== 0 && (
<span className="search-control attr-action-icon fas fa-times" onClick={this.onCloseSearching}></span>
)}

View File

@@ -223,7 +223,7 @@ class Search extends Component {
}
onSearchPage = () => {
window.location.href = siteRoot + 'search/'
window.location.href = siteRoot + 'search/';
}
render() {

View File

@@ -43,7 +43,7 @@ class SelectEditor extends React.Component {
this.setState({
options: this.options
})
});
}
componentWillUnmount() {

View File

@@ -18,8 +18,9 @@ const propTypes = {
onFreezedItem: PropTypes.func.isRequired,
onUnfreezedItem: PropTypes.func.isRequired,
onItemUnshare: PropTypes.func.isRequired,
onItmeDetails: PropTypes.func,
onItemDetails: PropTypes.func,
onItemRename: PropTypes.func,
onItemDelete: PropTypes.func,
};
class SharedRepoListItem extends React.Component {
@@ -333,7 +334,7 @@ class SharedRepoListItem extends React.Component {
} else {
seafileAPI.starItem(this.props.repo.repo_id, '/').then(() => {
this.setState({isStarred: !this.state.isStarred});
})
});
}
}

View File

@@ -22,8 +22,7 @@ class InvitationsToolbar extends React.Component {
return (
<div className="main-panel-north border-left-show">
<div className="cur-view-toolbar">
<span title="Side Nav Menu" onClick={onShowSidePanel}
className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none">
<span title="Side Nav Menu" onClick={onShowSidePanel} className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none">
</span>
<MediaQuery query="(min-width: 768px)">
<div className="operation">

View File

@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import ReactDOM from 'react-dom';
import axios from 'axios';
import { siteRoot, filePath, fileName, historyRepoID } from './utils/constants';
import { fileName, historyRepoID } from './utils/constants';
import { Utils } from './utils/utils';
import CommonToolbar from './components/toolbar/common-toolbar';
import SidePanel from './pages/file-history/side-panel';
@@ -52,8 +52,8 @@ class FileHistory extends React.Component {
seafileAPI.getFileContent(res1.data)
]).then(axios.spread((content1, content2) => {
this.setDiffContent(content1.data, content2.data);
}));
}));
}));
} else {
seafileAPI.getFileRevision(historyRepoID, item.commit_id, item.path).then((res) => {
axios.all([
@@ -61,7 +61,7 @@ class FileHistory extends React.Component {
]).then(axios.spread((content1) => {
this.setDiffContent(content1.data, '');
}));
})
});
}
}

View File

@@ -1,4 +1,4 @@
import React from 'react'
import React from 'react';
import { Editors } from '@seafile/react-data-grid-addons';
const EDITOR_NUMBER = 'number';
@@ -9,7 +9,7 @@ class EditorFactory {
createEditor(editorType) {
switch(editorType) {
case EDITOR_NUMBER: {
return <Editors.NumberEditor />
return <Editors.NumberEditor />;
}
case EDITOR_TEXT: {

View File

@@ -56,7 +56,7 @@ class MylibRepoMenu extends React.Component {
operations.push('Change Password');
}
if (showResetPasswordMenuItem) {
operations.push('Reset Password')
operations.push('Reset Password');
}
if (folderPermEnabled) {
operations.push('Folder Permission');
@@ -125,7 +125,7 @@ class MylibRepoMenu extends React.Component {
})}
</DropdownMenu>
</Dropdown>
)
);
}
// mobile menu

View File

@@ -138,6 +138,7 @@ const propTypes = {
onFreezedItem: PropTypes.func.isRequired,
onUnfreezedItem: PropTypes.func.isRequired,
deleteOrgLink: PropTypes.func.isRequired,
openLinkDialog: PropTypes.func.isRequired,
};
class RepoItem extends React.Component {

View File

@@ -154,7 +154,7 @@ class AdvancedSearch extends React.Component {
className="form-control search-input"
name="query"
autoComplete="off"
placeholder={gettext("Input file extensions here, separate with ','")}
placeholder={gettext('Input file extensions here, separate with \',\'')}
onChange={this.props.handlerFileTypesInput}
value={stateAndValues.input_fexts}
onKeyDown={this.props.handleKeyDown}

View File

@@ -1,5 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
@@ -11,7 +10,7 @@ import Loading from '../../components/loading';
import '../../css/search.css';
const _ = require('lodash');
const { q, repo_name, search_repo, search_ftypes } = window.search.pageOptions;
const { q, search_repo, search_ftypes } = window.search.pageOptions;
class SearchViewPanel extends React.Component {

View File

@@ -1,4 +1,4 @@
import {siteRoot, historyRepoID, fileServerRoot } from './constants';
import { siteRoot, historyRepoID } from './constants';
import { Utils } from './utils';
class URLDecorator {

View File

@@ -40,7 +40,7 @@ class CDOCEditor extends React.Component {
constructor(props) {
super(props);
this.collabServer = seafileCollabServer ? seafileCollabServer : null;
this.richEditorUtils = new RichEditorUtils(editorUtilities, this)
this.richEditorUtils = new RichEditorUtils(editorUtilities, this);
this.state = {
value: Value.create({}),
collabUsers: userInfo ?
@@ -57,7 +57,7 @@ class CDOCEditor extends React.Component {
contentChanged: false,
showShareLinkDialog: false,
isShowHistory: false,
}
};
if (this.state.collabServer) {
const socket = io(this.state.collabServer);
@@ -262,11 +262,11 @@ class CDOCEditor extends React.Component {
/>
}
</React.Fragment>
)
);
}
}
const TranslatedCDOCEditor = translate('translations')(CDOCEditor)
const TranslatedCDOCEditor = translate('translations')(CDOCEditor);
ReactDOM.render(
<I18nextProvider i18n={i18n} initialLanguage={lang} >