diff --git a/app/helpers/check_functions.py b/app/helpers/check_functions.py index 14b6553..aeaa77b 100644 --- a/app/helpers/check_functions.py +++ b/app/helpers/check_functions.py @@ -3,6 +3,7 @@ from flask import abort +from app.helpers.description import find_descripton_file from app.icon_set import get_icon_set logger = logging.getLogger(__name__) @@ -88,3 +89,19 @@ def get_and_check_icon(icon_set, icon_name): logger.error("The icon doesn't exist: %s", path) abort(404, "Icon not found in icon set") return icon + + +def check_if_descripton_file_exists(icon_set): + """ + Checks that the icon set has a corresponding dictionary containing description for all available + languages. + if not raises a flask error and abort the current request. + + Args: + icon_set: (IconSet) the icon set of which we want to check if it has a description file + """ + # checking that the icon exists in the icon set's folder + path = find_descripton_file(icon_set) + if not os.path.isfile(path): + logger.error("The description dictionary doesn't exist: %s", path) + abort(404, "Description dictionary not found") diff --git a/app/helpers/description.py b/app/helpers/description.py new file mode 100644 index 0000000..ffdd01d --- /dev/null +++ b/app/helpers/description.py @@ -0,0 +1,55 @@ +import json +import logging +import os + +from flask import abort + +from app.settings import DESCRIPTION_FOLDER + +logger = logging.getLogger(__name__) + + +def get_icon_set_description(icon_set=''): + ''' + Return json containing the description in all available languages for all icons of the + provided icon set + ''' + path = find_descripton_file(icon_set) + if not os.path.isfile(path): + return None + + with open(path, encoding='utf-8') as f: + icon_set_descriptions = json.load(f) + + return icon_set_descriptions + + +def get_icon_description(icon_name='', icon_set=''): + ''' + Return json containing the description in all available languages for an icon in the specified + icon set + ''' + path = find_descripton_file(icon_set) + if not os.path.isfile(path): + return None + + with open(path, encoding='utf-8') as f: + df = json.load(f) + + try: + icon_description = df[icon_name] + except KeyError: + logger.error("Description for icon not found: %s", icon_name) + abort(404, "Description for icon not found") + + return icon_description + + +def find_descripton_file(icon_set): + ''' + Return file path of description file if it exists or False in case it doesn't + ''' + path = os.path.abspath(os.path.join(DESCRIPTION_FOLDER, icon_set)) + '-dictionary.json' + if os.path.isfile(path): + return path + return False diff --git a/app/icon.py b/app/icon.py index c06f08f..6301bbd 100644 --- a/app/icon.py +++ b/app/icon.py @@ -2,6 +2,7 @@ from flask import url_for +from app.helpers.description import get_icon_description from app.helpers.icons import get_icon_template_url from app.helpers.url import get_base_url from app.settings import DEFAULT_COLOR @@ -97,5 +98,6 @@ def serialize(self): "anchor": self.anchor, "icon_set": self.icon_set.name, "url": self.get_icon_url(), - "template_url": get_icon_template_url(get_base_url()) + "template_url": get_icon_template_url(get_base_url()), + "description": get_icon_description(self.name, self.icon_set.name) } diff --git a/app/icon_set.py b/app/icon_set.py index 5205f0e..d16ff8e 100644 --- a/app/icon_set.py +++ b/app/icon_set.py @@ -2,6 +2,8 @@ from flask import url_for +from app.helpers.description import find_descripton_file +from app.helpers.description import get_icon_set_description from app.helpers.icons import get_icon_set_template_url from app.helpers.url import get_base_url from app.icon import Icon @@ -76,6 +78,19 @@ def get_icons_url(self): """ return url_for('icons_from_icon_set', icon_set_name=self.name, _external=True) + def get_icon_set_description_url(self): + """ + Generate and return the URL that will list the description in all available lanaguages + of all available icons of this icon set. + + Returns: + the URL to the description in all available languages of all icons in this icon set if + it exists, otherwise return None + """ + if find_descripton_file(self.name): + return url_for('description_from_icon_set', icon_set_name=self.name, _external=True) + return None + def get_icon(self, icon_name): """ Generate and return the URL to access the metadata of one specific icon of this icon set @@ -112,6 +127,19 @@ def get_all_icons(self): icons.append(self.get_icon(name_without_extension)) return icons + def get_description(self): + """ + Generate a dictionary containing the description in all available languages of all icons + belonging to this icon set. + + Returns: + A dictionary of all icon description in all available languages from this icon set it + it exists, otherwise return None + """ + if not self.is_valid(): + return None + return get_icon_set_description(self.name) + def serialize(self): """ As we want to add "icons_url" to the __dict__, we can't really use a json.dumps to generate @@ -126,5 +154,6 @@ def serialize(self): "name": self.name, "colorable": self.colorable, "icons_url": self.get_icons_url(), - "template_url": get_icon_set_template_url(get_base_url()) + "template_url": get_icon_set_template_url(get_base_url()), + "description_url": self.get_icon_set_description_url() } diff --git a/app/routes.py b/app/routes.py index 20b0c6c..4cc6439 100644 --- a/app/routes.py +++ b/app/routes.py @@ -9,6 +9,7 @@ from app import app from app.helpers.check_functions import check_color_channels +from app.helpers.check_functions import check_if_descripton_file_exists from app.helpers.check_functions import check_scale from app.helpers.check_functions import get_and_check_icon from app.helpers.check_functions import get_and_check_icon_set @@ -58,6 +59,13 @@ def icons_from_icon_set(icon_set_name): return make_api_compliant_response(icon_set.get_all_icons()) +@app.route('/sets//description', methods=['GET']) +def description_from_icon_set(icon_set_name): + icon_set = get_and_check_icon_set(icon_set_name) + check_if_descripton_file_exists(icon_set_name) + return make_api_compliant_response(icon_set.get_description()) + + @app.route('/sets//icons/', methods=['GET']) def icon_metadata(icon_set_name, icon_name): icon_set = get_and_check_icon_set(icon_set_name) diff --git a/app/settings.py b/app/settings.py index 4d90c9d..02f5f65 100644 --- a/app/settings.py +++ b/app/settings.py @@ -10,6 +10,9 @@ load_dotenv(ENV_FILE, override=True, verbose=True) IMAGE_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), '../static/images/')) +DESCRIPTION_FOLDER = os.path.abspath( + os.path.join(os.path.dirname(__file__), '../metadata/description/') +) COLORABLE_ICON_SETS = ['default'] DEFAULT_COLOR = {"r": '255', "g": '0', "b": '0'} diff --git a/metadata/description/babs-D-dictionary.json b/metadata/description/babs-D-dictionary.json new file mode 100644 index 0000000..3acb00f --- /dev/null +++ b/metadata/description/babs-D-dictionary.json @@ -0,0 +1,582 @@ +{ + "001-D-Beschaedigung": { + "de": "Besch\u00e4digung", + "fr": "D\u00e9g\u00e2t", + "it": "Danneggiamento" + }, + "002-D-Teilzerstoerung": { + "de": "Teilzerst\u00f6rung", + "fr": "Destruction partielle", + "it": "Distruzione parziale" + }, + "003-D-Totalzerstoerung": { + "de": "Totalzerst\u00f6rung", + "fr": "Destruction totale", + "it": "Distruzione totale" + }, + "004-D-Brand-einzelnes-Gebaeude-Flamme": { + "de": "Brand einzelnes Geb\u00e4ude", + "fr": "Incendie isol\u00e9", + "it": "Incendio di un singolo edificio" + }, + "005-D-Explosionsherd": { + "de": "Explosionsherd", + "fr": "Foyer d'explosion", + "it": "Focolaio esplosione" + }, + "006-D-Verletzte": { + "de": "Verletzte", + "fr": "Bless\u00e9s", + "it": "Feriti" + }, + "007-D-Eingesperrte": { + "de": "Eingesperrte", + "fr": "Enferm\u00e9s", + "it": "Persone imprigionate" + }, + "008-D-Obdachlose": { + "de": "Obdachlose", + "fr": "Sans abri", + "it": "Senzatetto" + }, + "009-D-Tote": { + "de": "Tote", + "fr": "Morts", + "it": "Morti" + }, + "010-D-Vermisste": { + "de": "Vermisste", + "fr": "Disparus", + "it": "Dispersi" + }, + "011-D-Armee": { + "de": "Armee", + "fr": "Arm\u00e9e", + "it": "Esercito" + }, + "012-D-Polizei": { + "de": "Polizei", + "fr": "Police", + "it": "Polizia" + }, + "013-D-Zivilschutz": { + "de": "Zivilschutz", + "fr": "Protection civile", + "it": "Protezione civile" + }, + "014-D-Sanitaer": { + "de": "Sanit\u00e4r", + "fr": "Sanitaire", + "it": "Sanit\u00e0" + }, + "015-D-Feuerwehr": { + "de": "Feuerwehr", + "fr": "Sapeurs-pompiers", + "it": "Corpo pompieri" + }, + "016-D-TechnB": { + "de": "Technische Betriebe", + "fr": "Services techniques", + "it": "Servizi tecniche" + }, + "017-D-Unfall": { + "de": "Unfall", + "fr": "Accident", + "it": "Incidente" + }, + "018-D-Chemikalien": { + "de": "Chemikalien", + "fr": "Chimique", + "it": "Sostanze chimiche" + }, + "019-D-Elektrizitaet": { + "de": "Elektrizit\u00e4t", + "fr": "Electricit\u00e9", + "it": "Elettricit\u00e0" + }, + "020-D-Explosion": { + "de": "Explosion", + "fr": "Explosion", + "it": "Esplosione" + }, + "021-D-Gas": { + "de": "Gas", + "fr": "Gaz", + "it": "Gas" + }, + "022-D-Gefahr-durch-Loeschen-mit-Wasser": { + "de": "Gefahr durch L\u00f6schen mit Wasser", + "fr": "Danger si extinction avec eau", + "it": "Pericolo spegnimento con acqua" + }, + "023-D-Radioaktive-Stoffe": { + "de": "Radioaktive Stoffe", + "fr": "Substances radioactives", + "it": "Sostanze radioattive" + }, + "024-D-Gefahr-fuer-Grundwasser": { + "de": "Gefahr f\u00fcr Grundwasser", + "fr": "Danger pour les eaux", + "it": "Pericolo per le acque" + }, + "025-D-KFO": { + "de": "KFO", + "fr": "OCC", + "it": "OCCt" + }, + "026-D-RFO": { + "de": "RFO", + "fr": "OCRg", + "it": "OCRg" + }, + "027-D-GFO": { + "de": "GFO", + "fr": "OCCm", + "it": "OCCm" + }, + "028-D-EZ": { + "de": "EZ", + "fr": "CE", + "it": "CI" + }, + "029-D-MEZ": { + "de": "MEZ", + "fr": "CEM", + "it": "CIM" + }, + "030-D-EL": { + "de": "EL", + "fr": "DI", + "it": "DI" + }, + "031-D-Rueck": { + "de": "R\u00fcck", + "fr": "PCO", + "it": "Posto comando operazioni" + }, + "032-D-Front": { + "de": "Front", + "fr": "PCE", + "it": "Posto comando intervento" + }, + "033-D-Informationsstelle": { + "de": "Informationsstelle", + "fr": "Point d'information", + "it": "Posto d'informazione" + }, + "034-D-Sammelstelle": { + "de": "Sammelstelle", + "fr": "Poste collecteur", + "it": "Posto collettore" + }, + "035-D-Betreuungsstelle": { + "de": "Betreuungsstelle", + "fr": "Poste d'assistance", + "it": "Posto d'assistenza" + }, + "036-D-Patientensammelstelle": { + "de": "Patientensammelstelle", + "fr": "Poste collecteur de patients", + "it": "Posto collettore dei pazienti" + }, + "037-D-Sanitaetshilfsstelle": { + "de": "Sanit\u00e4tshilfsstelle", + "fr": "Poste m\u00e9dical avanc\u00e9", + "it": "Posto di soccorso sanitario" + }, + "038-D-Totensammelstelle": { + "de": "Totensammelstelle", + "fr": "Poste collecteur de cadavres", + "it": "Posto colletore dei morti" + }, + "039-D-Verpflegungsabgabestelle": { + "de": "Verpflegungsabgabestelle", + "fr": "Poste de distribution", + "it": "Posto distribuzione sussistenza" + }, + "040-D-Betriebsstoffabgabestelle": { + "de": "Betriebsstoffabgabestelle", + "fr": "Station de carburant", + "it": "Posto distribuzione carburante" + }, + "041-D-KGS-Notdepot": { + "de": "KGS Notdepot", + "fr": "D\u00e9p\u00f4t d'urgence PBC", + "it": "Deposito PBC di fortuna" + }, + "042-D-Pforte": { + "de": "Pforte", + "fr": "Porte", + "it": "Porta" + }, + "043-D-Umleitung": { + "de": "Umleitung", + "fr": "D\u00e9viations", + "it": "Deviazione" + }, + "044-D-Absperrung-Verkehrswege": { + "de": "Absperrung Verkehrswege", + "fr": "Fermeture de la route", + "it": "Sbarramento vie comunicazione" + }, + "045-D-Sperre": { + "de": "Sperre", + "fr": "Barrage", + "it": "Sbarramento" + }, + "046-D-Helikopterlandeplatz": { + "de": "Helikopterlandeplatz", + "fr": "Place d'atterrissage H\u00e9lico", + "it": "Piazza d'atterraggio elicotteri" + }, + "047-D-Fahrzeugplatz": { + "de": "Fahrzeugplatz", + "fr": "Place pour v\u00e9hicules", + "it": "Posteggio veicoli" + }, + "048-D-Materialdepot": { + "de": "Materialdepot", + "fr": "D\u00e9p\u00f4t mat\u00e9riel", + "it": "Deposito del materiale" + }, + "049-D-Beobachtung": { + "de": "Beobachtung", + "fr": "Observation", + "it": "Osservazione" + }, + "050-D-Ueberwachung": { + "de": "\u00dcberwachung", + "fr": "Surveillance", + "it": "Sorveglianza" + }, + "051-D-Sturm": { + "de": "Sturm", + "fr": "Temp\u00eate", + "it": "Tempesta" + }, + "052-D-Ueberschwemmung": { + "de": "\u00dcberschwemmung", + "fr": "Inondation", + "it": "Piena" + }, + "053-D-Erdrutsch": { + "de": "Erdrutsch", + "fr": "Glissement de terrain", + "it": "Frana" + }, + "054-D-Lawine": { + "de": "Lawine", + "fr": "Avalanche", + "it": "Valanga" + }, + "055-D-Gebaeudeeinsturz": { + "de": "Geb\u00e4udeeinsturz", + "fr": "Immeuble effondr\u00e9", + "it": "Crollo di edificio" + }, + "056-D-Starkniederschlag": { + "de": "Starkniederschlag", + "fr": "Fortes pr\u00e9cipitations", + "it": "Piogge intense" + }, + "057-D-Brand": { + "de": "Brand", + "fr": "Incendie", + "it": "Incendio" + }, + "058-D-Explosion-pikt": { + "de": "Explosion", + "fr": "Explosion", + "it": "Esplosione" + }, + "059-D-Stau": { + "de": "Stau", + "fr": "Embouteillage", + "it": "Colonna" + }, + "060-D-Autounfall": { + "de": "Autounfall", + "fr": "Accident auto", + "it": "Incidente della circolazione" + }, + "061-D-Eisenbahnunglueck": { + "de": "Eisenbahnungl\u00fcck", + "fr": "Accident ferroviaire", + "it": "Incidente ferroviario" + }, + "062-D-Kanalisationsausfall": { + "de": "Kanalisationsausfall", + "fr": "Egouts d\u00e9fectueux", + "it": "Interruzione della canalizzazione" + }, + "063-D-Atomunfall": { + "de": "Atomunfall", + "fr": "Accident nucl\u00e9aire", + "it": "Incidente nucleare" + }, + "064-D-Biounfall": { + "de": "Biounfall", + "fr": "Accident biologique", + "it": "Incidente biologico" + }, + "065-D-Oelverschmutzung": { + "de": "\u00d6lverschmutzung", + "fr": "Pollution aux hydrocarbures", + "it": "Inquinamento da idrocarburi" + }, + "066-D-Infrastrukturschaden": { + "de": "Infrastrukturschaden", + "fr": "Dommages aux infrastructures", + "it": "Danni alle infrastrutture" + }, + "067-D-Schiffsversenkung": { + "de": "Schiffsversenkung", + "fr": "Accident navigation", + "it": "Incidente nautico" + }, + "068-D-Chemieunfall": { + "de": "Chemieunfall", + "fr": "Accident chimique", + "it": "Incidente chimico" + }, + "069-D-Pluenderung": { + "de": "Pl\u00fcnderung", + "fr": "Pillage", + "it": "Saccheggi" + }, + "070-D-Demo-gewaltlos": { + "de": "Demo gewaltlos", + "fr": "Manifestation", + "it": "Dimostrazioni" + }, + "071-D-Demo-gewaltsam": { + "de": "Demo gewaltsam", + "fr": "Manifestation avec exactions", + "it": "Dimostrazioni con disordini" + }, + "072-D-Massenpanik": { + "de": "Massenpanik", + "fr": "Effet de panique", + "it": "Panico di massa" + }, + "073-D-Brandanschlag": { + "de": "Brandanschlag", + "fr": "Incendie criminel", + "it": "Attentato incendiario" + }, + "074-D-Sabotage": { + "de": "Sabotage", + "fr": "Sabotage", + "it": "Sabotaggio" + }, + "075-D-Bombenanschlag": { + "de": "Bombenanschlag", + "fr": "Attentat \u00e0 la bombe", + "it": "Attentato dinamitardo" + }, + "076-D-Trupp-p-P": { + "de": "Trupp P", + "fr": "Patrouille P", + "it": "Squadra P" + }, + "077-D-Gruppe-p-P": { + "de": "Grupp P", + "fr": "Groupe P", + "it": "Gruppo P" + }, + "078-D-Zug-p-P": { + "de": "Zug P", + "fr": "Section P", + "it": "Sezione P" + }, + "079-D-Gruppenfuehrer-P": { + "de": "Gruppenf\u00fchrer P", + "fr": "Chef de groupe P", + "it": "Capogruppo P" + }, + "080-D-Offizier-Zugfuehrer-P": { + "de": "Offizier_Zugf\u00fchrer P", + "fr": "Officier Chef de section P", + "it": "Ufficiale caposezione P" + }, + "081-D-Einsatzleiter-P": { + "de": "Einsatzleiter P", + "fr": "Chef d'intervention P", + "it": "Capointervento P" + }, + "082-D-Trupp-p-FW": { + "de": "Trupp FW", + "fr": "Patrouille SP", + "it": "Squadra CP" + }, + "083-D-Gruppe-p-FW": { + "de": "Gruppe FW", + "fr": "Groupe SP", + "it": "Gruppo CP" + }, + "084-D-Zug-p-FW": { + "de": "Zug FW", + "fr": "Section SP", + "it": "Sezione CP" + }, + "085-D-Gruppenfuehrer-FW": { + "de": "Gruppenf\u00fchrer FW", + "fr": "Chef de groupe SP", + "it": "Capogruppo CP" + }, + "086-D-Offizier-Zugfuehrer-FW": { + "de": "Offizier Zugf\u00fchrer FW", + "fr": "Officier Chef de section SP", + "it": "Ufficiale caposezione CP" + }, + "087-D-Einsatzleiter-FW": { + "de": "Einsatzleiter FW", + "fr": "Chef d'intervention SP", + "it": "Capointervento CP" + }, + "088-D-Trupp-p-San": { + "de": "Trupp San", + "fr": "Patrouille San", + "it": "Squadra San" + }, + "089-D-Gruppe-p-San": { + "de": "Gruppe San", + "fr": "Groupe San", + "it": "Gruppo San" + }, + "090-D-Trupp-p": { + "de": "Trupp ", + "fr": "Patrouille", + "it": "Squadra" + }, + "091-D-Gruppe-p": { + "de": "Gruppe ", + "fr": "Groupe", + "it": "Gruppo" + }, + "092-D-Zug-p": { + "de": "Zug ", + "fr": "Section", + "it": "Sezione" + }, + "093-D-Kompanie": { + "de": "Kompanie", + "fr": "Compagnie", + "it": "Compagnia" + }, + "094-D-Bataillon": { + "de": "Bataillon", + "fr": "Bataillon", + "it": "Bataillone" + }, + "095-D-Gruppenfuehrer": { + "de": "Gruppenf\u00fchrer", + "fr": "Chef de groupe", + "it": "Capogruppo" + }, + "096-D-Offizier-Zugfuehrer": { + "de": "Offizier Zugf\u00fchrer", + "fr": "Officier Chef de section", + "it": "Ufficiale caposezione" + }, + "097-D-Einsatzleiter": { + "de": "Einsatzleiter", + "fr": "Chef d'intervention", + "it": "Capointervento" + }, + "098-D-Beabsichtigter-Einsatz": { + "de": "Beabsichtigter Einsatz", + "fr": "Engagement pr\u00e9vu", + "it": "Intervento pianificato" + }, + "099-D-Beabsichtigte-Erkundung": { + "de": "Beabsichtigte Erkundung", + "fr": "Reconnaissance pr\u00e9vue", + "it": "Ricognizione pianificata" + }, + "100-D-Durchgefuehrter-Einsatz": { + "de": "Durchgef\u00fchrter Einsatz", + "fr": "Engagement ex\u00e9cut\u00e9", + "it": "Intervento eseguito" + }, + "101-D-Durchgefuehrte-Erkundung": { + "de": "Durchgef\u00fchrte Erkundung", + "fr": "Reconnaissance ex\u00e9cut\u00e9e", + "it": "Ricognizione eseguita" + }, + "102-D-Motorfahrzeug": { + "de": "Motorfahrzeug", + "fr": "V\u00e9hicule l\u00e9ger", + "it": "Automobile" + }, + "103-D-Lastwagen": { + "de": "Lastwagen", + "fr": "Poids-lourd", + "it": "Autocarro" + }, + "104-D-Transportfahrzeug": { + "de": "Transportfahrzeug", + "fr": "V\u00e9hicule de transport", + "it": "Veicoli per il transporto" + }, + "105-D-Ambulanz": { + "de": "Ambulanz", + "fr": "Ambulance", + "it": "Ambulanza" + }, + "106-D-Helikopter": { + "de": "Helikopter", + "fr": "H\u00e9licopt\u00e8re", + "it": "Elicottero" + }, + "107-D-Tankloeschfahrzeug": { + "de": "Tankl\u00f6schfahrzeug", + "fr": "Fourgon tonne-pompe", + "it": "Autobotte" + }, + "108-D-Wasserwerfer": { + "de": "Wasserwerfer", + "fr": "Canon \u00e0 eau", + "it": "Lanciaacqua" + }, + "109-D-Hubrettungsfahrzeug": { + "de": "Hubrettungsfahrzeug", + "fr": "El\u00e9vateur \u00e0 nacelle", + "it": "Elevatore a navicella" + }, + "110-D-Autodrehleiter": { + "de": "Autodrehleiter", + "fr": "Echelle", + "it": "Scala motorizzata" + }, + "111-D-Nationalstrasse": { + "de": "Nationalstrasse", + "fr": "Route", + "it": "Strada nazionale" + }, + "112-D-Autobahn": { + "de": "Autobahn", + "fr": "Autoroute", + "it": "Autostrada" + }, + "113-D-Eisenbahn": { + "de": "Eisenbahn", + "fr": "Chemin de fer", + "it": "Linea ferroviaria" + }, + "114-D-Schiffahrt-Verbot": { + "de": "Schiffahrt Verbot", + "fr": "Interdiction de naviguer", + "it": "Divieto di navigazione" + }, + "115-D-Ueberflugverbot": { + "de": "\u00dcberflugverbot", + "fr": "Interdiction de survoler", + "it": "Divieto di sorvolo" + }, + "116-D-Notfalltreffpunkt": { + "de": "Notfalltreffpunkt", + "fr": "Point de rassemblement d'urgence", + "it": "Punto di raccolta d'urgenza" + } +} diff --git a/metadata/description/babs-F-dictionary.json b/metadata/description/babs-F-dictionary.json new file mode 100644 index 0000000..06152b7 --- /dev/null +++ b/metadata/description/babs-F-dictionary.json @@ -0,0 +1,582 @@ +{ + "001-F-Degat": { + "de": "Besch\u00e4digung", + "fr": "D\u00e9g\u00e2t", + "it": "Danneggiamento" + }, + "002-F-Destruction-partielle": { + "de": "Teilzerst\u00f6rung", + "fr": "Destruction partielle", + "it": "Distruzione parziale" + }, + "003-F-Destruction-totale": { + "de": "Totalzerst\u00f6rung", + "fr": "Destruction totale", + "it": "Distruzione totale" + }, + "004-F-Incendie-isole": { + "de": "Brand einzelnes Geb\u00e4ude", + "fr": "Incendie isol\u00e9", + "it": "Incendio di un singolo edificio" + }, + "005-F-Foyer-d-explosion": { + "de": "Explosionsherd", + "fr": "Foyer d'explosion", + "it": "Focolaio esplosione" + }, + "006-F-Blesses": { + "de": "Verletzte", + "fr": "Bless\u00e9s", + "it": "Feriti" + }, + "007-F-Enfermes": { + "de": "Eingesperrte", + "fr": "Enferm\u00e9s", + "it": "Persone imprigionate" + }, + "008-F-Sans-abri": { + "de": "Obdachlose", + "fr": "Sans abri", + "it": "Senzatetto" + }, + "009-F-Morts": { + "de": "Tote", + "fr": "Morts", + "it": "Morti" + }, + "010-F-Disparus": { + "de": "Vermisste", + "fr": "Disparus", + "it": "Dispersi" + }, + "011-F-Armee": { + "de": "Armee", + "fr": "Arm\u00e9e", + "it": "Esercito" + }, + "012-F-Police": { + "de": "Polizei", + "fr": "Police", + "it": "Polizia" + }, + "013-F-Protection-civile": { + "de": "Zivilschutz", + "fr": "Protection civile", + "it": "Protezione civile" + }, + "014-F-Sanitaire": { + "de": "Sanit\u00e4r", + "fr": "Sanitaire", + "it": "Sanit\u00e0" + }, + "015-F-Sapeurs-pompiers": { + "de": "Feuerwehr", + "fr": "Sapeurs-pompiers", + "it": "Corpo pompieri" + }, + "016-F-Services-techniques": { + "de": "Technische Betriebe", + "fr": "Services techniques", + "it": "Servizi tecniche" + }, + "017-F-Accident": { + "de": "Unfall", + "fr": "Accident", + "it": "Incidente" + }, + "018-F-Chimique": { + "de": "Chemikalien", + "fr": "Chimique", + "it": "Sostanze chimiche" + }, + "019-F-Electricite": { + "de": "Elektrizit\u00e4t", + "fr": "Electricit\u00e9", + "it": "Elettricit\u00e0" + }, + "020-F-Explosion": { + "de": "Explosion", + "fr": "Explosion", + "it": "Esplosione" + }, + "021-F-Gaz": { + "de": "Gas", + "fr": "Gaz", + "it": "Gas" + }, + "022-F-Danger-si-extinction-avec-eau": { + "de": "Gefahr durch L\u00f6schen mit Wasser", + "fr": "Danger si extinction avec eau", + "it": "Pericolo spegnimento con acqua" + }, + "023-F-Substances-radioactives": { + "de": "Radioaktive Stoffe", + "fr": "Substances radioactives", + "it": "Sostanze radioattive" + }, + "024-F-Danger-pour-les-eaux": { + "de": "Gefahr f\u00fcr Grundwasser", + "fr": "Danger pour les eaux", + "it": "Pericolo per le acque" + }, + "025-F-OCC": { + "de": "KFO", + "fr": "OCC", + "it": "OCCt" + }, + "026-F-OCRg": { + "de": "RFO", + "fr": "OCRg", + "it": "OCRg" + }, + "027-F-OCCm": { + "de": "GFO", + "fr": "OCCm", + "it": "OCCm" + }, + "028-F-CE": { + "de": "EZ", + "fr": "CE", + "it": "CI" + }, + "029-F-CEM": { + "de": "MEZ", + "fr": "CEM", + "it": "CIM" + }, + "030-F-DI": { + "de": "EL", + "fr": "DI", + "it": "DI" + }, + "031-F-PCO": { + "de": "R\u00fcck", + "fr": "PCO", + "it": "Posto comando operazioni" + }, + "032-F-PCE": { + "de": "Front", + "fr": "PCE", + "it": "Posto comando intervento" + }, + "033-F-Point-d-information": { + "de": "Informationsstelle", + "fr": "Point d'information", + "it": "Posto d'informazione" + }, + "034-F-Poste-collecteur": { + "de": "Sammelstelle", + "fr": "Poste collecteur", + "it": "Posto collettore" + }, + "035-F-Poste-d-assistance": { + "de": "Betreuungsstelle", + "fr": "Poste d'assistance", + "it": "Posto d'assistenza" + }, + "036-F-Poste-collecteur-de-patients": { + "de": "Patientensammelstelle", + "fr": "Poste collecteur de patients", + "it": "Posto collettore dei pazienti" + }, + "037-F-Poste-medical-avance": { + "de": "Sanit\u00e4tshilfsstelle", + "fr": "Poste m\u00e9dical avanc\u00e9", + "it": "Posto di soccorso sanitario" + }, + "038-F-Poste-collecteur-de-cadavres": { + "de": "Totensammelstelle", + "fr": "Poste collecteur de cadavres", + "it": "Posto colletore dei morti" + }, + "039-F-Poste-de-distribution": { + "de": "Verpflegungsabgabestelle", + "fr": "Poste de distribution", + "it": "Posto distribuzione sussistenza" + }, + "040-F-Station-de-carburant": { + "de": "Betriebsstoffabgabestelle", + "fr": "Station de carburant", + "it": "Posto distribuzione carburante" + }, + "041-F-Depot-d-urgence-PBC": { + "de": "KGS Notdepot", + "fr": "D\u00e9p\u00f4t d'urgence PBC", + "it": "Deposito PBC di fortuna" + }, + "042-F-Porte": { + "de": "Pforte", + "fr": "Porte", + "it": "Porta" + }, + "043-F-Deviations": { + "de": "Umleitung", + "fr": "D\u00e9viations", + "it": "Deviazione" + }, + "044-F-Fermeture-de-la-route": { + "de": "Absperrung Verkehrswege", + "fr": "Fermeture de la route", + "it": "Sbarramento vie comunicazione" + }, + "045-F-Barrage": { + "de": "Sperre", + "fr": "Barrage", + "it": "Sbarramento" + }, + "046-F-Place-d-atterrissage-Helico": { + "de": "Helikopterlandeplatz", + "fr": "Place d'atterrissage H\u00e9lico", + "it": "Piazza d'atterraggio elicotteri" + }, + "047-F-Place-pour-vehicules": { + "de": "Fahrzeugplatz", + "fr": "Place pour v\u00e9hicules", + "it": "Posteggio veicoli" + }, + "048-F-Depot-materiel": { + "de": "Materialdepot", + "fr": "D\u00e9p\u00f4t mat\u00e9riel", + "it": "Deposito del materiale" + }, + "049-F-Observation": { + "de": "Beobachtung", + "fr": "Observation", + "it": "Osservazione" + }, + "050-F-Surveillance": { + "de": "\u00dcberwachung", + "fr": "Surveillance", + "it": "Sorveglianza" + }, + "051-F-Tempete": { + "de": "Sturm", + "fr": "Temp\u00eate", + "it": "Tempesta" + }, + "052-F-Inondation": { + "de": "\u00dcberschwemmung", + "fr": "Inondation", + "it": "Piena" + }, + "053-F-Glissement-de-terrain": { + "de": "Erdrutsch", + "fr": "Glissement de terrain", + "it": "Frana" + }, + "054-F-Avalanche": { + "de": "Lawine", + "fr": "Avalanche", + "it": "Valanga" + }, + "055-F-Immeuble-effondre": { + "de": "Geb\u00e4udeeinsturz", + "fr": "Immeuble effondr\u00e9", + "it": "Crollo di edificio" + }, + "056-F-Fortes-precipitations": { + "de": "Starkniederschlag", + "fr": "Fortes pr\u00e9cipitations", + "it": "Piogge intense" + }, + "057-F-Incendie": { + "de": "Brand", + "fr": "Incendie", + "it": "Incendio" + }, + "058-F-Explosion": { + "de": "Explosion", + "fr": "Explosion", + "it": "Esplosione" + }, + "059-F-Embouteillage": { + "de": "Stau", + "fr": "Embouteillage", + "it": "Colonna" + }, + "060-F-Accident-auto": { + "de": "Autounfall", + "fr": "Accident auto", + "it": "Incidente della circolazione" + }, + "061-F-Accident-ferroviaire": { + "de": "Eisenbahnungl\u00fcck", + "fr": "Accident ferroviaire", + "it": "Incidente ferroviario" + }, + "062-F-Egouts-defectueux": { + "de": "Kanalisationsausfall", + "fr": "Egouts d\u00e9fectueux", + "it": "Interruzione della canalizzazione" + }, + "063-F-Accident-nucleaire": { + "de": "Atomunfall", + "fr": "Accident nucl\u00e9aire", + "it": "Incidente nucleare" + }, + "064-F-Accident-biologique": { + "de": "Biounfall", + "fr": "Accident biologique", + "it": "Incidente biologico" + }, + "065-F-Pollution-aux-hydrocarbures": { + "de": "\u00d6lverschmutzung", + "fr": "Pollution aux hydrocarbures", + "it": "Inquinamento da idrocarburi" + }, + "066-F-Dommages-aux-infrastructures": { + "de": "Infrastrukturschaden", + "fr": "Dommages aux infrastructures", + "it": "Danni alle infrastrutture" + }, + "067-F-Accident-navigation": { + "de": "Schiffsversenkung", + "fr": "Accident navigation", + "it": "Incidente nautico" + }, + "068-F-Accident-chimique": { + "de": "Chemieunfall", + "fr": "Accident chimique", + "it": "Incidente chimico" + }, + "069-F-Pillage": { + "de": "Pl\u00fcnderung", + "fr": "Pillage", + "it": "Saccheggi" + }, + "070-F-Manifestation": { + "de": "Demo gewaltlos", + "fr": "Manifestation", + "it": "Dimostrazioni" + }, + "071-F-Manifestation-avec-exactions": { + "de": "Demo gewaltsam", + "fr": "Manifestation avec exactions", + "it": "Dimostrazioni con disordini" + }, + "072-F-Effet-de-panique": { + "de": "Massenpanik", + "fr": "Effet de panique", + "it": "Panico di massa" + }, + "073-F-Incendie-criminel": { + "de": "Brandanschlag", + "fr": "Incendie criminel", + "it": "Attentato incendiario" + }, + "074-F-Sabotage": { + "de": "Sabotage", + "fr": "Sabotage", + "it": "Sabotaggio" + }, + "075-F-Attentat-a-la-bombe": { + "de": "Bombenanschlag", + "fr": "Attentat \u00e0 la bombe", + "it": "Attentato dinamitardo" + }, + "076-F-Patrouille-P": { + "de": "Trupp P", + "fr": "Patrouille P", + "it": "Squadra P" + }, + "077-F-Groupe-P": { + "de": "Grupp P", + "fr": "Groupe P", + "it": "Gruppo P" + }, + "078-F-Section-P": { + "de": "Zug P", + "fr": "Section P", + "it": "Sezione P" + }, + "079-F-Chef-de-groupe-P": { + "de": "Gruppenf\u00fchrer P", + "fr": "Chef de groupe P", + "it": "Capogruppo P" + }, + "080-F-Officier-Chef-de-section-P": { + "de": "Offizier_Zugf\u00fchrer P", + "fr": "Officier Chef de section P", + "it": "Ufficiale caposezione P" + }, + "081-F-Chef-d-intervention-P": { + "de": "Einsatzleiter P", + "fr": "Chef d'intervention P", + "it": "Capointervento P" + }, + "082-F-Patrouille-SP": { + "de": "Trupp FW", + "fr": "Patrouille SP", + "it": "Squadra CP" + }, + "083-F-Groupe-SP": { + "de": "Gruppe FW", + "fr": "Groupe SP", + "it": "Gruppo CP" + }, + "084-F-Section-SP": { + "de": "Zug FW", + "fr": "Section SP", + "it": "Sezione CP" + }, + "085-F-Chef-de-groupe-SP": { + "de": "Gruppenf\u00fchrer FW", + "fr": "Chef de groupe SP", + "it": "Capogruppo CP" + }, + "086-F-Officier-Chef-de-section-SP": { + "de": "Offizier Zugf\u00fchrer FW", + "fr": "Officier Chef de section SP", + "it": "Ufficiale caposezione CP" + }, + "087-F-Chef-d-intervention-SP": { + "de": "Einsatzleiter FW", + "fr": "Chef d'intervention SP", + "it": "Capointervento CP" + }, + "088-F-Patrouille-San": { + "de": "Trupp San", + "fr": "Patrouille San", + "it": "Squadra San" + }, + "089-F-Groupe-San": { + "de": "Gruppe San", + "fr": "Groupe San", + "it": "Gruppo San" + }, + "090-F-Patrouille": { + "de": "Trupp ", + "fr": "Patrouille", + "it": "Squadra" + }, + "091-F-Groupe": { + "de": "Gruppe ", + "fr": "Groupe", + "it": "Gruppo" + }, + "092-F-Section": { + "de": "Zug ", + "fr": "Section", + "it": "Sezione" + }, + "093-F-Compagnie": { + "de": "Kompanie", + "fr": "Compagnie", + "it": "Compagnia" + }, + "094-F-Bataillon": { + "de": "Bataillon", + "fr": "Bataillon", + "it": "Bataillone" + }, + "095-F-Chef-de-groupe": { + "de": "Gruppenf\u00fchrer", + "fr": "Chef de groupe", + "it": "Capogruppo" + }, + "096-F-Officier-Chef-de-section": { + "de": "Offizier Zugf\u00fchrer", + "fr": "Officier Chef de section", + "it": "Ufficiale caposezione" + }, + "097-F-Chef-d-intervention": { + "de": "Einsatzleiter", + "fr": "Chef d'intervention", + "it": "Capointervento" + }, + "098-F-Engagement-prevu": { + "de": "Beabsichtigter Einsatz", + "fr": "Engagement pr\u00e9vu", + "it": "Intervento pianificato" + }, + "099-F-Reconnaissance-prevue": { + "de": "Beabsichtigte Erkundung", + "fr": "Reconnaissance pr\u00e9vue", + "it": "Ricognizione pianificata" + }, + "100-F-Engagement-execute": { + "de": "Durchgef\u00fchrter Einsatz", + "fr": "Engagement ex\u00e9cut\u00e9", + "it": "Intervento eseguito" + }, + "101-F-Reconnaissance-executee": { + "de": "Durchgef\u00fchrte Erkundung", + "fr": "Reconnaissance ex\u00e9cut\u00e9e", + "it": "Ricognizione eseguita" + }, + "102-F-Vehicule-leger-voiture": { + "de": "Motorfahrzeug", + "fr": "V\u00e9hicule l\u00e9ger", + "it": "Automobile" + }, + "103-F-Camion-poids-lourd": { + "de": "Lastwagen", + "fr": "Poids-lourd", + "it": "Autocarro" + }, + "104-F-Vehicule-de-transport-bus": { + "de": "Transportfahrzeug", + "fr": "V\u00e9hicule de transport", + "it": "Veicoli per il transporto" + }, + "105-F-Ambulance": { + "de": "Ambulanz", + "fr": "Ambulance", + "it": "Ambulanza" + }, + "106-F-Helicoptere": { + "de": "Helikopter", + "fr": "H\u00e9licopt\u00e8re", + "it": "Elicottero" + }, + "107-F-Fourgon-tonne-pompe": { + "de": "Tankl\u00f6schfahrzeug", + "fr": "Fourgon tonne-pompe", + "it": "Autobotte" + }, + "108-F-Canon-a-eau": { + "de": "Wasserwerfer", + "fr": "Canon \u00e0 eau", + "it": "Lanciaacqua" + }, + "109-F-Elevateur-a-nacelle": { + "de": "Hubrettungsfahrzeug", + "fr": "El\u00e9vateur \u00e0 nacelle", + "it": "Elevatore a navicella" + }, + "110-F-Echelle": { + "de": "Autodrehleiter", + "fr": "Echelle", + "it": "Scala motorizzata" + }, + "111-F-Route": { + "de": "Nationalstrasse", + "fr": "Route", + "it": "Strada nazionale" + }, + "112-F-Autoroute": { + "de": "Autobahn", + "fr": "Autoroute", + "it": "Autostrada" + }, + "113-F-Chemin-de-fer": { + "de": "Eisenbahn", + "fr": "Chemin de fer", + "it": "Linea ferroviaria" + }, + "114-F-Interdiction-de-naviguer": { + "de": "Schiffahrt Verbot", + "fr": "Interdiction de naviguer", + "it": "Divieto di navigazione" + }, + "115-F-Interdiction-de-survoler": { + "de": "\u00dcberflugverbot", + "fr": "Interdiction de survoler", + "it": "Divieto di sorvolo" + }, + "116-F-Point-de-rassemblement-d-urgence": { + "de": "Notfalltreffpunkt", + "fr": "Point de rassemblement d'urgence", + "it": "Punto di raccolta d'urgenza" + } +} diff --git a/metadata/description/babs-I-dictionary.json b/metadata/description/babs-I-dictionary.json new file mode 100644 index 0000000..fde54e3 --- /dev/null +++ b/metadata/description/babs-I-dictionary.json @@ -0,0 +1,582 @@ +{ + "001-I-Danneggiamento": { + "de": "Besch\u00e4digung", + "fr": "D\u00e9g\u00e2t", + "it": "Danneggiamento" + }, + "002-I-Distruzione-parziale": { + "de": "Teilzerst\u00f6rung", + "fr": "Destruction partielle", + "it": "Distruzione parziale" + }, + "003-I-Distruzione-totale": { + "de": "Totalzerst\u00f6rung", + "fr": "Destruction totale", + "it": "Distruzione totale" + }, + "004-I-Incendio-di-un-singolo-edificio": { + "de": "Brand einzelnes Geb\u00e4ude", + "fr": "Incendie isol\u00e9", + "it": "Incendio di un singolo edificio" + }, + "005-I-Focolaio-esplosione": { + "de": "Explosionsherd", + "fr": "Foyer d'explosion", + "it": "Focolaio esplosione" + }, + "006-I-Feriti": { + "de": "Verletzte", + "fr": "Bless\u00e9s", + "it": "Feriti" + }, + "007-I-Persone-imprigionate": { + "de": "Eingesperrte", + "fr": "Enferm\u00e9s", + "it": "Persone imprigionate" + }, + "008-I-Senzatetto": { + "de": "Obdachlose", + "fr": "Sans abri", + "it": "Senzatetto" + }, + "009-I-Morti": { + "de": "Tote", + "fr": "Morts", + "it": "Morti" + }, + "010-I-Dispersi": { + "de": "Vermisste", + "fr": "Disparus", + "it": "Dispersi" + }, + "011-I-Esercito": { + "de": "Armee", + "fr": "Arm\u00e9e", + "it": "Esercito" + }, + "012-I-Polizia": { + "de": "Polizei", + "fr": "Police", + "it": "Polizia" + }, + "013-I-Protezione-civile": { + "de": "Zivilschutz", + "fr": "Protection civile", + "it": "Protezione civile" + }, + "014-I-Sanita": { + "de": "Sanit\u00e4r", + "fr": "Sanitaire", + "it": "Sanit\u00e0" + }, + "015-I-Corpo-pompieri": { + "de": "Feuerwehr", + "fr": "Sapeurs-pompiers", + "it": "Corpo pompieri" + }, + "016-I-Servizi-tecniche": { + "de": "Technische Betriebe", + "fr": "Services techniques", + "it": "Servizi tecniche" + }, + "017-I-Incidente": { + "de": "Unfall", + "fr": "Accident", + "it": "Incidente" + }, + "018-I-Sostanze-chimiche": { + "de": "Chemikalien", + "fr": "Chimique", + "it": "Sostanze chimiche" + }, + "019-I-Elettricita": { + "de": "Elektrizit\u00e4t", + "fr": "Electricit\u00e9", + "it": "Elettricit\u00e0" + }, + "020-I-Esplosione": { + "de": "Explosion", + "fr": "Explosion", + "it": "Esplosione" + }, + "021-I-Gas": { + "de": "Gas", + "fr": "Gaz", + "it": "Gas" + }, + "022-I-Pericolo-spegnimento-con-acqua": { + "de": "Gefahr durch L\u00f6schen mit Wasser", + "fr": "Danger si extinction avec eau", + "it": "Pericolo spegnimento con acqua" + }, + "023-I-Sostanze-radioattive": { + "de": "Radioaktive Stoffe", + "fr": "Substances radioactives", + "it": "Sostanze radioattive" + }, + "024-I-Pericolo-per-le-acque": { + "de": "Gefahr f\u00fcr Grundwasser", + "fr": "Danger pour les eaux", + "it": "Pericolo per le acque" + }, + "025-I-OCCt": { + "de": "KFO", + "fr": "OCC", + "it": "OCCt" + }, + "026-I-OCRg": { + "de": "RFO", + "fr": "OCRg", + "it": "OCRg" + }, + "027-I-OCCm": { + "de": "GFO", + "fr": "OCCm", + "it": "OCCm" + }, + "028-I-CI": { + "de": "EZ", + "fr": "CE", + "it": "CI" + }, + "029-I-CIM": { + "de": "MEZ", + "fr": "CEM", + "it": "CIM" + }, + "030-I-DI": { + "de": "EL", + "fr": "DI", + "it": "DI" + }, + "031-I-Posto-comando-operazioni": { + "de": "R\u00fcck", + "fr": "PCO", + "it": "Posto comando operazioni" + }, + "032-I-Posto-comando-intervento": { + "de": "Front", + "fr": "PCE", + "it": "Posto comando intervento" + }, + "033-I-Posto-d-informazione": { + "de": "Informationsstelle", + "fr": "Point d'information", + "it": "Posto d'informazione" + }, + "034-I-Posto-collettore": { + "de": "Sammelstelle", + "fr": "Poste collecteur", + "it": "Posto collettore" + }, + "035-I-Posto-d-assistenza": { + "de": "Betreuungsstelle", + "fr": "Poste d'assistance", + "it": "Posto d'assistenza" + }, + "036-I-Posto-collettore-dei-pazienti": { + "de": "Patientensammelstelle", + "fr": "Poste collecteur de patients", + "it": "Posto collettore dei pazienti" + }, + "037-I-Posto-di-soccorso-sanitario": { + "de": "Sanit\u00e4tshilfsstelle", + "fr": "Poste m\u00e9dical avanc\u00e9", + "it": "Posto di soccorso sanitario" + }, + "038-I-Posto-colletore-dei-morti": { + "de": "Totensammelstelle", + "fr": "Poste collecteur de cadavres", + "it": "Posto colletore dei morti" + }, + "039-I-Posto-distribuzione-sussistenza": { + "de": "Verpflegungsabgabestelle", + "fr": "Poste de distribution", + "it": "Posto distribuzione sussistenza" + }, + "040-I-Posto-distribuzione-carburante": { + "de": "Betriebsstoffabgabestelle", + "fr": "Station de carburant", + "it": "Posto distribuzione carburante" + }, + "041-I-Deposito-PBC-di-fortuna": { + "de": "KGS Notdepot", + "fr": "D\u00e9p\u00f4t d'urgence PBC", + "it": "Deposito PBC di fortuna" + }, + "042-I-Porta": { + "de": "Pforte", + "fr": "Porte", + "it": "Porta" + }, + "043-I-Deviazione": { + "de": "Umleitung", + "fr": "D\u00e9viations", + "it": "Deviazione" + }, + "044-I-Sbarramento-vie-comunicazione": { + "de": "Absperrung Verkehrswege", + "fr": "Fermeture de la route", + "it": "Sbarramento vie comunicazione" + }, + "045-I-Sbarramento": { + "de": "Sperre", + "fr": "Barrage", + "it": "Sbarramento" + }, + "046-I-Piazza-d-atterraggio-elicotteri": { + "de": "Helikopterlandeplatz", + "fr": "Place d'atterrissage H\u00e9lico", + "it": "Piazza d'atterraggio elicotteri" + }, + "047-I-Posteggio-veicoli": { + "de": "Fahrzeugplatz", + "fr": "Place pour v\u00e9hicules", + "it": "Posteggio veicoli" + }, + "048-I-Deposito-del-materiale": { + "de": "Materialdepot", + "fr": "D\u00e9p\u00f4t mat\u00e9riel", + "it": "Deposito del materiale" + }, + "049-I-Osservazione": { + "de": "Beobachtung", + "fr": "Observation", + "it": "Osservazione" + }, + "050-I-Sorveglianza": { + "de": "\u00dcberwachung", + "fr": "Surveillance", + "it": "Sorveglianza" + }, + "051-I-Tempesta": { + "de": "Sturm", + "fr": "Temp\u00eate", + "it": "Tempesta" + }, + "052-I-Piena": { + "de": "\u00dcberschwemmung", + "fr": "Inondation", + "it": "Piena" + }, + "053-I-Frana": { + "de": "Erdrutsch", + "fr": "Glissement de terrain", + "it": "Frana" + }, + "054-I-Valanga": { + "de": "Lawine", + "fr": "Avalanche", + "it": "Valanga" + }, + "055-I-Crollo-di-edificio": { + "de": "Geb\u00e4udeeinsturz", + "fr": "Immeuble effondr\u00e9", + "it": "Crollo di edificio" + }, + "056-I-Piogge-intense": { + "de": "Starkniederschlag", + "fr": "Fortes pr\u00e9cipitations", + "it": "Piogge intense" + }, + "057-I-Incendio": { + "de": "Brand", + "fr": "Incendie", + "it": "Incendio" + }, + "058-I-Esplosione": { + "de": "Explosion", + "fr": "Explosion", + "it": "Esplosione" + }, + "059-I-Colonna": { + "de": "Stau", + "fr": "Embouteillage", + "it": "Colonna" + }, + "060-I-Incidente-della-circolazione": { + "de": "Autounfall", + "fr": "Accident auto", + "it": "Incidente della circolazione" + }, + "061-I-Incidente-ferroviario": { + "de": "Eisenbahnungl\u00fcck", + "fr": "Accident ferroviaire", + "it": "Incidente ferroviario" + }, + "062-I-Interruzione-della-canalizzazione": { + "de": "Kanalisationsausfall", + "fr": "Egouts d\u00e9fectueux", + "it": "Interruzione della canalizzazione" + }, + "063-I-Incidente-nucleare": { + "de": "Atomunfall", + "fr": "Accident nucl\u00e9aire", + "it": "Incidente nucleare" + }, + "064-I-Incidente-biologico": { + "de": "Biounfall", + "fr": "Accident biologique", + "it": "Incidente biologico" + }, + "065-I-Inquinamento-da-idrocarburi": { + "de": "\u00d6lverschmutzung", + "fr": "Pollution aux hydrocarbures", + "it": "Inquinamento da idrocarburi" + }, + "066-I-Danni-alle-infrastrutture": { + "de": "Infrastrukturschaden", + "fr": "Dommages aux infrastructures", + "it": "Danni alle infrastrutture" + }, + "067-I-Incidente-nautico": { + "de": "Schiffsversenkung", + "fr": "Accident navigation", + "it": "Incidente nautico" + }, + "068-I-Incidente-chimico": { + "de": "Chemieunfall", + "fr": "Accident chimique", + "it": "Incidente chimico" + }, + "069-I-Saccheggi": { + "de": "Pl\u00fcnderung", + "fr": "Pillage", + "it": "Saccheggi" + }, + "070-I-Dimostrazioni": { + "de": "Demo gewaltlos", + "fr": "Manifestation", + "it": "Dimostrazioni" + }, + "071-I-Dimostrazioni-con-disordini": { + "de": "Demo gewaltsam", + "fr": "Manifestation avec exactions", + "it": "Dimostrazioni con disordini" + }, + "072-I-Panico-di-massa": { + "de": "Massenpanik", + "fr": "Effet de panique", + "it": "Panico di massa" + }, + "073-I-Attentato-incendiario": { + "de": "Brandanschlag", + "fr": "Incendie criminel", + "it": "Attentato incendiario" + }, + "074-I-Sabotaggio": { + "de": "Sabotage", + "fr": "Sabotage", + "it": "Sabotaggio" + }, + "075-I-Attentato-dinamitardo": { + "de": "Bombenanschlag", + "fr": "Attentat \u00e0 la bombe", + "it": "Attentato dinamitardo" + }, + "076-I-Squadra-P": { + "de": "Trupp P", + "fr": "Patrouille P", + "it": "Squadra P" + }, + "077-I-Gruppo-P": { + "de": "Grupp P", + "fr": "Groupe P", + "it": "Gruppo P" + }, + "078-I-Sezione-P": { + "de": "Zug P", + "fr": "Section P", + "it": "Sezione P" + }, + "079-I-Capogruppo-P": { + "de": "Gruppenf\u00fchrer P", + "fr": "Chef de groupe P", + "it": "Capogruppo P" + }, + "080-I-Ufficiale-caposezione-P": { + "de": "Offizier_Zugf\u00fchrer P", + "fr": "Officier Chef de section P", + "it": "Ufficiale caposezione P" + }, + "081-I-Capointervento-P": { + "de": "Einsatzleiter P", + "fr": "Chef d'intervention P", + "it": "Capointervento P" + }, + "082-I-Squadra-CP": { + "de": "Trupp FW", + "fr": "Patrouille SP", + "it": "Squadra CP" + }, + "083-I-Gruppo-CP": { + "de": "Gruppe FW", + "fr": "Groupe SP", + "it": "Gruppo CP" + }, + "084-I-Sezione-CP": { + "de": "Zug FW", + "fr": "Section SP", + "it": "Sezione CP" + }, + "085-I-Capogruppo-CP": { + "de": "Gruppenf\u00fchrer FW", + "fr": "Chef de groupe SP", + "it": "Capogruppo CP" + }, + "086-I-Ufficiale-caposezione-CP": { + "de": "Offizier Zugf\u00fchrer FW", + "fr": "Officier Chef de section SP", + "it": "Ufficiale caposezione CP" + }, + "087-I-Capointervento-CP": { + "de": "Einsatzleiter FW", + "fr": "Chef d'intervention SP", + "it": "Capointervento CP" + }, + "088-I-Squadra-San": { + "de": "Trupp San", + "fr": "Patrouille San", + "it": "Squadra San" + }, + "089-I-Gruppo-San": { + "de": "Gruppe San", + "fr": "Groupe San", + "it": "Gruppo San" + }, + "090-I-Squadra": { + "de": "Trupp ", + "fr": "Patrouille", + "it": "Squadra" + }, + "091-I-Gruppo": { + "de": "Gruppe ", + "fr": "Groupe", + "it": "Gruppo" + }, + "092-I-Sezione": { + "de": "Zug ", + "fr": "Section", + "it": "Sezione" + }, + "093-I-Compagnia": { + "de": "Kompanie", + "fr": "Compagnie", + "it": "Compagnia" + }, + "094-I-Bataillone": { + "de": "Bataillon", + "fr": "Bataillon", + "it": "Bataillone" + }, + "095-I-Capogruppo": { + "de": "Gruppenf\u00fchrer", + "fr": "Chef de groupe", + "it": "Capogruppo" + }, + "096-I-Ufficiale-caposezione": { + "de": "Offizier Zugf\u00fchrer", + "fr": "Officier Chef de section", + "it": "Ufficiale caposezione" + }, + "097-I-Capointervento": { + "de": "Einsatzleiter", + "fr": "Chef d'intervention", + "it": "Capointervento" + }, + "098-I-Intervento-pianificato": { + "de": "Beabsichtigter Einsatz", + "fr": "Engagement pr\u00e9vu", + "it": "Intervento pianificato" + }, + "099-I-Ricognizione-pianificata": { + "de": "Beabsichtigte Erkundung", + "fr": "Reconnaissance pr\u00e9vue", + "it": "Ricognizione pianificata" + }, + "100-I-Intervento-eseguito": { + "de": "Durchgef\u00fchrter Einsatz", + "fr": "Engagement ex\u00e9cut\u00e9", + "it": "Intervento eseguito" + }, + "101-I-Ricognizione-eseguita": { + "de": "Durchgef\u00fchrte Erkundung", + "fr": "Reconnaissance ex\u00e9cut\u00e9e", + "it": "Ricognizione eseguita" + }, + "102-I-Automobile": { + "de": "Motorfahrzeug", + "fr": "V\u00e9hicule l\u00e9ger", + "it": "Automobile" + }, + "103-I-Autocarro": { + "de": "Lastwagen", + "fr": "Poids-lourd", + "it": "Autocarro" + }, + "104-I-Veicoli-per-il-transporto": { + "de": "Transportfahrzeug", + "fr": "V\u00e9hicule de transport", + "it": "Veicoli per il transporto" + }, + "105-I-Ambulanza": { + "de": "Ambulanz", + "fr": "Ambulance", + "it": "Ambulanza" + }, + "106-I-Elicottero": { + "de": "Helikopter", + "fr": "H\u00e9licopt\u00e8re", + "it": "Elicottero" + }, + "107-I-Autobotte": { + "de": "Tankl\u00f6schfahrzeug", + "fr": "Fourgon tonne-pompe", + "it": "Autobotte" + }, + "108-I-Lanciaacqua": { + "de": "Wasserwerfer", + "fr": "Canon \u00e0 eau", + "it": "Lanciaacqua" + }, + "109-I-Elevatore-a-navicella": { + "de": "Hubrettungsfahrzeug", + "fr": "El\u00e9vateur \u00e0 nacelle", + "it": "Elevatore a navicella" + }, + "110-I-Scala-motorizzata": { + "de": "Autodrehleiter", + "fr": "Echelle", + "it": "Scala motorizzata" + }, + "111-I-Strada-nazionale": { + "de": "Nationalstrasse", + "fr": "Route", + "it": "Strada nazionale" + }, + "112-I-Autostrada": { + "de": "Autobahn", + "fr": "Autoroute", + "it": "Autostrada" + }, + "113-I-Linea-ferroviaria": { + "de": "Eisenbahn", + "fr": "Chemin de fer", + "it": "Linea ferroviaria" + }, + "114-I-Divieto-di-navigazione": { + "de": "Schiffahrt Verbot", + "fr": "Interdiction de naviguer", + "it": "Divieto di navigazione" + }, + "115-I-Divieto-di-sorvolo": { + "de": "\u00dcberflugverbot", + "fr": "Interdiction de survoler", + "it": "Divieto di sorvolo" + }, + "116-I-Punto-di-raccolta-d-urgenza": { + "de": "Notfalltreffpunkt", + "fr": "Point de rassemblement d'urgence", + "it": "Punto di raccolta d'urgenza" + } +} diff --git a/scripts/generate_babs_dic.py b/scripts/generate_babs_dic.py new file mode 100644 index 0000000..b5861f5 --- /dev/null +++ b/scripts/generate_babs_dic.py @@ -0,0 +1,43 @@ +import argparse +import json + +# pylint: disable=import-error +import pandas as pd + + +def generate_translation_file(args): + id_range = slice(0, -4) + source = args.input + destination = args.output + df = pd.read_excel(source, sheet_name=0) + for filename in ['Dateiname - D', 'Dateiname - F', 'Dateiname - I']: + # read by default 1st sheet of an excel file + json_dic = {} + for index, row in df.iterrows(): + string_id = row[filename][id_range] + icon_dic = { + "de": row['Text Mouseover - D'], + "fr": row['Text Mouseover - F'], + "it": row['Text Mouseover - I'] + } + json_dic[string_id] = icon_dic + + with open( + destination + '-' + filename[-1] + '-dictionary.json', "w", encoding='utf-8' + ) as outfile: + json.dump(json_dic, outfile, indent=4) + + +def main(): + # example command: + # python3 generate_babs_dic.py --input=../../tmp/babs.xlsx --output=../metadata/description/babs + # (do not specify filetype for output since it creates a file for every language) + parser = argparse.ArgumentParser(description='Create json translation file from excel file ') + parser.add_argument('--input', action="store", dest='input', default=None) + parser.add_argument('--output', action="store", dest='output', default=None) + args = parser.parse_args() + generate_translation_file(args) + + +if __name__ == '__main__': + main() diff --git a/tests/unit_tests/test_all_icons.py b/tests/unit_tests/test_all_icons.py index c455fbd..ff1cdff 100644 --- a/tests/unit_tests/test_all_icons.py +++ b/tests/unit_tests/test_all_icons.py @@ -168,6 +168,12 @@ def test_all_icon_sets_metadata_endpoint(self): self.assertIn('name', icon_set_metadata) self.assertEqual(icon_set_name, icon_set_metadata['name']) self.assertIn('colorable', icon_set_metadata) + self.assertIn('description_url', icon_set_metadata) + if icon_set_metadata['description_url']: + r = self.app.get( + icon_set_metadata['description_url'], headers=self.default_header + ) + self.assertEqual(r.status_code, 200) self.assertIn('icons_url', icon_set_metadata) self.assertIsNotNone(icon_set_metadata['icons_url']) self.assertEqual( @@ -202,6 +208,11 @@ def test_all_icon_metadata_endpoint(self): json_response = response.json self.assertIn('icon_set', json_response) self.assertEqual(icon_set_name, json_response['icon_set']) + self.assertIn('description', json_response) + if json_response['description']: + self.assertIn('de', json_response['description']) + self.assertIn('fr', json_response['description']) + self.assertIn('it', json_response['description']) self.assertIn('name', json_response) self.assertEqual(icon_name, json_response['name']) self.assertIn('template_url', json_response) diff --git a/tests/unit_tests/test_description.py b/tests/unit_tests/test_description.py new file mode 100644 index 0000000..54751ef --- /dev/null +++ b/tests/unit_tests/test_description.py @@ -0,0 +1,57 @@ +import json +import os + +from flask import url_for + +from app.settings import DESCRIPTION_FOLDER +from tests.unit_tests.base_test import ServiceIconsUnitTests + + +def validate_json(json_file): + try: + json.loads(json_file) + except ValueError as err: + return False + return True + + +class IconsTests(ServiceIconsUnitTests): + + def test_validate_json_description_files(self): + files = list(os.listdir(DESCRIPTION_FOLDER)) + for file in files: + for root, dirs, files in os.walk(os.path.join(DESCRIPTION_FOLDER)): + for name in files: + p = os.path.join(root, name) + with open(p, encoding='utf-8') as f: + json_file = f.read() + self.assertTrue( + validate_json(json_file), "validation failed of json file: " + file + ) + + def test_get_icon_set_description_valid(self): + response = self.app.get( + url_for( + 'description_from_icon_set', + icon_set_name='babs-I', + ), + headers={"Origin": 'www.example.com'} + ) + self.assertEqual(response.status_code, 200) + + def test_get_icon_set_description_invalid(self): + response = self.app.get( + url_for( + 'description_from_icon_set', + icon_set_name='default', + ), + headers={"Origin": 'www.example.com'} + ) + self.assertEqual( + response.json, { + "error": { + "code": 404, "message": "Description dictionary not found" + }, + "success": False + } + ) diff --git a/tests/unit_tests/test_endpoints_compliance.py b/tests/unit_tests/test_endpoints_compliance.py index 0f7e97c..ac54da3 100644 --- a/tests/unit_tests/test_endpoints_compliance.py +++ b/tests/unit_tests/test_endpoints_compliance.py @@ -37,6 +37,14 @@ def test_icon_set_metadata(self): ) ) + def test_icon_set_description(self): + self.check_response_compliance( + self.app.get( + url_for('description_from_icon_set', icon_set_name='babs-I'), + headers=self.default_header + ) + ) + def test_icons_list(self): self.check_response_compliance( self.app.get(