From 9d40a2cd06a41948a20da252f1df28d544ec567a Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Fri, 5 Apr 2024 17:46:19 -0400 Subject: [PATCH 1/2] reduce strings by removing duplicates --- .../resource.language.en_gb/strings.po | 29 ++++++++++++------- resources/lib/version_check/common.py | 14 ++------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index f3c9a17..e832c32 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -92,17 +92,7 @@ msgctxt "#32024" msgid "Linux: Upgrade using apt" msgstr "" -# empty strings from id 32025 to 32029 - -#. Used in OK dialog -msgctxt "#32030" -msgid "A new stable version of Kodi is available." -msgstr "" - -#. Direct people to the website. Used in OK dialog -msgctxt "#32031" -msgid "Visit http://kodi.tv for more information." -msgstr "" +# empty strings from id 32025 to 32031 #. Used in OK dialog msgctxt "#32032" @@ -137,3 +127,20 @@ msgstr "" msgctxt "#32042" msgid "For more information, see https://kodi.wiki/view/Linux" msgstr "" + +msgctxt "#32043" +msgid "How can I help make Kodi better?" +msgstr "" + +msgctxt "#32044" +msgid "Kodi Foundation products are for the users and created by the users. There are no highly paid developers or poorly paid support personnel on the phones ready to take your call. There are only users who have seen a problem and done their best to fix it. This means the Kodi Foundation will always need the contributions of users like you. How can you get involved?" +msgstr "" + +msgctxt "#32045" +msgid "Donate" +msgstr "" + +msgctxt "#32046" +msgid "Contribute" +msgstr "" + diff --git a/resources/lib/version_check/common.py b/resources/lib/version_check/common.py index bdcba59..15e10d9 100644 --- a/resources/lib/version_check/common.py +++ b/resources/lib/version_check/common.py @@ -218,25 +218,17 @@ def upgrade_message2(version_installed, version_available, version_stable, old_v if ADDON.getSetting('lastnotified_version') == '0.1.24': ADDON.setSetting('lastnotified_stable', msg_stable) - # Show different dialogs depending if there's a newer stable available. + # Show different dialogs depending on if there's a newer stable available. # Also split them between xbmc and kodi notifications to reduce possible confusion. # People will find out once they visit the website. # For stable only notify once and when there's a newer stable available. # Ignore any add-on updates as those only count for != stable if old_version == 'stable' and ADDON.getSetting('lastnotified_stable') != msg_stable: - if xbmcaddon.Addon('xbmc.addon').getAddonInfo('version') < '13.9.0': - xbmcgui.Dialog().ok(ADDON_NAME, '[CR]'.join([msg, localise(32030), localise(32031)])) - else: - xbmcgui.Dialog().ok(ADDON_NAME, '[CR]'.join([msg, localise(32032), localise(32033)])) + xbmcgui.Dialog().ok(ADDON_NAME, '[CR]'.join([msg, localise(32032), localise(32033)])) ADDON.setSetting('lastnotified_stable', msg_stable) elif old_version != 'stable' and ADDON.getSetting('lastnotified_version') != msg_available: - if xbmcaddon.Addon('xbmc.addon').getAddonInfo('version') < '13.9.0': - # point them to xbmc.org - xbmcgui.Dialog().ok(ADDON_NAME, '[CR]'.join([msg, localise(32035), localise(32031)])) - else: - # use kodi.tv - xbmcgui.Dialog().ok(ADDON_NAME, '[CR]'.join([msg, localise(32035), localise(32033)])) + xbmcgui.Dialog().ok(ADDON_NAME, '[CR]'.join([msg, localise(32035), localise(32033)])) ADDON.setSetting('lastnotified_version', msg_available) From f759c24481485a0e8d89a81243692ae7d2505e79 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Fri, 5 Apr 2024 17:47:04 -0400 Subject: [PATCH 2/2] rename functions to make less ambiguous --- resources/lib/version_check/common.py | 4 ++-- resources/lib/version_check/service.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/lib/version_check/common.py b/resources/lib/version_check/common.py index 15e10d9..1eccb5a 100644 --- a/resources/lib/version_check/common.py +++ b/resources/lib/version_check/common.py @@ -163,7 +163,7 @@ def dialog_yes_no(line1=0, line2=0): return xbmcgui.Dialog().yesno(ADDON_NAME, '[CR]'.join([localise(line1), localise(line2)])) -def upgrade_message(msg): +def linux_upgrade_message(msg): """ Prompt user with upgrade suggestion message :param msg: string id for prompt message @@ -183,7 +183,7 @@ def upgrade_message(msg): return answer -def upgrade_message2(version_installed, version_available, version_stable, old_version): +def non_linux_upgrade_message(version_installed, version_available, version_stable, old_version): """ Prompt user with upgrade suggestion message :param version_installed: currently installed version diff --git a/resources/lib/version_check/service.py b/resources/lib/version_check/service.py index ce2636a..4ca0f6c 100644 --- a/resources/lib/version_check/service.py +++ b/resources/lib/version_check/service.py @@ -27,8 +27,8 @@ from .common import wait_for_abort from .common import message_restart from .common import message_upgrade_success -from .common import upgrade_message -from .common import upgrade_message2 +from .common import linux_upgrade_message +from .common import non_linux_upgrade_message from .json_interface import get_version_file_list from .json_interface import get_installed_version from .versions import compare_version @@ -105,7 +105,7 @@ def _version_check_linux(packages): if handler: if handler.check_upgrade_available(packages[0]): - if upgrade_message(32012): + if linux_upgrade_message(32012): if ADDON.getSetting('upgrade_system') == 'false': result = handler.upgrade_package(packages[0]) else: @@ -171,4 +171,4 @@ def run(): else: old_version, version_installed, version_available, version_stable = _version_check() if old_version: - upgrade_message2(version_installed, version_available, version_stable, old_version) + non_linux_upgrade_message(version_installed, version_available, version_stable, old_version)