I want to change the language of my website. I defined two flags to change the language. I have two different tables for my native language and English. Here are the two functions shown below in my native language.
[Route("BlogPost")]
public ActionResult Blog(int Sayfa = 1)
{
ViewBag.Kimlik = db.Kimlik.SingleOrDefault();
return View(db.Blog.Include("Kategori").OrderByDescending(x=>x.BlogId).ToPagedList(Sayfa,5));
}
[Route("BlogPost/{kategoriad}/{id:int}")]
public ActionResult KategoriBlog(int id,int Sayfa=1)
{
ViewBag.Kimlik = db.Kimlik.SingleOrDefault();
var b = db.Blog.Include("Kategori").OrderByDescending(x=>x.BlogId).Where(x => x.Kategori.KategoriId == id).ToPagedList(Sayfa,5);
return View(b);
}
When I click the flag, I want to define a string like "en". It changes the relavent page like "/BlogPost/kategoriad/1"
to "/en/BlogPost/kategoriad/1"
and "www.websitename.com"
to "websitename.com/en"
. How can I do that process to define a string when you change the language and call a relevant function. I hope you can help me.