diff --git a/package.json b/package.json
index 379d3a1..7ac431e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "romajs",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "Roma: a TEI customization tool in React+Redux",
"main": "index.js",
"scripts": {
diff --git a/src/components/DownloadButton.js b/src/components/DownloadButton.js
index d0b91cf..18e44f6 100644
--- a/src/components/DownloadButton.js
+++ b/src/components/DownloadButton.js
@@ -8,9 +8,13 @@ import InfoDialog from './dialogs/Info'
export default class DownloadButton extends Component {
constructor(props) {
super(props)
- this.state = {
- showInfoDialog: false
+ const i18n = _i18n(this.props.language, 'DownloadButton')
+ this.initialState = {
+ showInfoDialog: false,
+ infoHeader: i18n('The customization is not valid'),
+ infoBody: i18n('errormsg')
}
+ this.state = this.initialState
}
componentDidMount() {
@@ -20,6 +24,20 @@ export default class DownloadButton extends Component {
render() {
// Set language function
const i18n = _i18n(this.props.language, 'DownloadButton')
+
+ const handleDownload = (format) => {
+ if (format === 'customization') {
+ this.props.downloadCustomization()
+ } else {
+ this.setState({
+ showInfoDialog: true,
+ infoHeader: i18n('Generating the Customization'),
+ infoBody: i18n('geninfo')
+ })
+ this.props.downloadSchema(format)
+ }
+ }
+
return (
{
@@ -34,60 +52,60 @@ export default class DownloadButton extends Component {
- {this.props.downloadCustomization()}}>
+ {handleDownload('customization')}}>
{i18n('Customization as ODD')}
- {this.props.downloadSchema('compiled.odd')}}>
+ {handleDownload('compiled.odd')}}>
{i18n('Compiled ODD')}
- {this.props.downloadSchema('rng')}}>
+ {handleDownload('rng')}}>
{i18n('RELAX NG schema')}
- {this.props.downloadSchema('rnc')}}>
+ {handleDownload('rnc')}}>
{i18n('RELAX NG compact')}
- {this.props.downloadSchema('w3c')}}>
+ {handleDownload('w3c')}}>
{i18n('W3C schema')}
- {this.props.downloadSchema('dtd')}}>
+ {handleDownload('dtd')}}>
{i18n('DTD')}
- {this.props.downloadSchema('isosch')}}>
+ {handleDownload('isosch')}}>
{i18n('ISO Schematron constraints')}
- {this.props.downloadSchema('html')}}>
+ {handleDownload('html')}}>
{i18n('Documentation as HTML')}
- {this.props.downloadSchema('tei')}}>
+ {handleDownload('tei')}}>
{i18n('Documentation as TEI Lite')}
- {this.props.downloadSchema('docx')}}>
+ {handleDownload('docx')}}>
{i18n('Documentation as MS Word')}
- {this.props.downloadSchema('latex')}}>
+ {handleDownload('latex')}}>
{i18n('Documentation as LaTeX')}
- {this.props.downloadSchema('pdf')}}>
+ {handleDownload('pdf')}}>
{i18n('Documentation as PDF')}
- {this.setState({showInfoDialog: false})}}
- header={i18n('The customization is not valid')} body={i18n('errormsg')} />
+ {this.setState(this.initialState)}}
+ header={this.state.infoHeader} body={this.state.infoBody} />
)
}
diff --git a/src/localization/i18n.json b/src/localization/i18n.json
index 549a1d8..a66f545 100644
--- a/src/localization/i18n.json
+++ b/src/localization/i18n.json
@@ -1073,6 +1073,10 @@
"zh-notchecked": "ODD不能被处理,因为它不是格式良好的XML,或者它是无效的!请检查你的定制,特别是带有XML数据的文档字段。",
"es": "El ODD no puede ser procesado porque no está bien formado XML o no es válido. Por favor, compruebe su personalización, especialmente los campos de documentación con datos XML.",
"ja": "このODDは、適格なXMLでないか、無効であるため、処理できません!カスタマイズ、特にXMLデータを含むドキュメントフィールドを確認してください。"
+ },
+ "Generating the Customization": {},
+ "geninfo": {
+ "en": "The download will begin shortly."
}
},
"FilterSearchBar": {
diff --git a/src/utils/version.js b/src/utils/version.js
index 1d861cb..9f34233 100644
--- a/src/utils/version.js
+++ b/src/utils/version.js
@@ -1,2 +1,2 @@
// Roma version
-export default '1.1.0'
+export default '1.1.1'