1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 10:22:46 +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 React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import copy from 'copy-to-clipboard'; 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 { gettext, shareLinkPasswordMinLength } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';

View File

@@ -1,8 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; 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 { gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import FileChooser from '../file-chooser/file-chooser'; import FileChooser from '../file-chooser/file-chooser';
const propTypes = { const propTypes = {

View File

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

View File

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

View File

@@ -388,7 +388,7 @@ class FileChooser extends React.Component {
<Fragment> <Fragment>
{isPro && ( {isPro && (
<div className="file-chooser-search-input"> <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 && ( {this.state.searchInfo.length !== 0 && (
<span className="search-control attr-action-icon fas fa-times" onClick={this.onCloseSearching}></span> <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 = () => { onSearchPage = () => {
window.location.href = siteRoot + 'search/' window.location.href = siteRoot + 'search/';
} }
render() { render() {

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import axios from 'axios'; import axios from 'axios';
import { siteRoot, filePath, fileName, historyRepoID } from './utils/constants'; import { fileName, historyRepoID } from './utils/constants';
import { Utils } from './utils/utils'; import { Utils } from './utils/utils';
import CommonToolbar from './components/toolbar/common-toolbar'; import CommonToolbar from './components/toolbar/common-toolbar';
import SidePanel from './pages/file-history/side-panel'; import SidePanel from './pages/file-history/side-panel';
@@ -52,8 +52,8 @@ class FileHistory extends React.Component {
seafileAPI.getFileContent(res1.data) seafileAPI.getFileContent(res1.data)
]).then(axios.spread((content1, content2) => { ]).then(axios.spread((content1, content2) => {
this.setDiffContent(content1.data, content2.data); this.setDiffContent(content1.data, content2.data);
}));
})); }));
}));
} else { } else {
seafileAPI.getFileRevision(historyRepoID, item.commit_id, item.path).then((res) => { seafileAPI.getFileRevision(historyRepoID, item.commit_id, item.path).then((res) => {
axios.all([ axios.all([
@@ -61,7 +61,7 @@ class FileHistory extends React.Component {
]).then(axios.spread((content1) => { ]).then(axios.spread((content1) => {
this.setDiffContent(content1.data, ''); 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'; import { Editors } from '@seafile/react-data-grid-addons';
const EDITOR_NUMBER = 'number'; const EDITOR_NUMBER = 'number';
@@ -9,7 +9,7 @@ class EditorFactory {
createEditor(editorType) { createEditor(editorType) {
switch(editorType) { switch(editorType) {
case EDITOR_NUMBER: { case EDITOR_NUMBER: {
return <Editors.NumberEditor /> return <Editors.NumberEditor />;
} }
case EDITOR_TEXT: { case EDITOR_TEXT: {

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,4 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment'; import moment from 'moment';
import { gettext } from '../../utils/constants'; import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
@@ -11,7 +10,7 @@ import Loading from '../../components/loading';
import '../../css/search.css'; import '../../css/search.css';
const _ = require('lodash'); 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 { 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'; import { Utils } from './utils';
class URLDecorator { class URLDecorator {

View File

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