LangCS 2.0.1
dotnet add package LangCS --version 2.0.1
NuGet\Install-Package LangCS -Version 2.0.1
<PackageReference Include="LangCS" Version="2.0.1" />
paket add LangCS --version 2.0.1
#r "nuget: LangCS, 2.0.1"
// Install LangCS as a Cake Addin #addin nuget:?package=LangCS&version=2.0.1 // Install LangCS as a Cake Tool #tool nuget:?package=LangCS&version=2.0.1
langcs
Multi language manager for asp.net web forms and mvc
Installation
Open Package Manager Console and write following:
PM> Install-Package LangCS
How to use?
Web.config - Add your language files folder
<appSettings>
<add key="langCSPath" value="~/language/"/>
</appSettings>
~/language/en.xml - Create your first language xml file. (English)
File name is very important. Because filename will be your language code. There is an id
attribute in lang
tag. This is the key for identify your word. You can use any string but without any space. There is also an example with Guid.
<?xml version="1.0" encoding="utf-8" ?>
<langCS>
<lang id="HelloWorld">Hello World!</lang>
<lang id="good.luck">Good Luck!</lang>
<lang id="848E0991-31F6-4D5C-B669-E9FCCD88CCBE">Some Text</lang>
</langCS>
~/language/tr.xml - Create your secondary language xml file. (Turkish)
id
attribute is same with first language file. But text will be your translated word.
<?xml version="1.0" encoding="utf-8" ?>
<langCS>
<lang id="HelloWorld">Merhaba Dünya!</lang>
<lang id="good.luck">İyi Şanslar!</lang>
<lang id="848E0991-31F6-4D5C-B669-E9FCCD88CCBE">Yazı</lang>
</langCS>
Using in View Page (xxx.cshtml) for first language (English - /language/en.xml)
@using LangCSManager
....
<p>@LangCS.Translate("HelloWorld", "en")</p>
<p>@LangCS.Translate("good.luck", "en")</p>
<p>@LangCS.Translate("848E0991-31F6-4D5C-B669-E9FCCD88CCBE", "en")</p>
Also you can use in controller page, web form application or class library project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Bug fixed