Modifying the blogengine.net countries dropdownlist to inlclude Palestine

After I started to use Blogengine , i noticed that Palestine  is not in the countries list that disaplyed in the comments box.I found the the blogenigne use the CultureInfo to get the countries based on the languages of each region.Since there is no Palestine langauge for arabic culture , the Palestine wasn't inlcluded.

well, as I'm from Palestine and there mant palestinian developers who reads my blog ,  i have to fix it.

What i did is opened "user controls/ CommentView.ascx" and navigated to "BindCountries" method and added Palestine like below:

public void BindCountries()
{
StringDictionary dic = new StringDictionary();
List<string> col = new List<string>();
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
RegionInfo ri = new RegionInfo(ci.Name);
if (!dic.ContainsKey(ri.EnglishName))
dic.Add(ri.EnglishName, ri.TwoLetterISORegionName.ToLowerInvariant());
if (!col.Contains(ri.EnglishName))
col.Add(ri.EnglishName);
}
 
// add palestine
if (!dic.ContainsValue("pal"))
{
dic.Add("Palestine", "pal");
col.Add("Palestine");
}

Ok , now Palestine will be available in the countries list in the comments section.the remainig issue is to fix the flag. To fix the flag issue, you need to place the palestine flag ("pal.png") inside "pics\flags" folder.
Note: there is also another countries list in the user profile page "admin\Pages\Profiles.aspx" which needs the same steps.

No Comments