773 Commits
Author SHA1 Message Date
David Sangrey 99709c0146 [#2444] Invert Link Opener Priority 2026-01-07 21:52:14 -05:00
David Sangrey dc90353d2f Deprecate text.gzip
This didn't really have any impact given that we can always compress EDDN data.
2026-01-04 23:19:14 -05:00
David Sangrey 5ea845c3ac Update for New Enum 2026-01-04 20:05:34 -05:00
David Sangrey beb68efae8 [2568] Fix Ships JSON Typo 2025-12-25 01:36:24 -05:00
Inutt 523f890e7b Fix if->elif left over from reverts 2025-12-05 00:25:44 +00:00
Inutt 140f0fbc41 Revert "[#2532] Ignore Loadout If Embarked"
This reverts commit b85705c13a.
2025-12-05 00:23:15 +00:00
Inutt 26e3407f53 Revert "Add Multicrew Check Too"
This reverts commit a8e34f2a3b.
2025-12-05 00:20:14 +00:00
David Sangrey 2041b3d3d3 [Minor] Update Type Hints and Alias Usages 2025-12-01 22:04:28 -05:00
Inutt 9fd04e5c02 Add localisation of stations names
This currently only affects system colonisation ships, which have '$EXT_PANEL_ColonisationShip;' in their StationName
entries in the journal. Other strings may need to be added in future.

Fixes #2404
diff --git a/L10n/en.template b/L10n/en.template
index faac3259..f670e39c 100644
--- a/L10n/en.template
+++ b/L10n/en.template
@@ -839,3 +839,9 @@

 /* edastro_core.py: Settings>EDAstro - Label on checkbox for 'send data'; */
 "Send data to EDAstro" = "Send data to EDAstro";
+
+/* common_coreutils.py: Colonisation ship name, with title; In files: common_coreutils.py:81:81 */
+"System Colonisation Ship {NAME}" = "System Colonisation Ship {NAME}";
+
+/* common_coreutils.py: Unidentified colonisation ship; In files: common_coreutils.py:84:84 */
+"System Colonisation Ship" = "System Colonisation Ship";
diff --git a/plugins/common_coreutils.py b/plugins/common_coreutils.py
index 6b90d4dc..a488de46 100644
--- a/plugins/common_coreutils.py
+++ b/plugins/common_coreutils.py
@@ -29,6 +29,7 @@ import gzip
 import io
 import json
 import os
+import re
 import myNotebook as nb  # noqa: N813
 from EDMCLogging import get_main_logger
 from companion import CAPIData
@@ -47,6 +48,49 @@ SEPY = 10  # seperator line spacing
 STATION_UNDOCKED = '×'  # "Station" name to display when not docked = U+00D7

+# Known colonisation ship names match one of the following:
+#   "$EXT_PANEL_ColonisationShip;"
+#   "$EXT_PANEL_ColonisationShip; <ship name>" with "<ship name>" being eg; "Okawara Horizons"
+#   "$EXT_PANEL_ColonisationShip:#index=<number>;"
+#   "$EXT_PANEL_ColonisationShip:#index=<number>; <ship name>"
+_RE_COLONISATION_SHIP = re.compile(r'\$EXT_PANEL_ColonisationShip(?::#index=(\d+))?;(?: (.+))?')
+
+
+def localised_name(value: str | None) -> str | None:
+    """
+    Handle localisation of strings in places like station names.
+
+    This is currently an issue for system colonisation ships that have a station name along the
+    lines of "$EXT_PANEL_ColonisationShip; Okawara Horizons" when written to the journal, but would
+    be better displayed as "System Colonisation Ship Okawara Horizona" (or other appropriately
+    localised equivalent).
+
+    If no (known) localisable strings are present, the input will be returned unmodified.
+
+    :param value: The non-localised string.
+    :return: The localised string, or None if the input was None.
+    """
+    if value is None:
+        return None
+
+    colonisation_ship_match = _RE_COLONISATION_SHIP.match(value)
+    if colonisation_ship_match:
+        ship_index = colonisation_ship_match.group(1)
+        ship_name = colonisation_ship_match.group(2)
+        # Use the ship's index as its name if no name was provided.
+        ship_id = ship_name or ship_index
+
+        if ship_id:
+            # LANG: Colonisation ship name, with title
+            value = tr.tl("System Colonisation Ship {NAME}").format(NAME=ship_id)
+
+        else:
+            # LANG: Unidentified colonisation ship
+            value = tr.tl("System Colonisation Ship")
+
+    return value
+
+
 def plugin_start3(plugin_dir: str) -> str:
     """
     Start the plugin.
@@ -121,7 +165,7 @@ def station_link_common(data: CAPIData, this):
     :param this: The module global from the calling module.
     """
     if data['commander']['docked'] or this.on_foot and this.station_name:
-        this.station_link['text'] = this.station_name
+        this.station_link['text'] = localised_name(this.station_name)
     elif data['lastStarport']['name'] and data['lastStarport']['name'] != "":
         this.station_link['text'] = STATION_UNDOCKED
     else:
@@ -163,12 +207,14 @@ def station_name_setter_common(this):
     :param this: The module global from the calling module.
     """
     to_set: str = cast(str, this.station_name)
+
     if not to_set:
         if this.system_population is not None and this.system_population > 0:
             to_set = STATION_UNDOCKED
         else:
             to_set = ''

+    to_set = str(localised_name(to_set))
     this.station_link['text'] = to_set

diff --git a/plugins/edsm.py b/plugins/edsm.py
index e1e6b168..902e248b 100644
--- a/plugins/edsm.py
+++ b/plugins/edsm.py
@@ -43,7 +43,7 @@ from ttkHyperlinkLabel import HyperlinkLabel
 from l10n import translations as tr
 from plugins.common_coreutils import (api_keys_label_common, PADX, PADY, BUTTONX, SEPY, BOXY, STATION_UNDOCKED,
                                       show_pwd_var_common, station_link_common, this_format_common,
-                                      cmdr_data_initial_common)
+                                      cmdr_data_initial_common, localised_name)

 # TODO:
@@ -543,7 +543,7 @@ entry: {entry!r}'''
                 to_set = ''

         if this.station_link:
-            this.station_link['text'] = to_set
+            this.station_link['text'] = localised_name(to_set)
             this.station_link['url'] = station_url(str(this.system_name), str(this.station_name))
             this.station_link.update_idletasks()
2025-11-29 01:25:19 +00:00
David Sangrey a8e34f2a3b Add Multicrew Check Too 2025-11-20 18:00:06 -05:00
David Sangrey b85705c13a [#2532] Ignore Loadout If Embarked 2025-11-20 17:53:57 -05:00
David Sangrey 71e803f8b5 [Minor] Don't Continually Enable EDAstro 2025-11-13 22:31:02 -05:00
David Sangrey 5405664d52 [Minor] Don't Continually Enable EDAstro 2025-11-13 22:26:00 -05:00
David Sangrey a6bafe58b7 Remove Deprecated Functions 2025-11-13 21:45:06 -05:00
David Sangrey 03cbe85535 [2116] A Few More Hand-Overs 2025-11-11 23:17:02 -05:00
David Sangrey c3f9247cd1 [#2116] Hand more things to TTK 2025-11-11 20:24:58 -05:00
David Sangrey 497528c32a Merge pull request #2522 from HullSeals/enhancement/2430/edastro_core
Add EDAstro Plugin
2025-11-11 19:10:29 -05:00
David Sangrey f9ccba3aa1 [2430] Add ScanOrganic 2025-11-11 19:07:28 -05:00
David Sangrey de72947098 Merge pull request #2501 from klightspeed/fix-eddn-parent
[Bugfix] Fix EDDN queue not processing at startup
2025-11-09 19:09:17 -05:00
David Sangrey 715553207f [#2430] First-Pass EDAstro Core Plugin 2025-11-09 18:00:50 -05:00
David Sangrey 6d474abd01 Update Dep Warnings using Python 3.13 Syntax 2025-11-09 13:40:04 -05:00
Ben Peddell 13487ff763 [Bugfix] Fix EDDN queue not processing at startup
Workaround the `.after()` queue being cleared (or invalidated) when the
widget that call was made through is destroyed after that call is made,
which in this case resulted in the EDDN queue not being processed until
some other action re-triggered processing of the EDDN queue.
2025-10-04 21:58:21 +10:00
David Sangrey d6fb5d7477 [#2375] Improve Legacy Queue Detection 2025-05-19 22:00:17 -04:00
David Sangrey 73e134e39d [#2415] Fix Inara Linking 2025-05-03 19:39:28 -04:00
David Sangrey e31de6a999 [2406] Update BooleanVar when on CMDLINE 2025-04-14 21:33:17 -04:00
David Sangrey f0d20f6534 [Minor] Remove Dupe Undock 2025-04-13 13:51:25 -04:00
David Sangrey 26f06b7bf0 [#2406] Consolidate Modules 2025-04-13 13:42:06 -04:00
David Sangrey 749ae939b5 [Minor] Flake8 Linter Run 2025-03-31 20:31:23 -04:00
David Muckle 2b4c8280c3 Update powerplay tracking to account for new journal events 2025-03-24 20:08:50 -04:00
David Muckle 9ff3327ff7 Add code to track PP2.0 rank, merits, etc 2025-02-20 19:17:50 -05:00
David Sangrey 6bc29f07d6 Merge pull request #2276 from HansAcker/eddn-nowip
pass Horizons/Odyssey flags in NavRoute
2024-08-26 18:26:58 -04:00
David Sangrey 6a3691d755 [2278] Fix Incomplete OrderedDict 2024-07-29 18:58:30 -04:00
Hans Acker ee0f317791 pass Horizons/Odyssey flags in NavRoute
The old workaround appears to be not needed anymore. EDDN accepts NavRoute with Horizons/Odyssey flags now.

EDDiscovery, EDO Materials Helper and others also set these flags.
2024-07-13 06:35:21 +02:00
David Sangrey 5099093682 Merge branch 'develop' into fix/2232/edsm-preferences 2024-05-13 20:13:35 -04:00
David Sangrey 79ed7bee66 Merge branch 'develop' into enhancement/1654/add-shiprange-and-cargocapacity 2024-05-13 10:31:52 -04:00
David Sangrey eece4c2ba7 [2232] Set EDSM Settings 2024-05-12 23:18:24 -04:00
David Sangrey ad16f0666d [2232] Fix Missing Preferences
Fixes an issue that could present on clean installs where the EDSM keys weren't generated properly.

When the heck did this bug get introduced???
2024-05-12 23:16:45 -04:00
David Sangrey e573b89966 [1654] Updated setCommanderShip entry 2024-04-27 14:58:03 -04:00
David Sangrey 080d9f98f2 [1812] Handover Translations 2024-04-22 17:33:28 -04:00
David Sangrey dd5e3812a7 [2186] Refine macOS to preserve ContextMenu 2024-04-13 14:44:44 -04:00
David Sangrey d9c7a79155 [Minor] Update Type Hintings
No Content Changes, Shuts Up MyPy
2024-04-06 16:59:49 -04:00
David Sangrey ccb103242c Merge branch 'develop' into enhancement/2186/remove-darwin 2024-04-05 17:17:51 -04:00
David Sangrey b5a4ee6ed2 [Nit] Cleanup some Flake8 2024-03-28 10:49:01 -04:00
David Sangrey ae74d949a8 [Nit] Indentation, Yay! 2024-03-27 21:24:11 -04:00
David Sangrey c1b8533cb4 [2186] Simplify myNB Files 2024-03-27 21:22:35 -04:00
David Sangrey 57cd75e75e [2186] Additional Files 2024-03-27 19:39:51 -04:00
David Sangrey 14a38688e1 [2155] Add DockingDenied and DockingGranted Schemas
I love the schema system. It's so simple!
2024-03-23 14:42:18 -04:00
David Sangrey 110f9efd07 [#635] Properly Convert Message
Message should have been updated for the new format. It got missed here.
2024-03-04 18:37:00 -05:00
David Sangrey 727b8e5413 Merge pull request #2165 from HullSeals/enhancement/2163/update-inara-to-use-isthargoid-flag
[2163] Update Inara plugin to better handle Thargoid Combat events
2024-03-04 18:04:15 -05:00
Phoebe 99daff1295 Flake8 2024-02-25 20:45:59 +01:00