[blam] Let the system figure out the locale



commit 9fe170ea969c9c6a04a14d95770971e066aa3fd0
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Tue Jun 1 12:05:28 2010 +0200

    Let the system figure out the locale
    
    Remove a bunch of ugly, manual and probably wrong code

 src/ItemView.cs |   25 +------------------------
 1 files changed, 1 insertions(+), 24 deletions(-)
---
diff --git a/src/ItemView.cs b/src/ItemView.cs
index 8097f64..3daf450 100644
--- a/src/ItemView.cs
+++ b/src/ItemView.cs
@@ -96,33 +96,10 @@ namespace Imendio.Blam {
         {
 			Theme theme = Application.TheApp.ThemeManager.CurrentTheme;
 
-            /* One of the variables should be set. */
-            string locale = Environment.GetEnvironmentVariable("LC_MESSAGES");
-
-            if(locale == null){
-                locale = Environment.GetEnvironmentVariable("LC_ALL");
-            }
-            if(locale == null){
-                locale = Environment.GetEnvironmentVariable("LC_TIME");
-            }
-            if(locale == null){
-                locale = Environment.GetEnvironmentVariable("LANGUAGE");
-            }
-            if(locale == null){
-                locale = Environment.GetEnvironmentVariable("LANG");
-            }
-            if(locale == null){
-                locale = "en"; /* Give up. */
-            }
-
-            if(locale.IndexOf('_') != -1){ /* There is a separator. Do en_US.UTF-8 -> en, eg.*/
-                locale = locale.Substring(0, locale.IndexOf('_'));
-            }
-
             string author  = (!"".Equals(currentItem.Author)) ? String.Format(Catalog.GetString("by {0}"), currentItem.Author) : "&nbsp;";
             string link    = Catalog.GetString("Show in browser");
             string pubdate = (!currentItem.PubDate.Equals(DateTime.MinValue)) ?
-                currentItem.PubDate.ToString("D", System.Globalization.CultureInfo.CreateSpecificCulture(locale)) : "&nbsp;";
+                currentItem.PubDate.ToString("D", System.Globalization.CultureInfo.CurrentUICulture) : "&nbsp;";
             string text    = HtmlUtils.EncodeUnicode(HtmlUtils.FixMarkup(currentItem.Text));
             string title   = HtmlUtils.Escape(currentItem.Title);
             string url     = currentItem.Link;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]