Skip to content

Commit

Permalink
Language switch bugfix (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgriffin authored Oct 27, 2024
1 parent 9cf1792 commit e553082
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bitcoin_safe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# this is the source of the version information
__version__ = "1.0.0b0"
__version__ = "1.0.0b1"
6 changes: 4 additions & 2 deletions bitcoin_safe/gui/qt/category_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ def on_language_switch(self):
self.refresh(UpdateFilter(refresh_all=True))

@staticmethod
def shoud_update(update_filter: UpdateFilter) -> bool:
def shoud_update(update_filter: UpdateFilter | None = None) -> bool:
should_update = False
if update_filter is None:
return True
if should_update or update_filter.refresh_all:
should_update = True
if should_update or update_filter.categories:
Expand All @@ -86,7 +88,7 @@ def shoud_update(update_filter: UpdateFilter) -> bool:

return should_update

def refresh(self, update_filter: UpdateFilter) -> None:
def refresh(self, update_filter: UpdateFilter | None = None) -> None:
if not self.shoud_update(update_filter):
return

Expand Down
2 changes: 1 addition & 1 deletion bitcoin_safe/gui/qt/wallet_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1794,4 +1794,4 @@ def updateUi(self) -> None:
else self.tr("Send test")
)

self.set_labels([labels[key] for key in self.tab_generators])
self.set_labels([labels[key] for key in self.tab_generators if key in labels])
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ line-length = 110
name = "bitcoin-safe"
# the version here and in all other places in this toml are updated automatically
# from the source: bitcoin_safe/__init__.py
version = "1.0.0b0"
version = "1.0.0b1"
description = "Long-term Bitcoin savings made Easy"
authors = [ "andreasgriffin <andreasgriffin@proton.me>",]
license = "GPL-3.0"
Expand Down Expand Up @@ -50,7 +50,7 @@ pgpy = "^0.6.0"
[tool.briefcase]
project_name = "Bitcoin-Safe"
bundle = "org.bitcoin-safe"
version = "1.0.0b0"
version = "1.0.0b1"
url = "https://github.com/andreasgriffin/bitcoin-safe"
license.file = "LICENSE"
author = "Andreas Griffin"
Expand Down Expand Up @@ -117,7 +117,7 @@ NSCameraUsageDescription = "This application supports scanning QR-codes."
manylinux = "manylinux_2_28"
icon = "tools/resources/icon"
resources = [ "tools/resources/icon/*.png", "tools/resources/icon/*.svg",]
version = "1.0.0b0"
version = "1.0.0b1"
# system_requires = [ "cmake", "gcc", "gcc-c++", "make", "perl", "git", "libxcb", "libxcb-devel", "xcb-util", "xcb-util-devel", "mesa-libGL-devel", "openssl-devel", "bison", "flex", "gperf", "sqlite-devel", "libicu-devel"]


Expand All @@ -127,7 +127,7 @@ flatpak_runtime = "org.kde.Platform"
flatpak_runtime_version = "6.6"
flatpak_sdk = "org.kde.Sdk"

version = "1.0.0b0"
version = "1.0.0b1"


[tool.briefcase.app.bitcoin-safe.linux.system.debian]
Expand Down
7 changes: 7 additions & 0 deletions tests/gui/qt/test_gui_setup_wallet_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ def check_that_it_is_in_recent_wallets() -> None:

check_that_it_is_in_recent_wallets()

def switch_language() -> None:
main_window.language_chooser.switchLanguage("zh_CN")

shutter.save(main_window)

switch_language()

# end
shutter.save(main_window)
sleep(2)

0 comments on commit e553082

Please sign in to comment.