Hello, friends!
The article briefly describes how to apply localization to your application using
DevUtils ELAS for Microsoft Translation , these are extensions for
DevUtils ELAS Core .
DevUtils ELAS Core is a Nuget package, but it does not add any additional Reference'ov to the project; it is only integrated into the project build process, and also adds its configuration file ".elas \ ElasConfiguration.props" to the Solution ". After the build in the project (at the time of writing the latest version 0.0.5 which supports .Net4.x, Windows Store, Windows Store Phone projects and Resx, Resw files), an Xliff (Xlf) file will be created next to each resource file.
DevUtils ELAS for Microsoft Translation will automatically translate strings using Microsoft Translation (an Internet connection is required). At the moment, a free subscription is used, it is 2`000`000 characters per month. If this limit is exceeded, you can register / subscribe to the data market (
Obtaining an Access Token clause 1 and 2) and add values ​​to ElasConfiguration.props.
Example:<?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ... <PropertyGroup> <ElasMicrosoftTranslationClientId>% Client ID%</ElasMicrosoftTranslationClientId> <ElasMicrosoftTranslationClientSecret>% Client secret%</ElasMicrosoftTranslationClientSecret> </PropertyGroup> ... </Project>
')
After that, analyze the Xliff file (s) and translate “target state” to “translated” and run “Build” again. Translation is ready.
Recommendations
For comfortable work with Xliff files in Visual Studio, add yourself an XML schema, it is in packages \ DevUtils.Elas.Core.xxxx \ Schemas \ xliff-core-1.2-transitional.xsd.
When localizing a large resource file (the first time) so that the Build process does not freeze, turn on MSBuild project build output verbosity in Visual Studio lower than Minimal, in this case you will see the progress of the automatic translation using Microsoft Translate.
Conclusion
The project is at the initial stage of development. In the future, it is planned to expand the list of supported projects and sources for translation.
Thanks for attention.