digitie / transmission-remote-dotnet

Automatically exported from code.google.com/p/transmission-remote-dotnet
GNU General Public License v3.0
1 stars 0 forks source link

UI Fix: Date formats #229

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I just put another comment in the closed issue 226, heres the summary:

Date Format:
  Seems most of the other Windows programs I run use mm/dd/YYYY format, yet 
transmission-remote-dotnet formats dates like normal timestamps, dd/mm/YYYY 
(which is much more "logical", but I digress).  Now that transmission-
remote-dotnet has some i18n support, how about some L10n for the date 
strings?

_____________________

Globalization (i18n + L10n in MS speak)

I think it's a matter of getting the current culture from the system and 
then the ToString() method will have a different format.

Good example:
http://msdn.microsoft.com/en-us/library/5hh873ya.aspx

Better example from http://msdn.microsoft.com/en-us/library/k494fzbf.aspx:

using System;
using System.Globalization;
using System.Threading;

public class DateToStringExample
{
   public static void Main()
   {
      CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
      DateTime exampleDate = new DateTime(2008, 5, 1, 18, 32, 6);

      // Display the date using the current (en-US) culture.
      Console.WriteLine(exampleDate.ToString());

      // Change the current culture to fr-FR and display the date.
      Thread.CurrentThread.CurrentCulture = 
CultureInfo.CreateSpecificCulture("fr-
FR");
      Console.WriteLine(exampleDate.ToString());

      // Change the current culture to ja-JP and display the date.
      Thread.CurrentThread.CurrentCulture = 
CultureInfo.CreateSpecificCulture("ja-
JP");
      Console.WriteLine(exampleDate.ToString());

      // Restore the original culture
      Thread.CurrentThread.CurrentCulture = currentCulture;
   }
}
// The example displays the following output to the console:
//       5/1/2008 6:32:06 PM
//       01/05/2008 18:32:06
//       2008/05/01 18:32:06

Original issue reported on code.google.com by tbea...@gmail.com on 7 Mar 2010 at 3:34

GoogleCodeExporter commented 8 years ago
Ah, i found:
we use en-GB as English, which is using ShortDatePattern = "dd/MM/yyyy".
If i set en-US as culture, the dateformat is different: ShortDatePattern = 
"M/d/yyyy"

:/

Original comment by elso.and...@gmail.com on 7 Mar 2010 at 5:42

GoogleCodeExporter commented 8 years ago
Fixed in r548.

Original comment by elso.and...@gmail.com on 8 Mar 2010 at 5:51