[EN/PT-BR] Creating a solution to increase my productivity via translation for threads.

image.pngUnsplash

lotus_divisor.png

Hello everyone! Greetings to all programmers. I believe this will be my first post here, so calm down, patience and solidarity at this moment my friends! Everything in life is a learning experience!


The good side of being a programmer is that We can think of cool solutions to some problem or difficulty we are facing and then develop the solution ourselves. This is what I started doing recently, considering that my biggest difficulty at the moment is translations and the use of tags in the answers. , I started developing my own solution for this.

Using a free translation API from "MyMemory", you can check out their website here => https://mymemory.translated.net/ which apparently allowed me to translate 5000 characters per One day, I implemented a simple translator in C# (C-Sharp), focused on translating from Portuguese to English (and other languages ​​are also possible) for Inleo Threads, X and later the idea for Meta Threads.

image.png

With that, the latest stable version is the one in the image above, where I I put my text in Portuguese and by clicking on the button or shortcut F2 I translate it and put it in the desired format to put in inLeo and in X. Of course now that X is banned in Brazil and we are back to the times of good old censorship, oops, from the caveman days, that one is now obsolete.

With that came the idea of ​​going to Meta Threads, trying to create contacts, friendships and bonds with people who also enjoy cryptocurrencies and financial freedom. With that, I started the new development of my project, which was called "Tradutor Libre" and later changed to Tradutor Livre.

Yes, I did research and looked for information on how to make a program translate texts, so it was Google + ChatGPT + my imagination to do it. create and well, I don't see a problem with that, with or without AI I would arrive at this solution as I have arrived at several others before artificial intelligence existed, simply by searching on Google.

To copy the content of these fields, I still use Ctrl + C and V , but it is already on the list to change this code so that when I enter the field by TAB or mouse click, the program already places the content of the translated text on my clipboard, so I only need to paste it where I want the text.


Now showing the new version still in development, a lot of things will be changed. I put the main menu as an MDI Container so that more screens can be opened inside it, making it a future manager and productivity facilitator for Hive.

image.png

The last text field is for Meta Threads, in which I've been making some small posts and trying to improve the circle of acquaintances and people focused on cryptocurrencies, so it's interesting to be able to post there quickly as well.

Gradually the idea is to make a connection to SQL Server to use HiveSQL and thus have a complete tool for observe and monitor the gains related to dividends, something I have already been doing and posting from time to time and everything is also manual. With this, after this first phase, export to Excel, PDF and other files.

image.png

The heart of the project is this function, which receives the text in Portuguese and converts it to English. The "input" variable receives this text and the "targetLanguage" variable receives "EN" in this case, indicating that it will be in English.

public string TranslateText(string input, string targetLanguage)
{
try
{
var client = new RestClient("https://api.mymemory.translated.net/get");

// Create a GET request with the query parameters
var request = new RestRequest("", Method.Get);

request.AddParameter("q", input); // Text to be translated

// Language pair (from: 'pt' to target)
request.AddParameter("langpair", $"pt|{targetLanguage}");

// Execute the request
var response = client.Execute(request);

dynamic jsonResponse = JObject.Parse(response.Content);

if (jsonResponse != null && jsonResponse.responseData.translatedText != null)
{
return jsonResponse.responseData.translatedText.ToString();
}

return "Error in translation.";
}
catch (Exception ex)
{
return $"Error: {ex.Message}";
}

}

It's all still very rigid, obviously, but another point I want to implement is reading parameters from an .ini file, to give more flexibility to the project, which could be used to define, for example, which tags I want to use by default.

Finally, I also want to make just one translator, in which I translate what I wrote into English and then add a tag at the end, also focusing on inLeo's Threads. Since I have a character limit per day, translating long posts is not my focus at this point.

So, until the next update, guys! See you there!

sun_divisor.webp

image.pngUnsplash

lotus_divisor.png

Olá a todos! Saudações a todos os programadores. Acredito que essa será a minha primeira postagem aqui, então, calma, paciência e solidariedade neste momento meus amigos! Tudo na vida é aprendizado!


O lado bom de ser um programador é que podemos pensar em soluções bacanas para algum problema ou dificuldade que estamos passando e com isso desenvolver nós mesmos a solução. É o que comecei a fazer a pouco tempo, visando que a minha maior dificuldade no momento são as traduções e o uso de tags nas respostas, comecei a desenvolver uma solução própria para isso.

