diff --git a/scripts/boxesserver b/scripts/boxesserver
index 63bcafb..d4f7354 100755
--- a/scripts/boxesserver
+++ b/scripts/boxesserver
@@ -221,18 +221,21 @@ class BServer:
def args2html(self, name, box, lang, action="", defaults={}):
_ = lang.gettext
lang_name = lang.info().get('language', None)
+
+ langparam = ""
+ lang_attr = ""
if lang_name:
langparam = "?language=" + lang_name
- else:
- langparam = ""
+ lang_attr = f" lang=\"{lang_name}\""
result = [f"""
-
+
{_("%s - Boxes") % _(name)}
+ {self.genHTMLMetaLanguageLink()}
{self.scripts % (len(box.argparser._action_groups)-3)}
@@ -302,20 +305,23 @@ class BServer:
def menu(self, lang):
_ = lang.gettext
lang_name = lang.info().get('language', None)
+
+ langparam = ""
+ lang_attr = ""
if lang_name:
langparam = "?language=" + lang_name
- else:
- langparam = ""
+ lang_attr = f" lang=\"{lang_name}\""
result = [f"""
-
+
{_("Boxes.py")}
+ {self.genHTMLMetaLanguageLink()}
-""",
+""",
""" {self.scripts % len(self.groups)}
""")
return (s.encode("utf-8") for s in result)
+ def genHTMLMetaLanguageLink(self) -> str:
+ """Generates meta language list for search engines."""
+ languages = self.getLanguages()
- def footer(self, lang):
+ s = ""
+ for language in languages:
+ s += f"\n"
+ return s
+
+ def genHTMLLanguageSelection(self, lang) -> str:
+ """Generates a dropdown selection for the language change."""
+ current_language = lang.info().get('language', '')
+ languages = self.getLanguages()
+
+ if len(languages) < 2:
+ return ""
+
+ html_option = ""
+ for language in languages:
+ html_option += f"\n"
+
+ return """
+
+ """
+
+ def footer(self, lang) -> str:
_ = lang.gettext
- language = lang.info().get('language', '')
+
return """