Spaces:
Sleeping
Sleeping
rafaldembski
commited on
Commit
•
4247fc5
1
Parent(s):
fda5040
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ import os
|
|
15 |
|
16 |
# 1. Konfiguracja strony - musi być pierwszym poleceniem Streamlit
|
17 |
st.set_page_config(
|
18 |
-
page_title="📱
|
19 |
page_icon="📱",
|
20 |
layout="wide"
|
21 |
)
|
@@ -40,6 +40,7 @@ st.markdown(hide_sidebar_style, unsafe_allow_html=True)
|
|
40 |
translations = {
|
41 |
'Polish': {
|
42 |
'menu_analysis_sms': 'Analiza wiadomości',
|
|
|
43 |
'menu_about': 'O Projekcie',
|
44 |
'menu_education': 'Edukacja',
|
45 |
'menu_statistics': 'Statystyki',
|
@@ -50,6 +51,7 @@ translations = {
|
|
50 |
},
|
51 |
'German': {
|
52 |
'menu_analysis_sms': 'SMS-Analyse',
|
|
|
53 |
'menu_about': 'Über das Projekt',
|
54 |
'menu_education': 'Bildung',
|
55 |
'menu_statistics': 'Statistiken',
|
@@ -60,6 +62,7 @@ translations = {
|
|
60 |
},
|
61 |
'English': {
|
62 |
'menu_analysis_sms': 'SMS Analysis',
|
|
|
63 |
'menu_about': 'About the Project',
|
64 |
'menu_education': 'Education',
|
65 |
'menu_statistics': 'Statistics',
|
@@ -90,7 +93,14 @@ st.markdown(f"**{translations[selected_language]['language_selected']} {selected
|
|
90 |
st.markdown("---")
|
91 |
|
92 |
# 6. Pobranie przetłumaczonych opcji menu
|
93 |
-
menu_keys = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
menu_options = [translations[selected_language][key] for key in menu_keys]
|
95 |
|
96 |
# 7. Dodanie niestandardowego CSS do wzmocnienia stylów menu
|
@@ -165,7 +175,7 @@ with st.container():
|
|
165 |
selected = option_menu(
|
166 |
menu_title=None, # Brak tytułu menu
|
167 |
options=menu_options,
|
168 |
-
icons=["shield-check", "info-circle", "book", "bar-chart", "envelope"],
|
169 |
menu_icon=None, # Usunięcie ikony menu
|
170 |
default_index=0,
|
171 |
orientation="horizontal",
|
@@ -199,6 +209,9 @@ try:
|
|
199 |
if selected == translations[selected_language]['menu_analysis_sms']:
|
200 |
from pages.Analysis import show_analysis
|
201 |
show_analysis(selected_language)
|
|
|
|
|
|
|
202 |
elif selected == translations[selected_language]['menu_about']:
|
203 |
from pages.About import main as show_about
|
204 |
show_about(selected_language)
|
@@ -215,4 +228,3 @@ except ImportError as e:
|
|
215 |
st.error(f"Błąd importu: {e}")
|
216 |
except TypeError as e:
|
217 |
st.error(f"Błąd wywołania funkcji: {e}")
|
218 |
-
|
|
|
15 |
|
16 |
# 1. Konfiguracja strony - musi być pierwszym poleceniem Streamlit
|
17 |
st.set_page_config(
|
18 |
+
page_title="📱 Scam Detector",
|
19 |
page_icon="📱",
|
20 |
layout="wide"
|
21 |
)
|
|
|
40 |
translations = {
|
41 |
'Polish': {
|
42 |
'menu_analysis_sms': 'Analiza wiadomości',
|
43 |
+
'menu_search_number': 'Wyszukaj numer',
|
44 |
'menu_about': 'O Projekcie',
|
45 |
'menu_education': 'Edukacja',
|
46 |
'menu_statistics': 'Statystyki',
|
|
|
51 |
},
|
52 |
'German': {
|
53 |
'menu_analysis_sms': 'SMS-Analyse',
|
54 |
+
'menu_search_number': 'Nummernsuche',
|
55 |
'menu_about': 'Über das Projekt',
|
56 |
'menu_education': 'Bildung',
|
57 |
'menu_statistics': 'Statistiken',
|
|
|
62 |
},
|
63 |
'English': {
|
64 |
'menu_analysis_sms': 'SMS Analysis',
|
65 |
+
'menu_search_number': 'Search Number',
|
66 |
'menu_about': 'About the Project',
|
67 |
'menu_education': 'Education',
|
68 |
'menu_statistics': 'Statistics',
|
|
|
93 |
st.markdown("---")
|
94 |
|
95 |
# 6. Pobranie przetłumaczonych opcji menu
|
96 |
+
menu_keys = [
|
97 |
+
'menu_analysis_sms',
|
98 |
+
'menu_search_number', # Newly added for number search
|
99 |
+
'menu_about',
|
100 |
+
'menu_education',
|
101 |
+
'menu_statistics',
|
102 |
+
'menu_contact'
|
103 |
+
]
|
104 |
menu_options = [translations[selected_language][key] for key in menu_keys]
|
105 |
|
106 |
# 7. Dodanie niestandardowego CSS do wzmocnienia stylów menu
|
|
|
175 |
selected = option_menu(
|
176 |
menu_title=None, # Brak tytułu menu
|
177 |
options=menu_options,
|
178 |
+
icons=["shield-check", "search", "info-circle", "book", "bar-chart", "envelope"],
|
179 |
menu_icon=None, # Usunięcie ikony menu
|
180 |
default_index=0,
|
181 |
orientation="horizontal",
|
|
|
209 |
if selected == translations[selected_language]['menu_analysis_sms']:
|
210 |
from pages.Analysis import show_analysis
|
211 |
show_analysis(selected_language)
|
212 |
+
elif selected == translations[selected_language]['menu_search_number']:
|
213 |
+
from pages.SearchNumber import show_number_search
|
214 |
+
show_number_search(selected_language)
|
215 |
elif selected == translations[selected_language]['menu_about']:
|
216 |
from pages.About import main as show_about
|
217 |
show_about(selected_language)
|
|
|
228 |
st.error(f"Błąd importu: {e}")
|
229 |
except TypeError as e:
|
230 |
st.error(f"Błąd wywołania funkcji: {e}")
|
|