diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py index 1dc05c8b9..93d9f1fe3 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py @@ -11,7 +11,6 @@ from anyway.widgets.road_segment_widgets.road_segment_widget import RoadSegmentWidget from anyway.widgets.widget import register - @register class KilledInjuredCountPerAgeGroupWidget(RoadSegmentWidget): name: str = "killed_and_injured_count_per_age_group" @@ -32,7 +31,6 @@ def generate_items(self) -> None: count_total += count structured_data_list.append({BE.LKEY: age_group, BE.VAL: count_total}) - self.items = structured_data_list @staticmethod diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py index 27c21ec56..dcdf17088 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py @@ -4,6 +4,7 @@ from flask_sqlalchemy import BaseQuery from sqlalchemy import func, asc +from flask_babel import _ from anyway.app_and_db import db from anyway.backend_constants import BE_CONST, InjurySeverity @@ -80,10 +81,10 @@ def defaultdict_int_factory() -> Callable: if not found_age_range: dict_grouped[UNKNOWN][injury_id] += count - # Rename the last key dict_grouped[SIXTY_FIVE_PLUS] = dict_grouped[SIXTY_TWOHUNDRED] del dict_grouped[SIXTY_TWOHUNDRED] + dict_grouped[_("unknown")] = dict_grouped.pop(UNKNOWN) return dict_grouped, has_data @staticmethod @@ -121,4 +122,4 @@ def create_query_for_killed_and_injured_count_per_age_group( ) .order_by(asc(InvolvedMarkerView.age_group)) ) - return query + return query \ No newline at end of file diff --git a/babel.cfg b/babel.cfg index 98af24546..c8a8cc57e 100644 --- a/babel.cfg +++ b/babel.cfg @@ -2,7 +2,7 @@ [python: **.py] [jinja2: **/templates/**.html] -extensions=jinja2.ext.autoescape,jinja2.ext.with_,jinja2.ext.i18n,jinja2.ext.do,webassets.ext.jinja2.AssetsExtension +extensions=jinja2.ext.i18n,jinja2.ext.do,webassets.ext.jinja2.AssetsExtension encoding = utf-8 silent=0 diff --git a/messages.pot b/messages.pot index 236ee2cd9..050a5cd8a 100644 --- a/messages.pot +++ b/messages.pot @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-06-22 13:32+0000\n" +"POT-Creation-Date: 2023-09-14 15:58+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" +"Generated-By: Babel 2.12.1\n" #: anyway/backend_constants.py:148 msgid "killed" @@ -29,11 +29,11 @@ msgstr "" msgid "light injured" msgstr "" -#: anyway/flask_app.py:678 anyway/flask_app.py:782 +#: anyway/flask_app.py:682 anyway/flask_app.py:786 msgid "Discussion not found:" msgstr "" -#: anyway/flask_app.py:681 +#: anyway/flask_app.py:685 msgid "Illegal Discussion" msgstr "" @@ -263,7 +263,21 @@ msgid "Number of accidents by severity" msgstr "" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:123 -msgid "road_segment_namenon_urban_intersection_hebrew" +#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 +#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 +#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 +#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 +#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 +#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 +#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:50 +#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 +msgid "road_segment_name" +msgstr "" + +#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:124 +msgid "non_urban_intersection_hebrew" msgstr "" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:129 @@ -407,19 +421,6 @@ msgstr "" msgid "Accidents in segment" msgstr "" -#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 -#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 -#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 -#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 -#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 -#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 -#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:42 -#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 -msgid "road_segment_name" -msgstr "" - #: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:63 msgid "" "Fatal, severe and light accidents count in the specified years, split by " @@ -580,7 +581,13 @@ msgstr "" msgid "Killed and injury stacked per age group" msgstr "" -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:41 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:29 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:87 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:91 +msgid "unknown" +msgstr "" + +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:49 msgid "Injury per age group" msgstr "" diff --git a/translations/he/LC_MESSAGES/messages.mo b/translations/he/LC_MESSAGES/messages.mo index 161092884..486165122 100644 Binary files a/translations/he/LC_MESSAGES/messages.mo and b/translations/he/LC_MESSAGES/messages.mo differ diff --git a/translations/he/LC_MESSAGES/messages.po b/translations/he/LC_MESSAGES/messages.po index 495366d3f..1445a68f7 100644 --- a/translations/he/LC_MESSAGES/messages.po +++ b/translations/he/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-06-22 13:32+0000\n" +"POT-Creation-Date: 2023-09-14 15:58+0300\n" "PO-Revision-Date: 2020-10-16 15:42+0000\n" "Last-Translator: FULL NAME \n" "Language: he\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" +"Generated-By: Babel 2.12.1\n" #: anyway/backend_constants.py:148 msgid "killed" @@ -30,11 +30,11 @@ msgstr "פצוע/ה קשה" msgid "light injured" msgstr "פצוע/ה קל" -#: anyway/flask_app.py:678 anyway/flask_app.py:782 +#: anyway/flask_app.py:682 anyway/flask_app.py:786 msgid "Discussion not found:" msgstr "" -#: anyway/flask_app.py:681 +#: anyway/flask_app.py:685 msgid "Illegal Discussion" msgstr "" @@ -249,12 +249,9 @@ msgstr "תאונות" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:109 #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:170 -msgid "out of them" -msgstr "מתוכן" - #: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:121 msgid "out of them" -msgstr "מתוכם" +msgstr "מתוכן" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:113 #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:172 @@ -267,7 +264,21 @@ msgid "Number of accidents by severity" msgstr "מספר תאונות לפי חומרה" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:123 -msgid "road_segment_namenon_urban_intersection_hebrew" +#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 +#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 +#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 +#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 +#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 +#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 +#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:50 +#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 +msgid "road_segment_name" +msgstr "" + +#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:124 +msgid "non_urban_intersection_hebrew" msgstr "" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:129 @@ -417,19 +428,6 @@ msgstr "" msgid "Accidents in segment" msgstr "תאונות במקטע" -#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 -#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 -#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 -#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 -#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 -#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 -#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:42 -#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 -msgid "road_segment_name" -msgstr "" - #: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:63 msgid "" "Fatal, severe and light accidents count in the specified years, split by " @@ -599,7 +597,13 @@ msgstr "מספר תאונות לפי חומרה" msgid "Killed and injury stacked per age group" msgstr "חומרת פגיעה לפי קבוצת גיל" -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:41 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:29 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:87 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:91 +msgid "unknown" +msgstr "לא ידוע" + +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:49 msgid "Injury per age group" msgstr "נפגעים לפי קבוצת גיל" @@ -809,3 +813,6 @@ msgstr "" #~ msgid "on street" #~ msgstr "ברחוב" +#~ msgid "road_segment_namenon_urban_intersection_hebrew" +#~ msgstr "" +