langcode-search / app.py
cdleong's picture
Update app.py
a397155
raw
history blame
No virus
452 Bytes
import streamlit as st
import langcodes
# https://huggingface.co/blog/streamlit-spaces
langtext = st.text_area("language code", "en")
found = langcodes.find(langtext)
display = found.display_name()
if tag_is_valid('langtext'):
st.write(f"{langtext} is a valid BCP-47 language code")
else:
st.write(f"{langtext} is not a valid BCP-47 language code")
st.write(f"langcodes found the following tag: {found}")
st.write(f"Display name: {display}")