Skip to content

Commit

Permalink
PB-227: Use dictionary for icon-set language metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasJoss committed Sep 11, 2024
1 parent 257aa96 commit 43e4e20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/icon_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from app.helpers.url import get_base_url
from app.icon import Icon
from app.settings import COLORABLE_ICON_SETS
from app.settings import ICON_SET_LANGUAGE
from app.settings import IMAGE_FOLDER
from app.settings import LEGACY_ICON_SETS

Expand Down Expand Up @@ -122,5 +123,5 @@ def serialize(self):
"icons_url": self.get_icons_url(),
"template_url": get_icon_set_template_url(get_base_url()),
"has_description": bool(find_descripton_file(self.name)),
"language": self.name.split('-')[-1] if '-' in self.name else None
"language": ICON_SET_LANGUAGE[self.name] if self.name in ICON_SET_LANGUAGE else None
}
1 change: 1 addition & 0 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

COLORABLE_ICON_SETS = ['default']
LEGACY_ICON_SETS = ['babs']
ICON_SET_LANGUAGE = {'babs-de': 'de', 'babs-fr': 'fr', 'babs-it': 'it'}
DEFAULT_COLOR = {"r": '255', "g": '0', "b": '0'}
DEFAULT_ICON_SIZE = 48
TRAP_HTTP_EXCEPTIONS = True
Expand Down

0 comments on commit 43e4e20

Please sign in to comment.