fix(l10n): use named variables in `NetworkMismatchView` message
What changed, and why it matters
This commit is a minor localization (translation) improvement. It changes how a user-facing error message is assembled so translators can more easily work with named placeholders instead of numbered ones. There is no security-relevant change.
No security action needed. This is a routine code-quality/localization fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies NetworkMismatchErrorView in src/seedsigner/views/view.py. It replaces positional format placeholders ({}, {}) with named placeholders ({network}, {derivation_path}) and passes the values as keyword arguments to str.format(). The displayed text and logic remain identical; only the internationalization (i18n) structure is improved.
Changed components
src/seedsigner/views/view.pyInspect captured patch +6 / −4
diff --git a/src/seedsigner/views/view.py b/src/seedsigner/views/view.py
index a55252e..8c605da 100644
--- a/src/seedsigner/views/view.py
+++ b/src/seedsigner/views/view.py
@@ -350,10 +350,12 @@ class NetworkMismatchErrorView(ErrorView):
self.next_destination = Destination(SettingsEntryUpdateSelectionView, view_args=dict(attr_name=SettingsConstants.SETTING__NETWORK), clear_history=True)
super().__post_init__()
- # TRANSLATOR_NOTE: Inserts mainnet/testnet/regtest and derivation path
- self.text = _("Current network setting ({}) doesn't match {}.").format(
- _(self.settings.get_value_display_name(SettingsConstants.SETTING__NETWORK)),
- self.derivation_path,
+ network = _(self.settings.get_value_display_name(SettingsConstants.SETTING__NETWORK))
+
+ # TRANSLATOR_NOTE: "network" will be mainnet/testnet/regtest.
+ self.text = _("Current network setting ({network}) doesn't match {derivation_path}.").format(
+ network=network,
+ derivation_path=self.derivation_path,
)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.