diff --git a/package_build/i18n.py b/package_build/i18n.py index 075138f..d7b9474 100644 --- a/package_build/i18n.py +++ b/package_build/i18n.py @@ -2,23 +2,22 @@ import time from pathlib import Path -import streamlit as st from streamlit_javascript import st_javascript -with st.empty(): - @st.cache_resource - def get_preferred_languages() -> list[str]: - while True: - languages = st_javascript("navigator.languages") - if languages: - return languages - time.sleep(0.1) +def get_preferred_languages() -> list[str]: + while True: + languages = st_javascript("navigator.languages") + if languages: + return languages + + time.sleep(0.1) locale_dir = Path(__file__).parent / "locale" languages = get_preferred_languages() + lang = gettext.translation( "messages", localedir=str(locale_dir),