Merge pull request #83 from btcpuertorico/0_4_4_ESP

Spanish translated views
This commit is contained in:
SeedSigner
2021-08-29 03:54:08 -05:00
committed by GitHub
6 changed files with 100 additions and 99 deletions
+10 -9
View File
@@ -14,22 +14,22 @@ class IOTestView(View):
View.__init__(self)
self.redraw = False
self.redraw_complete = False
self.qr_text = "Scan ANY QR Code"
self.qr_text = "Escanee Código QR"
self.exit = False
def display_io_test_screen(self):
# display loading screen
self.draw_modal(["Initializing I/O Test"])
print("Initializing I/O Test")
self.qr_text = "Scan ANY QR Code"
self.draw_modal(["Inicializando prueba I/O"])
print("Inicializando prueba I/O")
self.qr_text = "Escanee Código QR"
try:
self.controller.get_instance().camera.start_video_stream_mode()
t = Thread(target=self.qr_loop)
t.start()
except:
self.qr_text = "No Camera"
self.qr_text = "Cámara No Instalada"
self.controller.get_instance().camera.stop_video_stream_mode()
while True:
@@ -75,7 +75,7 @@ class IOTestView(View):
self.redraw_complete = False
self.redraw = False
self.draw.rectangle((0,0,View.canvas_width, View.canvas_height), outline=0, fill=0)
self.draw.text((45, 5), "Input/Output Check:", fill=View.color, font=View.IMPACT18)
self.draw.text((45, 5), "Prueba de Input/Output:", fill=View.color, font=View.IMPACT18)
self.draw.polygon([(61, 89), (80, 46), (99, 89)], outline=View.color, fill=0)
self.draw.polygon([(51, 100), (8, 119), (51, 138)], outline=View.color, fill=0)
self.draw.polygon([(109, 100), (152, 119), (109, 138)], outline=View.color, fill=0)
@@ -83,7 +83,7 @@ class IOTestView(View):
self.draw.ellipse([(61, 99), (99, 141)], outline=View.color, fill=0)
self.draw.ellipse([(198, 40), (238, 80)], outline=View.color, fill=0)
self.draw.ellipse([(198, 95), (238, 135)], outline=View.color, fill=0)
self.draw.text((200, 160), "EXIT", fill=View.color, font=View.IMPACT18)
self.draw.text((200, 160), "SALIR", fill=View.color, font=View.IMPACT18)
self.draw.rectangle((30, 205, 210, 235), outline=View.color, fill="BLACK")
tw, th = self.draw.textsize(self.qr_text, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 205), self.qr_text, fill=View.color, font=View.IMPACT22)
@@ -138,11 +138,12 @@ class IOTestView(View):
self.redraw = True
def draw_scan_detected(self):
self.qr_text = "QR Scanned"
self.qr_text = "QR Escaneado"
if self.redraw == False and self.redraw_complete == True:
self.draw.rectangle((30, 205, 210, 235), outline=View.color, fill=View.color)
tw, th = self.draw.textsize(self.qr_text, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 205), self.qr_text, fill="BLACK", font=View.IMPACT22)
View.DispShowImage()
self.redraw = True
+33 -33
View File
@@ -25,7 +25,7 @@ class MenuView(View):
def display_main_menu(self, sub_menu = None) -> int:
ret_val = 0
input = 0
lines = ["Seed Tools", "Scan QR", "Settings", "Power Off"]
lines = ["Herramientas de Semilla", "Escanear QR", "Configuración", "Apagar"]
if sub_menu == Path.SEED_TOOLS_SUB_MENU:
return self.display_seed_tools_menu()
@@ -64,14 +64,14 @@ class MenuView(View):
### Seed Tools Menu
def display_seed_tools_menu(self) -> int:
seed_storage_line = "Store a Seed (temp)"
seed_storage_line = "Guardar una semilla (temp)"
if self.controller.storage.num_of_saved_seeds() > 0:
if self.controller.storage.num_of_saved_seeds() < 3:
seed_storage_line = "View/Store Seeds (temp)"
seed_storage_line = "Ver/Guardar Semillas (temp)"
else:
seed_storage_line = "View Seeds (temp)"
seed_storage_line = "Ver Semillas (temp)"
lines = ["... [ Return to Main ]", "Temp Seed Storage", "Seed Passphrase", "xPub from Seed", "Calculate Last Word", "Generate Seed with Dice", "Generate Seed with Image"]
lines = ["...[ Regresar a Main ]", "Alm. temp semilla", "Contraseña de Semilla", "xPub de Semilla", "Calc. Última Palabra", "Crear Semilla Con Dado", "Crear Semilla Con Imágen"]
self.draw_menu(lines, 1)
input = 0
@@ -101,7 +101,7 @@ class MenuView(View):
### Signing Tools Menu
def display_signing_tools_menu(self) -> None:
lines = ["... [ Return to Main ]", "Generate xPub", "Sign a Transaction"]
lines = ["...[ Regresar a Main ]", "Generar xPub", "Firmar Transacción"]
self.draw_menu(lines, 1)
input = 0
@@ -124,7 +124,7 @@ class MenuView(View):
### Settings Menu
def display_settings_menu(self) -> int:
lines = ["... [ Return to Main ]", "Wallet: <wallet>", "Script Policy: <policy>", "Network: <network>", "QR Density: <density>", "Input / Output Tests", "Persistent Settings: <persistent>", "Version Info", "Donate to SeedSigner", "Reset SeedSigner"]
lines = ["...[ Regresar a Main ]", "Wallet: <wallet>", "Política Script: <policy>", "Red: <network>", "Densidad QR: <density>", "Input / Output Tests", "Persistent Settings: <persistent>", "Version Info", "Donate to SeedSigner", "Reset SeedSigner"]
input = 0
lines[1] = lines[1].replace("<wallet>", Settings.get_instance().software)
@@ -185,7 +185,7 @@ class MenuView(View):
### Generic Word 12 or 24 seed phrase menu
# internal method
def draw_12_24_word_menu(self, lines, return_txt = "... [ Return to ... ]") -> int:
def draw_12_24_word_menu(self, lines, return_txt = "...[ Regresar a ... ]") -> int:
self.draw_menu(lines)
# Wait for Button Input (specifically menu selection/press)
@@ -205,56 +205,56 @@ class MenuView(View):
elif self.selected_menu_num == 4:
return Path.SEED_WORD_QR
def display_12_24_word_menu(self, return_txt = "... [ Return to ... ]") -> int:
lines = [return_txt, "Use a 12 Word Seed", "Use a 24 Word Seed"]
def display_12_24_word_menu(self, return_txt = "... [ Regresar a ... ]") -> int:
lines = [return_txt, "Usar Semilla 12 Palabras", "Usar Semilla 12 Palabras"]
return self.draw_12_24_word_menu(lines, return_txt)
def display_qr_12_24_word_menu(self, return_txt = "... [ Return to ... ]") -> int:
lines = [return_txt, "Enter 12 Word Seed", "Enter 24 Word Seed", "Scan a Seed QR Code"]
def display_qr_12_24_word_menu(self, return_txt = "... [ Regresar a ... ]") -> int:
lines = [return_txt, "Entrar Semilla 12 Palabras", "Entrar Semilla 24 Palabras", "Escanear Semilla de QR"]
return self.draw_12_24_word_menu(lines, return_txt)
### Select a Seed Slot to Save a Seed Menu
def display_saved_seed_menu(self, storage, type = 1, return_sel_txt = "... [ Return to Seed Tools ]") -> int:
def display_saved_seed_menu(self, storage, type = 1, return_sel_txt = "...[Regresar a Herr. Semilla]") -> int:
lines = []
if return_sel_txt != None:
lines.append(return_sel_txt)
if type == 1:
# Show all slots used and free
lines.extend(["Use Seed Slot #1", "Use Seed Slot #2", "Use Seed Slot #3"])
lines.extend(["Usar Slot Semilla #1", "Usar Slot Semilla #2", "Usar Slot Semilla #3"])
if storage.check_slot_1():
lines[1] = "Display Seed Slot #1" # replace
lines[1] = "Mostrar Slot Semilla #1" # replace
if storage.check_slot_2():
lines[2] = "Display Seed Slot #2" # replace
lines[2] = "Mostrar Slot Semilla #2" # replace
if storage.check_slot_3():
lines[3] = "Display Seed Slot #3" # replace
lines[3] = "Mostrar Slot Semilla #3" # replace
elif type == 2:
# Show only free slots
if storage.check_slot_1() == False:
lines.append("Use Seed Slot #1")
lines.append("Usar Slot Semilla #1")
if storage.check_slot_2() == False:
lines.append("Use Seed Slot #2")
lines.append("Usar Slot Semilla #2")
if storage.check_slot_3() == False:
lines.append("Use Seed Slot #3")
lines.append("Usar Slot Semilla")
if storage.num_of_free_slots() == 0:
return 0
elif type == 3:
# Show only used slots
if storage.check_slot_1():
lines.append("Use Seed Slot #1")
lines.append("Usar Slot Semilla #1")
if storage.check_slot_2():
lines.append("Use Seed Slot #2")
lines.append("Usar Slot Semilla #2")
if storage.check_slot_3():
lines.append("Use Seed Slot #3")
lines.append("Usar Slot Semilla #3")
elif type == 4:
# Show only used slots with passphrase
if storage.check_slot_passphrase(1):
lines.append("Seed Slot #1")
lines.append("Slot Semilla #1")
if storage.check_slot_passphrase(2):
lines.append("Seed Slot #2")
lines.append("Slot Semilla #2")
if storage.check_slot_passphrase(3):
lines.append("Seed Slot #3")
lines.append("Slot Semilla #3")
else:
return 0
@@ -288,22 +288,22 @@ class MenuView(View):
t = title
if bottom == None and len(lines) <= 5:
b = "Press Control Stick to Select"
b = "Presione Palanca Para Seleccionar"
elif bottom == None:
if len(lines) >= 6 and len(lines) <= 10:
if selected_menu_num <= 5:
b = "Page 1 of 2"
b = "Página 1 de 2"
elif selected_menu_num >= 6 and selected_menu_num <= 10:
b = "Page 2 of 2"
b = "Página 2 de 2"
elif len(lines) >= 11 and len(lines) <= 15:
if selected_menu_num <= 5:
b = "Page 1 of 3"
b = "Página 1 de 3"
elif selected_menu_num >= 6 and selected_menu_num <= 10:
b = "Page 2 of 3"
b = "Página 2 de 3"
elif selected_menu_num >= 11 and selected_menu_num <= 15:
b = "Page 3 of 3"
b = "Página 3 de 3"
else:
b = "Press Control Stick to Select"
b = "Presione Palanca Para Seleccionar"
else:
b = bottom
+18 -18
View File
@@ -436,7 +436,7 @@ class SeedToolsView(View):
# render top title banner
font = View.ROBOTOCONDENSED_REGULAR_20
title = "Enter Passphrase"
title = "Entre Contraseña"
title_top_padding = 0
title_bottom_padding = 10
tw, th = font.getsize(title)
@@ -673,13 +673,13 @@ class SeedToolsView(View):
last_word = finalseed[-1]
self.draw.rectangle((0, 0, View.canvas_width, View.canvas_height), outline=0, fill=0)
tw, th = self.draw.textsize("The final word is :", font=View.IMPACT23)
self.draw.text(((240 - tw) / 2, 60), "The final word is :", fill=View.color, font=View.IMPACT23)
tw, th = self.draw.textsize("La palabra final es :", font=View.IMPACT23)
self.draw.text(((240 - tw) / 2, 60), "La palabra final es :", fill=View.color, font=View.IMPACT23)
tw, th = self.draw.textsize(last_word, font=View.IMPACT50)
self.draw.text(((240 - tw) / 2, 90), last_word, fill=View.color, font=View.IMPACT50)
tw, th = View.draw.textsize("Right to Continue", font=View.IMPACT18)
View.draw.text(((240 - tw) / 2, 210), "Right to Continue", fill=View.color, font=View.IMPACT18)
tw, th = View.draw.textsize("Derecha Para Continuar", font=View.IMPACT18)
View.draw.text(((240 - tw) / 2, 210), "Derecha Para Continuar", fill=View.color, font=View.IMPACT18)
View.DispShowImage()
@@ -765,7 +765,7 @@ class SeedToolsView(View):
def dice_arrow_left(self):
if self.dice_selected == 1:
self.draw_prompt_custom("Undo ", "Cancel ", "Exit ", ["Action: ", "", ""])
self.draw_prompt_custom("Deshacer ", "Cancelar ", "Salir ", ["Acción: ", "", ""])
input = self.buttons.wait_for([B.KEY1, B.KEY2, B.KEY3])
if input == B.KEY1: #Undo
self.roll_number = self.roll_number - 1
@@ -813,7 +813,7 @@ class SeedToolsView(View):
def draw_dice(self, dice_selected):
self.draw.rectangle((0, 0, View.canvas_width, View.canvas_height), outline=0, fill=0)
self.draw.text((45, 5), "Dice roll: " + str(self.roll_number) + "/99", fill=View.color, font=View.IMPACT26)
self.draw.text((45, 5), "Tirada de dado: " + str(self.roll_number) + "/99", fill=View.color, font=View.IMPACT26)
# when dice is selected, rect fill will be orange and ellipse will be black, ellipse outline will be the black
# when dice is not selected, rect will will be black and ellipse will be orange, ellipse outline will be orange
@@ -897,7 +897,7 @@ class SeedToolsView(View):
self.draw.ellipse([(208, 174), (220, 186)], outline=View.color, fill=View.color)
# bottom text
self.draw.text((18, 210), "Press Control Stick to Select", fill=View.color, font=View.IMPACT18)
self.draw.text((18, 210), "Presione Palanca Para Seleccionar", fill=View.color, font=View.IMPACT18)
View.DispShowImage()
self.dice_selected = dice_selected
@@ -906,7 +906,7 @@ class SeedToolsView(View):
### Display Seed Phrase
###
def display_seed_phrase(self, seed_phrase, passphrase=None, bottom="Right to Main Menu", show_qr_option=False) -> bool:
def display_seed_phrase(self, seed_phrase, passphrase=None, bottom="Derecha Para Menú", show_qr_option=False) -> bool:
ret_val = ""
def display_seed_phrase_page(draw, seed_phrase, passphrase=None, bottom=bottom, page_num=1):
@@ -920,7 +920,7 @@ class SeedToolsView(View):
(120, 40), (120, 63), (120, 86), (120, 109), (120, 132), (120, 155)
]
title = "Seed Phrase"
title = "Contraseña De Semilla"
word_index_offset = 0
max_range = len(seed_phrase) # handles 11 or 12; 23 or 24
if len(seed_phrase) > 12:
@@ -1009,7 +1009,7 @@ class SeedToolsView(View):
def seed_phrase_as_qr(self, seed_phrase):
e = EncodeQR(seed_phrase=seed_phrase, qr_type=QRType.SEEDSSQR)
image = e.nextPartImage(240, 240, 3)
View.DispShowImageWithText(image, "click to zoom, right to exit", font=View.IMPACT18, text_color="BLACK", text_background="ORANGE")
View.DispShowImageWithText(image, "click para zoom, derecha para salir", font=View.IMPACT18, text_color="BLACK", text_background="ORANGE")
input = self.buttons.wait_for([B.KEY_RIGHT, B.KEY_PRESS])
if input == B.KEY_RIGHT:
@@ -1138,14 +1138,14 @@ class SeedToolsView(View):
cur_y = next_y
def read_seed_phrase_qr(self):
self.draw_modal(["Scanning..."], "Seed QR" ,"Right to Exit")
self.draw_modal(["Escaneando..."], "QR de Semilla" ,"Derecha Para Salir")
try:
self.controller.camera.start_video_stream_mode(resolution=(480, 480), framerate=12, format="rgb")
decoder = DecodeQR()
while True:
frame = self.controller.camera.read_video_stream(as_image=True)
if frame is not None:
View.DispShowImageWithText(frame.resize((240,240)), "Scan Seed QR", font=View.IMPACT22, text_color=View.color, text_background=(0,0,0,225))
View.DispShowImageWithText(frame.resize((240,240)), "Escanear QR de Semilla", font=View.IMPACT22, text_color=View.color, text_background=(0,0,0,225))
status = decoder.addImage(frame)
if status in (DecodeQRStatus.COMPLETE, DecodeQRStatus.INVALID):
@@ -1159,10 +1159,10 @@ class SeedToolsView(View):
if decoder.isComplete() and decoder.isSeed():
self.words = decoder.getSeedPhrase()
elif not decoder.isPSBT():
self.draw_modal(["Not a valid Seed QR"], "", "Right to Exit")
self.draw_modal(["QR de Semilla No Válido"], "", "Derecha Para Salir")
input = self.buttons.wait_for([B.KEY_RIGHT])
else:
self.draw_modal(["QR Parsing Failed"], "", "Right to Exit")
self.draw_modal(["Parsing de QR Falló"], "", "Derecha Para Salir")
input = self.buttons.wait_for([B.KEY_RIGHT])
self.words = []
@@ -1174,7 +1174,7 @@ class SeedToolsView(View):
def seed_phrase_from_camera_image(self):
reshoot = False
self.controller.menu_view.draw_modal(["Initializing Camera..."])
self.controller.menu_view.draw_modal(["Inicializando Cámara..."])
self.controller.camera.start_video_stream_mode(resolution=(240, 240), framerate=24, format="rgb")
# save preview image frames to use as additional entropy below
@@ -1184,7 +1184,7 @@ class SeedToolsView(View):
while True:
frame = self.controller.camera.read_video_stream(as_image=True)
if frame is not None:
View.DispShowImageWithText(frame, "click joystick", text_color=View.color, text_background=(0,0,0,225))
View.DispShowImageWithText(frame, "haga click en palanca", text_color=View.color, text_background=(0,0,0,225))
if len(preview_images) < max_entropy_frames:
preview_images.append(frame)
@@ -1218,7 +1218,7 @@ class SeedToolsView(View):
View.DispShowImageWithText(
display_version,
text=" < reshoot | accept > ",
text=" < retomar | aceptar > ",
font=View.ROBOTOCONDENSED_REGULAR_22,
text_color=View.color,
text_background=(0,0,0,225)
+15 -15
View File
@@ -16,11 +16,11 @@ class SettingsToolsView(View):
### Donate Menu Item
def display_donate_info_screen(self):
self.draw_modal(["You can support", "SeedSigner by donating", "any amount of BTC", "Thank You!!!"], "", "(Press right for a QR code)")
self.draw_modal(["Puedes Apoyar a ", "SeedSigner donando", "cualquier cantidad de BTC", "¡Gracias!"], "", "(Palanca derecha para un QR)")
return True
def display_donate_qr(self):
self.draw_modal(["Loading..."])
self.draw_modal(["Cargando..."])
self.donate_image = self.qr.qrimage("bc1qphlyv2dde290tqdlnk8uswztnshw3x9rjurexqqhksvu7vdevhtsuw4efe")
View.DispShowImage(self.donate_image)
return True
@@ -28,7 +28,7 @@ class SettingsToolsView(View):
### Display Network Selection
def display_current_network(self) -> str:
r = self.controller.menu_view.display_generic_selection_menu(["... [ Return to Settings ]", "Mainnet", "Testnet"], "Which Network?")
r = self.controller.menu_view.display_generic_selection_menu(["...[Regresar a Configuración ]", "Mainnet", "Testnet"], "¿Qué Red?")
if r == 2:
return "main"
elif r == 3:
@@ -39,7 +39,7 @@ class SettingsToolsView(View):
### Display Wallet Selection
def display_wallet_selection(self) -> str:
r = self.controller.menu_view.display_generic_selection_menu(["... [ Return to Settings ]", "Prompt", "Specter Desktop", "Blue Wallet", "Sparrow"], "Which Wallet?")
r = self.controller.menu_view.display_generic_selection_menu(["...[Regresar a Configuración ]", "Prompt", "Specter Desktop", "Blue Wallet", "Sparrow"], "Which Wallet?")
if r == 2:
return "Prompt"
elif r == 3:
@@ -54,7 +54,7 @@ class SettingsToolsView(View):
### Display QR Density Selection
def display_qr_density_selection(self) -> str:
r = self.controller.menu_view.display_generic_selection_menu(["... [ Return to Settings ]", "Low", "Medium", "High"], "Which QR Density?")
r = self.controller.menu_view.display_generic_selection_menu(["...[Regresar a Configuración ]", "Baja", "Mediana", "Alta"], "¿Cuál densidad de QR?")
if r == 2:
return EncodeQRDensity.LOW
elif r == 3:
@@ -68,27 +68,27 @@ class SettingsToolsView(View):
def display_wallet_policy_selection(self) -> str:
lines = ["... [ Return to Settings ]"]
lines.append("Multi Sig Native Segwit")
lines.append("Single Sig Native Segwit")
lines = ["...[Regresar a Configuración ]"]
lines.append("Multi Firma Segwit Nativo")
lines.append("Firma Sencilla Segwit Nativo")
r = self.controller.menu_view.display_generic_selection_menu(lines, "Which Wallet Policy?")
r = self.controller.menu_view.display_generic_selection_menu(lines, "¿Qué wallet policy?")
if r == 1:
return None
elif lines[r-1] == "Multi Sig Native Segwit":
elif lines[r-1] == "Multi Firma Segwit Nativo":
return "PKWSH"
elif lines[r-1] == "Single Sig Native Segwit":
elif lines[r-1] == "Firma Sencilla Segwit Nativo":
return "PKWPKH"
else:
return None
def display_persistent_settings(self) -> bool:
lines = ["... [ Return to Settings ]"]
lines.append("Yes")
lines = ["...[Regresar a Configuración ]"]
lines.append("Sí")
lines.append("No")
r = self.controller.menu_view.display_generic_selection_menu(lines, "Use Persistent Settings?")
r = self.controller.menu_view.display_generic_selection_menu(lines, "¿Usar Conf. Persistente?")
if r == 1:
return None
elif r == 2:
@@ -106,7 +106,7 @@ class SettingsToolsView(View):
line1 = "SeedSigner"
line2 = "Version v" + self.controller.VERSION
line3 = "(Joystick RIGHT to EXIT)"
line3 = "(Palanca DERECHA para SALIR)"
View.draw.rectangle((0, 0, View.canvas_width, View.canvas_height), outline=0, fill=0)
tw, th = View.draw.textsize(line1, font=View.IMPACT22)
+19 -19
View File
@@ -17,9 +17,9 @@ class SigningToolsView(View):
###
def display_xpub_info(self, fingerprint, derivation, xpub):
derivation_display = "Derivation: " + derivation
derivation_display = "Derivación: " + derivation
xpub_display = xpub[0:7] + "..." + xpub[-9:]
self.draw_modal(["Master Fingerprint: ", fingerprint, derivation_display, xpub_display], "Xpub Info", "Right to Continue")
self.draw_modal(["Huella Master: ", fingerprint, derivation_display, xpub_display], "Info Xpub", "Derecha Para Continuar")
###
### Signing Tx
@@ -28,11 +28,11 @@ class SigningToolsView(View):
def display_transaction_information(self, p) -> None:
self.draw.rectangle((0, 0, View.canvas_width, View.canvas_height), outline=0, fill=0)
tw, th = self.draw.textsize("Confirm Tx Details", font=View.IMPACT25)
self.draw.text(((240 - tw) / 2, 3), "Confirm Tx Details", fill=View.color, font=View.IMPACT25)
tw, th = self.draw.textsize("Confirma Detalles de Tx", font=View.IMPACT25)
self.draw.text(((240 - tw) / 2, 3), "Confirma Detalles de Tx", fill=View.color, font=View.IMPACT25)
in_fee_outs_str = str(len(p.psbt.inputs))
in_fee_outs_str += " inputs - fee = " if len(p.psbt.inputs) > 1 else " input - fee = "
in_fee_outs_str += " inputs - cuota = " if len(p.psbt.inputs) > 1 else " input - cuota = "
in_fee_outs_str += str(len(p.psbt.outputs))
in_fee_outs_str += " outs" if len(p.psbt.outputs) > 1 else " out"
tw, th = self.draw.textsize(in_fee_outs_str, font=View.IMPACT22)
@@ -42,12 +42,12 @@ class SigningToolsView(View):
receiving_addr_str2 = ""
if len(p.destination_addresses) > 1:
receiving_addr_str1 += "multiple"
receiving_addr_str2 += "receiving addresses"
receiving_addr_str2 += "direcciones de recepción"
elif len(p.destination_addresses) == 1:
receiving_addr_str1 += "receiving address"
receiving_addr_str2 += "last 13: ..." + p.destination_addresses[0][-13:]
receiving_addr_str1 += "dirección de recepción"
receiving_addr_str2 += "últimos 13: ..." + p.destination_addresses[0][-13:]
else:
receiving_addr_str1 += "Self-Transfer"
receiving_addr_str1 += "Transferencia-propia"
tw, th = self.draw.textsize(receiving_addr_str1, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 75), receiving_addr_str1, fill=View.color, font=View.IMPACT22)
@@ -57,33 +57,33 @@ class SigningToolsView(View):
if p.spend_amount > 0:
spending_str = "Spend: " + str(p.spend_amount) + " sats"
spending_str = "Gastar: " + str(p.spend_amount) + " sats"
tw, th = self.draw.textsize(spending_str, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 130), spending_str, fill=View.color, font=View.IMPACT22)
if p.change_amount > 0 and len(p.destination_addresses) == 0:
change_str = "Amount: " + str(p.change_amount) + " sats"
change_str = "Cantidad: " + str(p.change_amount) + " sats"
tw, th = self.draw.textsize(change_str, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 155), change_str, fill=View.color, font=View.IMPACT22)
elif p.change_amount > 0:
change_str = "Change: " + str(p.change_amount) + " sats"
change_str = "Cambio: " + str(p.change_amount) + " sats"
tw, th = self.draw.textsize(change_str, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 155), change_str, fill=View.color, font=View.IMPACT22)
fee_str = "Fee: " + str(p.fee_amount) + " sats"
fee_str = "Cuota: " + str(p.fee_amount) + " sats"
tw, th = self.draw.textsize(fee_str, font=View.IMPACT22)
self.draw.text(((240 - tw) / 2, 180), fee_str, fill=View.color, font=View.IMPACT22)
tw, th = self.draw.textsize("Left to Exit, Right to Continue", font=View.IMPACT18)
self.draw.text(((240 - tw) / 2, 215), "Left to Exit, Right to Continue", fill=View.color, font=View.IMPACT18)
tw, th = self.draw.textsize("Izq. Para Salir, Derecha Para Cont.", font=View.IMPACT18)
self.draw.text(((240 - tw) / 2, 215), "Izq. Para Salir, Derecha Para Cont.", fill=View.color, font=View.IMPACT18)
View.DispShowImage()
def qr_gen_status(percentage):
View.draw.rectangle((0, 0, View.canvas_width, View.canvas_height), outline=0, fill=0)
tw, th = View.draw.textsize("QR Generation", font=View.IMPACT25)
View.draw.text(((240 - tw) / 2, 90), "QR Generation", fill=View.color, font=View.IMPACT25)
tw, th = View.draw.textsize(str(round(percentage)) + "% Complete", font=View.IMPACT25)
View.draw.text(((240 - tw) / 2, 125), str(round(percentage)) + "% Complete", fill=View.color, font=View.IMPACT25)
tw, th = View.draw.textsize("Generación de QR", font=View.IMPACT25)
View.draw.text(((240 - tw) / 2, 90), "Generación de QR", fill=View.color, font=View.IMPACT25)
tw, th = View.draw.textsize(str(round(percentage)) + "% Completo", font=View.IMPACT25)
View.draw.text(((240 - tw) / 2, 125), str(round(percentage)) + "% Completo", fill=View.color, font=View.IMPACT25)
View.DispShowImage()
+5 -5
View File
@@ -184,7 +184,7 @@ class View:
def draw_prompt_yes_no(self, lines = [], title = "", bottom = "") -> None:
self.draw_prompt_custom("", "Yes ", "No ", lines, title, bottom)
self.draw_prompt_custom("", "Sí ", "No ", lines, title, bottom)
return
def draw_prompt_custom(self, a_txt, b_txt, c_txt, lines = [], title = "", bottom = "") -> None:
@@ -246,10 +246,10 @@ class View:
View.draw.rectangle((0, 0, View.canvas_width, View.canvas_height), outline=0, fill=0)
line1 = "Powering Down..."
line2 = "Please wait about"
line3 = "30 seconds before"
line4 = "disconnecting power."
line1 = "Apagando..."
line2 = "Favor de esperar"
line3 = "30 segundos antes de"
line4 = "desconectar la corriente."
tw, th = View.draw.textsize(line1, font=View.IMPACT22)
View.draw.text(((240-tw)/2, 45), line1, fill=View.color, font=View.IMPACT22)