Skip to content

Commit

Permalink
This is strange
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende authored and geigi committed Dec 3, 2023
1 parent c544a56 commit 2a797fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cozy/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ def __init__(self, localedir: str, pkgdatadir: str):
sys.excepthook = self.handle_exception
setup_thread_excepthook()

# We need to call `locale.*textdomain` to get the strings in UI files translated
locale.bindtextdomain('com.github.geigi.cozy', localedir)
locale.textdomain('com.github.geigi.cozy')

# But also `gettext.*textdomain`, to make `_("foo")` in Python work as well
gettext.bindtextdomain('com.github.geigi.cozy', localedir)
gettext.textdomain('com.github.geigi.cozy')

gettext.install('com.github.geigi.cozy', localedir)

def do_startup(self):
Expand Down

0 comments on commit 2a797fc

Please sign in to comment.