From a3598a1c40b76c2a9f2f4750d54f74a19e7b72af Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Thu, 27 May 2021 11:31:06 +0100 Subject: [PATCH] Suits: The symbol -> name code is a WORKAROUND --- monitor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index a753e6b1..fd69a594 100644 --- a/monitor.py +++ b/monitor.py @@ -1610,7 +1610,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below :param name: Name that could be in any of the forms. :return: Our sane version of this suit's name. """ - # TODO: Localisation ? + # WORKAROUND 4.0.0.200 | 2021-05-27: Suit names above Grade 1 aren't localised + # properly by Frontier, so we do it ourselves. # Stage 1: Is it in `$<type>_Class<X>_Name;` form ? if m := re.fullmatch(r'(?i)^\$([^_]+)_Class([0-9]+)_Name;$', name): n, c = m.group(1, 2) @@ -1621,9 +1622,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below n, c = m.group(1, 2) name = n - # Now turn either of those into an English '<type> Suit' form + # Now turn either of those into a '<type> Suit' (modulo language) form if loc_lookup := edmc_suit_symbol_localised.get(self.state['GameLanguage']): name = loc_lookup.get(name.lower(), name) + # WORKAROUND END # Finally, map that to a form without the verbose ' Suit' on the end name = edmc_suit_shortnames.get(name, name)