Giter VIP home page Giter VIP logo

langcs's Introduction

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.

langcs's People

Contributors

hkaracaoglu 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.