Remove call to `QTranslator.language()` in `get_locale`. (#1316)

This commit is contained in:
yfprojects 2022-05-25 15:42:54 +00:00 committed by GitHub
parent e58c83b5c9
commit 56e5c5049f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -71,8 +71,11 @@ def init_translations(app):
def get_locale():
"""Get the locale used for translation."""
global translator
return QLocale(translator.language())
# global translator
# QTranslator.language was added with Qt 15.15
# return QLocale(translator.language())
global locale
return locale
def translate(*args, **kwargs):

View File

@ -68,5 +68,11 @@ def test_schedule_tab(qapp: VortaApp, qtbot, clockmock):
qapp.scheduler.set_timer_for_profile(profile.id)
tab.draw_next_scheduled_backup()
assert next_backup.strftime('%B %Y %H:%M:%S') in tab.nextBackupDateTimeLabel.text()
assert tab.nextBackupDateTimeLabel.text() not in [
"Run a manual backup first",
"None scheduled",
]
assert qapp.scheduler.next_job_for_profile(profile.id).time == next_backup
qapp.scheduler.remove_job(profile.id)