Skip to content

Commit

Permalink
fix adding diferents buffers in diferent language
Browse files Browse the repository at this point in the history
  • Loading branch information
metalalchemist committed Aug 13, 2024
1 parent e4a4c21 commit b977b48
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
15 changes: 9 additions & 6 deletions VeTube.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def retornarCategorias():
lista = [[categoria] for i, categoria in enumerate(categorias) if i < len(config['categorias']) and config['categorias'][i]]
lista.insert(0,[_('General')])
return lista
lista=retornarCategorias()
lista=funciones.retornarCategorias()
lista1=retornarCategorias()
for temporal in lista: pos.append(1)
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
Expand Down Expand Up @@ -611,8 +612,9 @@ def detenerLectura(self, event=None):
self.gustados=[]
self.megusta=self.unidos=self.seguidores=self.compartidas=0
yt=0
pos=lista=[]
lista=retornarCategorias()
pos=lista=lista1=[]
lista=funciones.retornarCategorias()
lista1=retornarCategorias()
for temporal in lista: pos.append(1)
leer.silence()
leer.speak(_("ha finalizado la lectura del chat."))
Expand Down Expand Up @@ -650,7 +652,8 @@ def guardar(self):
else: config['eventos'].append(False)
if self.cf.unread.IsItemChecked(contador): config['unread'].append(True)
else: config['unread'].append(False)
lista=retornarCategorias()
lista=funciones.retornarCategorias()
lista1=retornarCategorias()
if config['idioma']!=codes[self.cf.choice_language.GetSelection()]:
config['idioma']=codes[self.cf.choice_language.GetSelection()]
rest=True
Expand Down Expand Up @@ -1295,12 +1298,12 @@ def avanzarCategorias(self):
global yt
if yt<len(lista)-1: yt+=1
else: yt=0
lector.speak(lista[yt][0])
lector.speak(lista1[yt][0])
def retrocederCategorias(self):
global yt
if yt<=0: yt=len(lista)-1
else: yt-=1
lector.speak(lista[yt][0])
lector.speak(lista1[yt][0])
def destacarMensaje(self):
global lista,pos
if lista[yt][0]=='Favoritos': lector.speak(_("no puedes agregar un Favorito del bufer de favoritos"))
Expand Down
9 changes: 9 additions & 0 deletions utils/funciones.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import json
from . import fajustes
from urllib.parse import urlsplit
from os import path
def retornarCategorias():
config=fajustes.leerConfiguracion()
categorias = [
"Mensajes", "Miembros", "Donativos", "Moderadores", "Usuarios Verificados", "Favoritos"
]
lista = [[categoria] for i, categoria in enumerate(categorias) if i < len(config['categorias']) and config['categorias'][i]]
lista.insert(0,['General'])
return lista
def escribirJsonLista(arch,lista=[]):
with open(arch, 'w+') as file: json.dump(lista, file)
def leerJsonLista(arch):
Expand Down

0 comments on commit b977b48

Please sign in to comment.