From 65c41bb20c54a67a5d2b2eb47ddcbd623af23ff7 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Wed, 22 Nov 2023 21:48:35 +0100 Subject: [PATCH] Added translations to the search que page and the about page. (#407) --- .../ui/assets/typography.css | 14 ++++- .../ui/pages/about.py | 42 +++++++-------- .../ui/pages/search_queue.py | 53 +++++++++++++------ 3 files changed, 71 insertions(+), 38 deletions(-) diff --git a/src/aki_prj23_transparenzregister/ui/assets/typography.css b/src/aki_prj23_transparenzregister/ui/assets/typography.css index c8129d3..a41fea7 100644 --- a/src/aki_prj23_transparenzregister/ui/assets/typography.css +++ b/src/aki_prj23_transparenzregister/ui/assets/typography.css @@ -2,6 +2,18 @@ body { margin: 0; } -.normal_h3 { +.about-content { + float:left; + margin: 20px; + color: var(--raisin-black); +} + +.about-content .normal_h3 { margin: 0; } + +.search-content { + float:left; + margin: 20px; + color: var(--raisin-black); +} diff --git a/src/aki_prj23_transparenzregister/ui/pages/about.py b/src/aki_prj23_transparenzregister/ui/pages/about.py index 144e536..dce09a9 100644 --- a/src/aki_prj23_transparenzregister/ui/pages/about.py +++ b/src/aki_prj23_transparenzregister/ui/pages/about.py @@ -25,30 +25,30 @@ def layout() -> html.Div: Returns: A list of html element making up this page. """ - git_revision = os.getenv("GIT_HASH", "Running locally") - for _ in "',()": - git_revision = git_revision.replace(_, "") - - git_revision = git_revision.strip() + git_revision = os.getenv("GIT_HASH", "Local Start").strip(" ,'()") return html.Div( children=[ - header_elements.create_selection_header("About"), - html.H3("About Us", className="normal_h3"), - html.H3("Description"), - html.P(_DISTRIBUTION_METADATA["Summary"]), - html.H3("Key Features", className="normal_h3"), - html.Ul( - [ - html.Li("Some feature."), - ] - ), - html.H3("Version", className="normal_h3"), - html.Ul( - [ - html.Li(f"Software Version: {__version__}"), - html.Li(f"Build from GiT Revision: {git_revision}"), - ] + header_elements.create_selection_header("Über uns"), + html.Div( + className="about-content", + children=[ + html.H3("Beschreibung", className="normal_h3"), + html.P(_DISTRIBUTION_METADATA["Summary"]), + html.H3("Key Features", className="normal_h3"), + html.Ul( + [ + html.Li("Einige Funktionen"), + ] + ), + html.H3("Version", className="normal_h3"), + html.Ul( + [ + html.Li(f"Softwareversion: {__version__}"), + html.Li(f"Gebaut aus GiT Revision: {git_revision}"), + ] + ), + ], ), ] ) diff --git a/src/aki_prj23_transparenzregister/ui/pages/search_queue.py b/src/aki_prj23_transparenzregister/ui/pages/search_queue.py index 0dddd94..96fa9ff 100644 --- a/src/aki_prj23_transparenzregister/ui/pages/search_queue.py +++ b/src/aki_prj23_transparenzregister/ui/pages/search_queue.py @@ -9,7 +9,9 @@ from aki_prj23_transparenzregister.ui import header_elements from aki_prj23_transparenzregister.ui.session_handler import SessionHandler from aki_prj23_transparenzregister.utils.sql import entities -dash.register_page(__name__, path_template="/search/", title="Add data mining Job") +dash.register_page( + __name__, path_template="/search/", title="Data-Mining-Job hinzufügen" +) @lru_cache @@ -21,22 +23,41 @@ def layout() -> html.Div: """ return html.Div( children=[ - header_elements.create_selection_header("Search more companies"), - html.H3( - "Please enter a Company to add to the search queue.", - className="normal_h3", + header_elements.create_selection_header( + "Weitere Unternehmen im Transparenzregister aufnehmen" ), - html.P( - "If a term is entered to the search queue data for that company will be searched for on the next run." + html.Div( + className="search-content", + children=[ + html.H3( + "Bitte geben Sie ein Unternehmen ein, um einen Data-Mining-Job hinzuzufügen!", + className="normal_h3", + ), + html.P( + "Wenn ein Begriff zur Suchwarteschlange hinzugefügt wird, " + "werden Daten für dieses Unternehmen beim nächsten Lauf gesucht." + ), + html.P( + "Wenn bereits nach dem Unternehmen gesucht wurde, wird dies zurückgesetzt und die Priorität erhöht." + ), + html.P( + "Bitte beachten Sie, dass es einen Tag dauern kann, " + "bis Ihre abgefragten Daten abgebaut und verarbeitet sind." + ), + dcc.Input( + id="input-text", + type="text", + placeholder=" Weitere Unternehmen hinzufügen", + debounce=True, + style={ + "width": "200px", + "height": "20px", + "border": "1px solid", + }, + ), + html.P("", id="response"), + ], ), - html.P( - "If the company was already searched for this is being reset and the priority is increased." - ), - html.P( - "Please note that it can take a day until your queried data is mined and processed." - ), - dcc.Input(id="input-text", type="text", placeholder="", debounce=True), - html.P("", id="response"), ] ) @@ -63,4 +84,4 @@ def add_company_to_search_que(input_text: str | None) -> NoUpdate | list[str | h else: db.add(entities.MissingCompany(name=input_text, number_of_links=1000)) db.commit() - return ["Added: ", html.B(input_text), " to the search que."] + return [html.B(input_text), " als Data-Mining-Job hinzugefügt."]