diff --git a/estiquetas_generator.py b/estiquetas_generator.py new file mode 100644 index 0000000..f72b773 --- /dev/null +++ b/estiquetas_generator.py @@ -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.") diff --git a/translator_csv_to_sql.py b/translator_csv_to_sql.py index fabc91d..56164b5 100644 --- a/translator_csv_to_sql.py +++ b/translator_csv_to_sql.py @@ -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('', 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('', abrir_enlace) + +# Ejecutar el bucle principal de la interfaz gráfica +ventana.mainloop() +