Skip to content

Commit

Permalink
[fix] add missing localizable (gettext) messages to searxng.msg
Browse files Browse the repository at this point in the history
To test this patch I used .. and checked the diff of the `messages.pot` file::

    $ ./manage pyenv.cmd pybabel extract -F babel.cfg \
              -o ./searx/translations/messages.pot searx/
    $ git diff ./searx/translations/messages.pot

----

hint from @dalf: f-string are not supported [1] but there is no error [2].

searx/translations/messages.pot

[1] python-babel/babel#594
[2] python-babel/babel#715

Closes: searxng#3412
Signed-off-by: Markus Heiser <[email protected]>
  • Loading branch information
return42 committed Apr 21, 2024
1 parent af3be2b commit 99bbe39
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion searx/engines/yummly.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def response(resp):
'title': result['display']['displayName'],
'content': content,
'img_src': img_src,
'metadata': f"{gettext('Language')}: {result['locale'].split('-')[0]}",
'metadata': gettext('Language') + f": {result['locale'].split('-')[0]}",
}
)

Expand Down
38 changes: 38 additions & 0 deletions searx/searxng.msg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ __all__ = [
'CATEGORY_GROUPS',
'STYLE_NAMES',
'BRAND_CUSTOM_LINKS',
'WEATHER_TERMS',
'SOCIAL_MEDIA_TERMS',
]

CONSTANT_NAMES = {
Expand All @@ -27,6 +29,8 @@ CATEGORY_NAMES = {
'SOCIAL_MEDIA': 'social media',
'IMAGES': 'images',
'VIDEOS': 'videos',
'RADIO': 'radio',
'TV': 'tv',
'IT': 'it',
'NEWS': 'news',
'MAP': 'map',
Expand Down Expand Up @@ -57,3 +61,37 @@ BRAND_CUSTOM_LINKS = {
'UPTIME': 'Uptime',
'ABOUT': 'About',
}

WEATHER_TERMS = {
'AVERAGE TEMP.': 'Average temp.',
'CLOUD COVER': 'Cloud cover',
'CONDITION': 'Condition',
'CURRENT CONDITION': 'Current condition',
'EVENING': 'Evening',
'FEELS LIKE': 'Feels like',
'HUMIDITY': 'Humidity',
'MAX TEMP.': 'Max temp.',
'MIN TEMP.': 'Min temp.',
'MORNING': 'Morning',
'NIGHT': 'Night',
'NOON': 'Noon',
'PRESSURE': 'Pressure',
'SUNRISE': 'Sunrise',
'SUNSET': 'Sunset',
'TEMPERATURE': 'Temperature',
'UV INDEX': 'UV index',
'VISIBILITY': 'Visibility',
'WIND': 'Wind',
}

SOCIAL_MEDIA_TERMS = {
'SUBSCRIBERS': 'subscribers',
'POSTS': 'posts',
'ACTIVE USERS': 'active users',
'COMMENTS': 'comments',
'USER': 'user',
'COMMUNITY': 'community',
'POINTS': 'points',
'TITLE': 'title',
'AUTHOR': 'author',
}

0 comments on commit 99bbe39

Please sign in to comment.