Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
j0rd1s3rr4n0 committed May 30, 2023
1 parent 1d9b154 commit e413823
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 50 deletions.
17 changes: 17 additions & 0 deletions estiquetas_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
idiomas_list = ['es','en','ca','fr','it','de']
while True:
etiqueta = input("Ingrese la etiqueta: ").replace("trad.", "").replace("etiquetes.", "")
if etiqueta == "!!":
break

contenido = input("Ingrese el contenido: ")
idioma = ''
while idioma not in idiomas_list:
idioma = input("Ingrese el idioma: ")

linea_sql = f"INSERT INTO `caraalvent`.`web_t_etiquetes` (`id_pagina`, `nomEtiqueta`, `contingut`, `idioma`) VALUES ('0', '{etiqueta}', '{contenido}', '{idioma}');"

with open("nuevas_etiquetas.sql", "a") as archivo_sql:
archivo_sql.write(linea_sql + "\n")

print("Se ha terminado de ingresar etiquetas. El bucle ha finalizado.")
98 changes: 48 additions & 50 deletions translator_csv_to_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,53 +143,51 @@ def abrir_enlace(event):


#-------------------------------------------------------------------------------
def main():
print("Idiomas Disponibles:")
for idioma in idiomas_list:
print(" - "+idioma)
while idioma_origen not in idiomas_list:
idioma_origen = input("Idioma Original: ")

while idioma_destino not in idiomas_list:
idioma_destino = input("Idioma Final: ")
tabla_name = ''
while len(tabla_name) < 3:
tabla_name = str(input("Nombre de la tabla de Base de Datos: "))
switch_txt_proxy = ''
while switch_txt_proxy.upper() not in ['SI','SÍ','NO','S','N']:
switch_txt_proxy = str(input("Usar Proxy (S/N): "))
if(switch_txt_proxy in ['SI','S','SÍ']):
proxy_switch = True

# Crear la ventana principal
ventana = Tk()

# Configurar la ventana
ventana.title('Tarea de traducción y generación de archivo SQL')
ventana.geometry('550x100')

# Crear un label descriptivo
label_nombre = Label(ventana, text='Nombre del nuevo archivo SQL:')
label_nombre.pack()

# Crear un campo de entrada
entrada_nombre = Entry(ventana)
entrada_nombre.pack(pady=5)

# Crear un botón para iniciar la tarea
boton_iniciar = Button(ventana, text='', command=solicitar_administrador)
boton_iniciar.pack()

# Configurar el texto del botón al cargar la ventana
configurar_texto_boton()

# Crear un label enlace
label_enlace = Label(ventana, text='Developed By J0rd1S3rr4n0', fg='blue', cursor='hand2')
label_enlace.pack()
label_enlace.bind('<Button-1>', abrir_enlace)

# Ejecutar el bucle principal de la interfaz gráfica
ventana.mainloop()

if __name__ == '__main__':
main()

print("Idiomas Disponibles:")
for idioma in idiomas_list:
print(" - "+idioma)
while idioma_origen not in idiomas_list:
idioma_origen = input("Idioma Original: ")

while idioma_destino not in idiomas_list:
idioma_destino = input("Idioma Final: ")
tabla_name = ''
while len(tabla_name) < 3:
tabla_name = str(input("Nombre de la tabla de Base de Datos: "))
switch_txt_proxy = ''
while switch_txt_proxy.upper() not in ['SI','SÍ','NO','S','N']:
switch_txt_proxy = str(input("Usar Proxy (S/N): "))
if(switch_txt_proxy in ['SI','S','SÍ']):
proxy_switch = True

# Crear la ventana principal
ventana = Tk()

# Configurar la ventana
ventana.title('Tarea de traducción y generación de archivo SQL')
ventana.geometry('550x100')

# Crear un label descriptivo
label_nombre = Label(ventana, text='Nombre del nuevo archivo SQL:')
label_nombre.pack()

# Crear un campo de entrada
entrada_nombre = Entry(ventana)
entrada_nombre.pack(pady=5)

# Crear un botón para iniciar la tarea
boton_iniciar = Button(ventana, text='', command=solicitar_administrador)
boton_iniciar.pack()

# Configurar el texto del botón al cargar la ventana
configurar_texto_boton()

# Crear un label enlace
label_enlace = Label(ventana, text='Developed By J0rd1S3rr4n0', fg='blue', cursor='hand2')
label_enlace.pack()
label_enlace.bind('<Button-1>', abrir_enlace)

# Ejecutar el bucle principal de la interfaz gráfica
ventana.mainloop()

0 comments on commit e413823

Please sign in to comment.