Posts

Showing posts from November, 2014

How to translate from one language to another using google translator in c#

Following c# code use to translate one language text to another /// <summary>     /// Translate     /// </summary>     /// <param name="input">translate text </param>     /// <param name="languagePair"> language codes, Example translate spanish to enligh es|en</param>     /// <returns></returns>     public static string Translate(string input, string languagePair)     {         string url = String.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}", input, languagePair);         WebClient webClient = new WebClient();         webClient.Encoding = System.Text.Encoding.UTF8;         string result = webClient.DownloadString(url);         Regex regex = new Regex("<span id=result_box.*?>(.*?)<\\/span>");  ...

How to add culture picker in Orchard v.1.8.0.0+(MultiLanguage support)?

Install Localization-Version 1.6 and Culture Picker - Version 1.6.0.0 following features are enabled Localization,culture picker,culture picker main menu filtering, culture picker content filtering, culture picker home page auto redirect. If Orchard.CulturePicker project not load references like Orchard.Alias,Orchard.Core etc, modify target framework. Add Orchard.Content picker reference to Orchard.CulturePicker. Modify LocalizableMainMenuNavigationFilter class it is placed under Orchard.CulturePicker\Services\ LocalizableMainMenuNavigationFilter.cs then replace this class with below code. using System.Collections.Generic; using JetBrains.Annotations; using Orchard.ContentManagement; using Orchard.ContentManagement.Aspects; using Orchard.Core.Navigation.Models; using Orchard.Environment.Extensions; using Orchard.Localization.Services; using Orchard.UI.Navigation; using Orchard.ContentPicker.Models; namespace Orchard.CulturePicker.Services {     [Used...

Simple Databinding in Angular JS

Think of your model as the single-source-of-truth for your application. Your model is where you go to to read or update anything in your application. Here is example of simple data-binding <! doctype html> < html ng-app>    < head >      < script src = " http://code.angularjs.org/angular-1.0.0rc10.min.js " ></ script >    </ head >    < body >      < div >        < label >Name:</ label >        < input type = "text" ng-model = "yourName" placeholder = "Enter a name here" >        < hr >        < h1 >Hello, {{yourName}}!</ h1 >      </ div >    </ body > </ html > Edit in Plunker