Skip to content

Commit c1da056

Browse files
committed
Move font descriptions into FontPackage enum method
1 parent 65ef220 commit c1da056

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

archinstall/lib/applications/application_menu.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,7 @@ async def select_firewall(preset: FirewallConfiguration | None = None) -> Firewa
236236

237237

238238
async def select_fonts(preset: FontsConfiguration | None = None) -> FontsConfiguration | None:
239-
descriptions = {
240-
FontPackage.NOTO: tr('Unicode font coverage for most languages'),
241-
FontPackage.EMOJI: tr('color emoji for browsers and apps'),
242-
FontPackage.CJK: tr('Chinese, Japanese, Korean characters'),
243-
}
244-
items = [MenuItem(f'{f.value} ({descriptions[f]})', value=f) for f in FontPackage]
239+
items = [MenuItem(f'{f.value} ({f.description()})', value=f) for f in FontPackage]
245240
group = MenuItemGroup(items)
246241

247242
if preset:

archinstall/lib/models/application.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from enum import StrEnum, auto
33
from typing import Any, NotRequired, Self, TypedDict
44

5+
from archinstall.lib.translationhandler import tr
6+
57

68
class PowerManagement(StrEnum):
79
POWER_PROFILES_DAEMON = 'power-profiles-daemon'
@@ -44,6 +46,15 @@ class FontPackage(StrEnum):
4446
EMOJI = 'noto-fonts-emoji'
4547
CJK = 'noto-fonts-cjk'
4648

49+
def description(self) -> str:
50+
match self:
51+
case FontPackage.NOTO:
52+
return tr('Unicode font coverage for most languages')
53+
case FontPackage.EMOJI:
54+
return tr('color emoji for browsers and apps')
55+
case FontPackage.CJK:
56+
return tr('Chinese, Japanese, Korean characters')
57+
4758

4859
class FontsConfigSerialization(TypedDict):
4960
fonts: list[str]

0 commit comments

Comments
 (0)