How to change text language in a widgets?

Hello! I am creating a streamlit application and using a language other than English in the interface. But some widgets like st.file_uploader have english description inside of it. Is there any way to change the text used by the widget?

Hi @Chrome1278,

There isn’t a built-in way to do this currently, but this would make a great feature enhancement request – feel free to submit one here

1 Like

You can circumvent not having that feature with a little css if you want:

css='''
<style>
[data-testid="stFileUploadDropzone"] div div::before {color:red; content:"This text replaces Drag and drop file here"}
[data-testid="stFileUploadDropzone"] div div span{display:none;}
[data-testid="stFileUploadDropzone"] div div::after {color:red; font-size: .8em; content:"This text replaces Limit 200MB per file"}
[data-testid="stFileUploadDropzone"] div div small{display:none;}
</style>
'''

st.markdown(css, unsafe_allow_html=True)

image

2 Likes