biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / gramps / check-locale-hasattr-textdomain.patch
blobe1573ba5de33eb0a7aae3f341f7e68684a45e9d6
1 diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py
2 index f25030e..59c1c90 100644
3 --- a/gramps/gen/utils/grampslocale.py
4 +++ b/gramps/gen/utils/grampslocale.py
5 @@ -370,8 +370,12 @@ class GrampsLocale:
7 else:
8 # bug12278, _build_popup_ui() under linux and macOS
9 - locale.textdomain(self.localedomain)
10 - locale.bindtextdomain(self.localedomain, self.localedir)
11 + if hasattr(locale, 'textdomain'):
12 + locale.textdomain(self.localedomain)
13 + locale.bindtextdomain(self.localedomain, self.localedir)
14 + else:
15 + gettext.textdomain(self.localedomain)
16 + gettext.bindtextdomain(self.localedomain, self.localedir)
18 self.rtl_locale = False
19 if self.language[0] in _RTL_LOCALES: