Spaces:
Running
Running
File size: 856 Bytes
9c791eb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# global_vars.py
import streamlit as st
def get_lang():
return st.session_state.get('lang', 'en')
def set_lang(new_lang):
st.session_state['lang'] = new_lang
# Dictionnaire de traduction global
translations = {
"en": {
"page_title": "YoutTools : YouTube Channel helpers",
"navigation": "Navigation",
"configurations": "Configurations",
"save_button": "Save Configuration",
"success_message": "Configuration saved!",
},
"fr": {
"page_title": "YoutTools : Outils pour chaîne YouTube",
"navigation": "Navigation",
"configurations": "Configurations",
"save_button": "Sauvegarder la configuration",
"success_message": "Configuration sauvegardée!",
}
}
# Fonction de traduction
def t(key: str) -> str:
return translations[get_lang()].get(key, key)
|