From 7c3c1f76685b1fc7d471e8bdc962f90ae25add8a Mon Sep 17 00:00:00 2001 From: LeKeno <33626494+lekeno@users.noreply.github.com> Date: Sat, 17 Dec 2022 03:25:48 +0900 Subject: [PATCH] Fix crasher in EDMC 5.7.x Python 3.11 removed codeset in translation. --- edr/edrfssinsights.py | 1 + edr/edri18n.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/edr/edrfssinsights.py b/edr/edrfssinsights.py index 59ffb0ee..4a7840a0 100644 --- a/edr/edrfssinsights.py +++ b/edr/edrfssinsights.py @@ -14,6 +14,7 @@ def __init__(self): "$MULTIPLAYER_SCENARIO80_TITLE;": {"count": 0, "short_name": _("Compromised Nav Beacon") }, "$MULTIPLAYER_SCENARIO81_TITLE;": {"count": 0, "short_name": _("Salvageable Wreckage")}, "$FIXED_EVENT_NUMBERSTATION;": {"count": 0, "short_name": _("Anomalous Signal - Numbers Station") }, + # TODO "$Warzone_TG_...:#index=1; ... = High, Low, Med, VeryHigh "$Warzone_TG;": {"count": 0, "short_name": _("CZ [AX]") }, "$FIXED_EVENT_CAPSHIP;": {"count": 0, "short_name": _("CAPITAL SHIP") }, "$NumberStation:#index=1;": {"count": 0, "short_name": _("Unreg. Comms - Numbers Station (Ⅰ)") }, diff --git a/edr/edri18n.py b/edr/edri18n.py index 21f7fc0f..f56e2e70 100644 --- a/edr/edri18n.py +++ b/edr/edri18n.py @@ -12,15 +12,15 @@ CONTEXT_SEPARATOR = u"|" L10N_DIR = utils2to3.abspathmaker(__file__, 'l10n') language = None -translate = gettext.translation('edr', L10N_DIR, fallback=True, codeset="utf-8") +translate = gettext.translation('edr', L10N_DIR, fallback=True) def set_language(lang): global language, translate language = lang if language: - translate = gettext.translation('edr', L10N_DIR, fallback=True, languages=[language], codeset="utf-8") + translate = gettext.translation('edr', L10N_DIR, fallback=True, languages=[language]) else: - translate = gettext.translation('edr', L10N_DIR, fallback=True, codeset="utf-8") + translate = gettext.translation('edr', L10N_DIR, fallback=True) def ugettext(message): if sys.version_info.major == 2: