Philipp Hörist pushed to branch master at gajim / gajim
Commits: 2ac83815 by lovetox at 2022-08-12T23:21:46+02:00 refactor: Use Path objects for gettext calls
Seems python 3.9 does support this now
- - - - -
2 changed files:
- gajim/common/i18n.py - gajim/plugins/plugins_i18n.py
Changes:
===================================== gajim/common/i18n.py ===================================== @@ -54,7 +54,7 @@ def get_locale_dirs() -> Optional[list[Path]]: return [Path(dir_) for dir_ in data_dirs]
-def iter_locale_dirs() -> Iterator[Optional[str]]: +def iter_locale_dirs() -> Iterator[Optional[Path]]: locale_dirs = get_locale_dirs() if locale_dirs is None: yield None @@ -70,7 +70,7 @@ def iter_locale_dirs() -> Iterator[Optional[str]]: continue found_paths.append(locale_dir) if locale_dir.is_dir(): - yield str(locale_dir) + yield locale_dir
def get_win32_default_lang() -> str:
===================================== gajim/plugins/plugins_i18n.py ===================================== @@ -29,8 +29,7 @@ plugin_user_dir = Path.cwd()
-# python 3.7 gettext module does not support Path objects -plugins_locale_dir = str(plugin_user_dir / 'locale') +plugins_locale_dir = plugin_user_dir / 'locale'
try: t = gettext.translation(DOMAIN, plugins_locale_dir)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2ac83815d02a8f1a458c259807e8a6b9c...