Giter Club home page Giter Club logo

deepl-dotnet's Introduction

DeepL.NET

DeepL.NET Logo

A fully-featured .NET client for the DeepL translation service. DeepL is a commercial translation service based on deep learning. This API client only supports v2 of the API as v1 has been deprecated for new DeepL API plans available from October 2018.

Features

  • .NET Core and .NET Framework compatible
  • Completely asynchronous (using the async-await pattern)
  • Covers the complete surface area of the DeepL API
  • Translate text (including text with XML markup)
  • Translate documents (Word, PowerPoint, HTML, and raw text documents)

Getting Started

To get started you have to add the package reference to your project:

Install-Package DeepL -Version 0.1.0 # Package Manager
dotnet add package DeepL --version 0.1.0 # .NET CLI
paket add DeepL --version 0.1.0 # Paket CLI

or manually add a reference to your project file:

<PackageReference Include="DeepL" Version="0.1.0" />

Then you can start translating texts:

using DeepL;

namespace Application
{
    public class Program
    {
        public static void Main(string[] arguments) => Program.MainAsync(arguments).Wait();

        public static async Task MainAsync(string[] arguments)
        {
            using (DeepLClient client = new DeepLClient("<authentication key>")
            {
                try
                {
                    Translation translation = await client.TranslateAsync(
                        "This is a test sentence.",
                        Language.German
                    );
                    Console.WriteLine(translation.DetectedSourceLanguage);
                    Console.WriteLine(translation.Text);
                }
                catch (DeepLException exception)
                {
                    Console.WriteLine($"An error occurred: {exception.Message}");
                }
            }
        }
    }
}

For a more complex example, please refer to the sample application, which demonstrates a wide variety of features. For a complete overview of DeepL.NET, please refer to the documentation.

Developing

If you want to develop the project further, please install the .NET Core SDK and, if necessary, Git. After that you are ready to clone the repository and build the project:

git clone https://github.com/lecode-official/deepl-dotnet.git
cd deepl-dotnet
dotnet build

Contributing

If you'd like to contribute, there are multiple ways you can help out. If you find a bug or have a feature request, please feel free to open an issue on GitHub. If you want to contribute code, please fork the repository and use a feature branch. Pull requests are always welcome. Before forking, please open an issue where you describe what you want to do. This helps to align your ideas with mine and may prevent you from doing work, that I am already planning on doing. If you have contributed to the project, please add yourself to the contributors list (CONTRIBUTORS.md). To help speed up the merging of your pull request, please comment and document your code extensively and try to emulate the coding style of the project.

License

The code in this project is licensed under MIT license. For more information see the license file.

deepl-dotnet's People

Contributors

lecode-official avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.