Giter VIP home page Giter VIP logo

l10nsharp's Introduction

Overview

L10NSharp is a .NET localization library for Windows Forms applications. It collects strings which need localization when your application first runs and saves them in a translation memory file. It can also dynamically collect strings at runtime.

L10NSharp works with either TMX or XLIFF files as translation memory. Which one gets used can be selected when creating a LocalizationManager.

How to use

L10NSharp is provided as a nuget package.

To use L10NSharp in your application, simply call the Create method on LocalizationManager, passing the location of the translation memory files and some other information:

using (var lm = LocalizationManager.Create(TranslationMemory.XLiff, lang, "SampleApp",
    "SampleApp", productVersion, directoryOfInstalledXliffFiles, "MyCompany/L10NSharpSample",
    icon, "[email protected]", "SampleApp")
{
    // existing code to run the application
}

L10NSharpExtender

To localize a Windows Forms form or control, simply add the L10NSharpExtender. It will automatically collect all the localizable strings on your form or control and its children.

Localizing Within the Application

L10NSharp provides a dialog for translating terms while running the application. The dialog can be launched by Alt-Shift-clicking a Windows Forms element.

Upgrading to a newer version

The migration guide describes the necessary changes when upgrading to a higher major version.

Building

Just download the repository and build the solution (L10NSharp.sln).

The command line build command would look something like this:

msbuild /t:Build /p:Configuration=Debug build/L10NSharp.proj

Note that on Linux building L10NSharp requires at least version 5 of Mono, which mono5-sil provides. The Mono 5 version that the Mono project provides also works (if mono is at least version 5.16).

Running Unit Tests

We use NUnit to run our unit tests. NUnit is downloaded via NuGet. There may be a few tests that do not run, but all tests that run should pass.

The tests can be run from the command line like this:

msbuild /t:Test build/L10NSharp.proj

It is also possible to run the tests from inside Visual Studio, Rider or MonoDevelop (if mono5-sil is installed and made the default Mono runtime).

Working on UI related files

The L10NSharp project uses SDK style .csproj files which don't allow the Designer to be used in Visual Studio 2017+. There is a src\L10NSharp\L10NSharp-Designer.csproj file which uses the old .csproj style and thus allows the programmer to edit the files with the Designer in Visual Studio 2017.

l10nsharp's People

Contributors

andrew-polk avatar ermshiperete avatar expebition avatar gmartin7 avatar hatton avatar jamesprabu avatar jasonleenaylor avatar johnthomson avatar papeh avatar phillip-hopper avatar stephenmcconnel avatar tombogle avatar

Watchers

 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.