Skip to content

Commit

Permalink
Fixed various i18n inline python usage and updated python i18n strings (
Browse files Browse the repository at this point in the history
datacommonsorg#4946)

* Updated pybabel mapping configuration to include `shared_api/place.py`
and `lib/i18n_messages.py`
* Updated `i18n_messages.py` to include calls to `gettext` & translation
descriptions so pybabel can automatically extract them.
* Reverted `translate` calls back to `gettext` because the
[pybabel](https://github.com/datacommonsorg/website/blob/master/scripts/extract_messages.sh#L36)
extraction tool wasn't able to properly pull the messages from the
python code.
* Fixed {% trans %} calls in `server/templates/metadata/labels.html`
  • Loading branch information
dwnoble authored Feb 12, 2025
1 parent ff60e15 commit 4ba42ec
Show file tree
Hide file tree
Showing 32 changed files with 2,321 additions and 1,002 deletions.
7 changes: 4 additions & 3 deletions server/babel-mapping.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[python: **/api/place.py]
[python: **/shared_api/place.py]
[python: **/lib/i18n_messages.py]
[jinja2: **/templates/**.html]
encoding = utf-8
extensions=jinja2.ext.i18n,jinja2.ext.autoescape,jinja2.ext.with_
ext.i18n.trimmed=True
extensions=jinja2.ext.i18n
ext.i18n.trimmed=True
2 changes: 1 addition & 1 deletion server/config/chart_config/crime_new.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"category": "Crime",
"title_id": "CHART_TITLE-Violent_crime",
"title": "Violent crime",
"description": "Total number of violent incidents",
"description": "Total number of violent crime incidents",
"variables": [
"Count_CriminalActivities_ViolentCrime"
],
Expand Down
Loading

0 comments on commit 4ba42ec

Please sign in to comment.