Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,6 +96,7 @@ st.markdown("Translate from Docx file")
|
|
| 96 |
st.subheader("File Upload")
|
| 97 |
|
| 98 |
datas=st.file_uploader("Original File")
|
|
|
|
| 99 |
#data=getText("C:\Users\Ambresh C\Desktop\Python Files\Translators\Trail Doc of 500 words.docx")
|
| 100 |
#if datas :
|
| 101 |
#if st.button(label='Data Process'):
|
|
@@ -105,7 +106,7 @@ if st.button(label='Translate'):
|
|
| 105 |
btTranslator(datas).save(binary_output)
|
| 106 |
st.success("Translated")
|
| 107 |
|
| 108 |
-
st.download_button(label='Download Translated File',file_name=
|
| 109 |
#else:
|
| 110 |
# st.text('Upload File and Start the process')
|
| 111 |
|
|
|
|
| 96 |
st.subheader("File Upload")
|
| 97 |
|
| 98 |
datas=st.file_uploader("Original File")
|
| 99 |
+
name=st.text('Enter New File Name: ')
|
| 100 |
#data=getText("C:\Users\Ambresh C\Desktop\Python Files\Translators\Trail Doc of 500 words.docx")
|
| 101 |
#if datas :
|
| 102 |
#if st.button(label='Data Process'):
|
|
|
|
| 106 |
btTranslator(datas).save(binary_output)
|
| 107 |
st.success("Translated")
|
| 108 |
|
| 109 |
+
st.download_button(label='Download Translated File',file_name=(f"{name}_Translated.docx"), data=binary_output.getvalue())
|
| 110 |
#else:
|
| 111 |
# st.text('Upload File and Start the process')
|
| 112 |
|