Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bitcoin_safe_lib/gui/qt/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@
# this function must eb named identical to QCoreApplication.translate
# otherwise lupdate doesnt recognize it
def translate(
context: str | None,
sourceText: str | None,
context: str,
sourceText: str,
disambiguation: str | None = None,
n: int = 1,
no_translate=False,
) -> str:
if no_translate:
return sourceText if sourceText else ""
return QCoreApplication.translate(context, sourceText, disambiguation=disambiguation, n=n)

if disambiguation:
return QCoreApplication.translate(context, sourceText, disambiguation=disambiguation, n=n)
return QCoreApplication.translate(context, sourceText, n=n)
5 changes: 5 additions & 0 deletions bitcoin_safe_lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
TypeVar,
)

import bdkpython as bdk
import numpy as np
from packaging.version import Version

Expand Down Expand Up @@ -266,3 +267,7 @@ def insert_invisible_spaces_for_wordwrap(s: str, max_word_length: int = 20) -> s
def fast_version(s: str) -> Version:
"""Fast version."""
return Version(s)


def network_kind(network: bdk.Network) -> bdk.NetworkKind:
return bdk.NetworkKind.MAIN if network == bdk.Network.BITCOIN else bdk.NetworkKind.TEST
Loading
Loading