GTranslatorAPI
Google Translate Rest API (Free) - .NET Core 5 , .NetStandard2.1
Install / Use
/learn @franck-gaspoz/GTranslatorAPIREADME
GTranslatorAPI
Google Translate Rest API (Free) - .NET Core 5 , .NetStandard2.1 VSCode / Visual Studio
<hr> This project is licensed under the terms of the MIT license: LICENSE.md
a C# library that deals with Google Translate REST API. Offers google translate service operations from a C# software (with no api token)
using GTranslatorAPI;
...
var translator = new Translator();
// source language, target language, text to be translated
var result = await translator.TranslateAsync(Languages.en, Languages.fr, "text to be translated");
// output translated text
System.Console.WriteLine(result);
Get the library project (vscode example)
source from GitHub:
cd myProjects
git clone https://github.com/franck-gaspoz/GTranslatorAPI.git
cd .\GTranslatorAPI\
code .
then go Run > Start Debugging , select .Net Core engine, you should get the output:
GTranslator API CLI 2.0.0.0
(c) franck.gaspoz@gmail.com 2021 License MIT
command line syntaxes:
source_langid target_langid text [-q] [-w]
source_langid : original text lang id
target_langid : translated text lang id
q : turn off all outputs excepting errors
-l | --list [-w]
l | list : dump list of languages ids & names
w : wait a key press before exit
package from nuget:
dotnet add package GTranslatorAPI --version 2.0.0 --source https://www.nuget.org/api/v2/package/
package from GitHub:
dotnet add package GTranslatorAPI --version 2.0.0 --source https://nuget.pkg.github.com/franck-gaspoz/index.json
Use the library
let's build a new C# console project for testing the GTranslatorAPI nuget package, using powershell, dotnet and vscode :
mkdir MyProject
cd MyProject
dotnet new console
dotnet add package GTranslatorAPI --version 2.0.0
code .
let's change the default main method in Program.cs, to change its default behavior (output 'Hello world!') by a new one, that adds a translation of 'Hello world!' to spanish, using the GTranslatorAPI :
using System;
using GTranslatorAPI;
namespace MyProject
{
class Program
{
static async Task Main(string[] args)
{
string s = "Hello world!";
Console.WriteLine(s);
var translator = new Translator();
var result = await translator.TranslateAsync(Languages.en,Languages.es,s);
Console.WriteLine(result.TranslatedText);
Console.WriteLine(dbg);
}
}
}
then run the project (ctrl+F5 | Run > Start without debugging). You should get:

:information_source: About this repository
To go further, please read informations at : http://franckgaspoz.fr/en/use-google-translate-for-free-on-the-command-line/ or contact the autor
Related Skills
gh-issues
341.0kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
341.0kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
tmux
341.0kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