Utilizando uma API de tradução grátis da "MyMemory", você pode conferir o site deles aqui => https://mymemory.translated.net/ que ao que parece me permiti traduzir 5000 caracteres por dia, implementei na linguagem em C# (C-Sharp) um simples tradutor, focado em traduzir do português para o inglês (E é possível outras línguas também) para as Threads da inleo, X e posteriormente a ideia para a Threads da Meta.

image.png

Com isso a ultima versão estável é essa da imagem acima, onde eu coloco o meu texto em português e clicando no botão ou atalho F2 realizo a tradução e já coloco no formato desejado para colocar na inLeo e no X. Claro que agora que o X está banido do Brasil e voltamos aos tempos da boa e velha censura, opa, do tempo das cavernas, esse ficou obsoleto.

Com isso surgiu a ideia de ir para as Threads da Meta, tentar criar contatos, amizades e laços com pessoas que também curtem criptomoedas e liberdade financeira. Com isso, comecei o novo desenvolvimento do meu projeto que tinha como nome "Tradutor Libre" e depois mudei para Tradutor Livre.

Sim, fiz pesquisas e busquei informações de como fazer um programa traduzir os textos, então foi Google + ChatGPT + minha imaginação para criar e bem, não vejo problema nisso, com ou sem IA eu iria chegar nessa solução como já cheguei em várias outras antes de existir inteligência artificial, simplesmente pesquisando no Google.

Para copiar o conteúdo destes campos, ainda utilizo o Ctrl + C e V, mas, já está na lista para mudar esse código para que quando eu entrar no campo por TAB ou clique do mouse, o programa já coloque no meu clipboard o conteúdo do texto traduzido, assim, somente preciso colar aonde desejar o texto.


Agora mostrando a versão nova ainda em desenvolvimento, muita coisa vai ser mudada. Coloquei o menu principal como um MDI Container para que mais telas possam ser abertas ali dentro, fazendo dele um futuro gerenciador e facilitador de produtividade para a Hive.

image.png

O ultimo campo de texto é para as Threads da Meta, no qual tenho feito algumas pequenas postagens e tentando melhorar o circulo de conhecidos e focados em criptomoedas, então é interessante ter uma agilidade para postar lá também.

Gradualmente a ideia é fazer uma conexão ao SQL Server para usar o HiveSQL e assim ter uma ferramenta completa também para observar e monitorar os ganhos relacionados aos dividendos, algo que já venho fazendo e postando uma vez ou outra e tudo bem manual também. Com isso depois dessa primeira fase, exportar em arquivo excel, pdf e coisas do tipo.

image.png

O coração do projeto é essa função, que recebe o texto em português e converte para o inglês. A variável "input" recebe esse texto e a "targetLanguage" recebe no caso "EN", indicando que será em inglês.

public string TranslateText(string input, string targetLanguage)
{
try
{
var client = new RestClient("https://api.mymemory.translated.net/get");

// Create a GET request with the query parameters
var request = new RestRequest("", Method.Get);

request.AddParameter("q", input); // Text to be translated

// Language pair (from: 'pt' to target)
request.AddParameter("langpair", $"pt|{targetLanguage}");

// Execute the request
var response = client.Execute(request);

dynamic jsonResponse = JObject.Parse(response.Content);

if (jsonResponse != null && jsonResponse.responseData.translatedText != null)
{
return jsonResponse.responseData.translatedText.ToString();
}

return "Error in translation.";
}
catch (Exception ex)
{
return $"Error: {ex.Message}";
}

}

Tudo muito ainda engessado obviamente, mas outro ponto que quero implementar é a leitura de parâmetros de um arquivo .ini, para dar mais flexibilidade ao projeto, podendo servir para por exemplo definir quais tags que quero utilizar por padrão.

Por fim, depois também quero fazer apenas um tradutor, no qual traduza o que escrevi para o inglês e depois jogue uma tag no final, focando também nas Threads da inLeo. Como tenho limite de caracteres para usar por dia, nesse primeiro momento a tradução de postagens longas não está no meu foco.

Então, até a próxima atualização pessoal! Nós vemos lá!

lotus_divisor.png

banner_hiver_br_01.png

🔹Hive Games: Splinterlands | dCrops | Terracore | Holozing🔹

🔹Follow me on X | Get Paid For Unused Internet Honeygain🔹

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center