diff --git a/app/plugins/templates/webpack.config.js.tmpl b/app/plugins/templates/webpack.config.js.tmpl index e18da936..a6e362cf 100644 --- a/app/plugins/templates/webpack.config.js.tmpl +++ b/app/plugins/templates/webpack.config.js.tmpl @@ -84,8 +84,7 @@ module.exports = { "PluginsAPI": "PluginsAPI", "leaflet": "leaflet", "ReactDOM": "ReactDOM", - "React": "React", - "gettext": "gettext" + "React": "React" }, watchOptions: { diff --git a/app/static/app/js/Dashboard.jsx b/app/static/app/js/Dashboard.jsx index c4444967..d752b2c4 100644 --- a/app/static/app/js/Dashboard.jsx +++ b/app/static/app/js/Dashboard.jsx @@ -8,6 +8,7 @@ import { Route } from 'react-router-dom'; import $ from 'jquery'; +import { _ } from './classes/gettext'; class Dashboard extends React.Component { constructor(){ @@ -22,7 +23,7 @@ class Dashboard extends React.Component { } addNewProject(project){ - if (!project.name) return (new $.Deferred()).reject("Name field is required"); + if (!project.name) return (new $.Deferred()).reject(_("Name field is required")); return $.ajax({ url: `/api/projects/`, @@ -57,7 +58,7 @@ class Dashboard extends React.Component { className="btn btn-primary btn-sm" onClick={this.handleAddProject}> - Add Project + {_("Add Project")} @@ -92,7 +93,7 @@ $(function(){ // Do nothing } }); - return found ? "Your changes will be lost. Are you sure you want to leave?" : undefined; + return found ? _("Your changes will be lost. Are you sure you want to leave?") : undefined; }; }); diff --git a/app/static/app/js/classes/plugins/API.js b/app/static/app/js/classes/plugins/API.js index 7e3576d9..259dcc2d 100644 --- a/app/static/app/js/classes/plugins/API.js +++ b/app/static/app/js/classes/plugins/API.js @@ -23,7 +23,6 @@ if (!window.PluginsAPI){ 'leaflet': { loader: 'globals-loader', exports: 'L' }, 'ReactDOM': { loader: 'globals-loader', exports: 'ReactDOM' }, 'React': { loader: 'globals-loader', exports: 'React' }, - 'gettext': { loader: 'globals-loader', exports: 'gettext' }, 'SystemJS': { loader: 'globals-loader', exports: 'SystemJS' } } }); diff --git a/app/static/app/js/components/EditProjectDialog.jsx b/app/static/app/js/components/EditProjectDialog.jsx index a22f74d0..2f24012e 100644 --- a/app/static/app/js/components/EditProjectDialog.jsx +++ b/app/static/app/js/components/EditProjectDialog.jsx @@ -1,18 +1,17 @@ import React from 'react'; -import ErrorMessage from './ErrorMessage'; import FormDialog from './FormDialog'; import PropTypes from 'prop-types'; -import $ from 'jquery'; +import { _ } from '../classes/gettext'; class EditProjectDialog extends React.Component { static defaultProps = { projectName: "", projectDescr: "", - title: "New Project", - saveLabel: "Create Project", - savingLabel: "Creating project...", + title: _("New Project"), + saveLabel: _("Create Project"), + savingLabel: _("Creating project..."), saveIcon: "glyphicon glyphicon-plus", - deleteWarning: "All tasks, images and models associated with this project will be permanently deleted. Are you sure you want to continue?", + deleteWarning: _("All tasks, images and models associated with this project will be permanently deleted. Are you sure you want to continue?"), show: false }; @@ -83,13 +82,13 @@ class EditProjectDialog extends React.Component { onShow={this.onShow} ref={(domNode) => { this.dialog = domNode; }}>
- +
{ this.nameInput = domNode; }} value={this.state.name} onChange={this.handleChange('name')} />
- +