[Rejected] Change TV/Radio Guide to Localize Day Spincontrol (1 Viewer)

#Coder

Portal Member
September 8, 2009
5
1
Pittsford, NY
Home Country
United States of America United States of America
Currently, the day spincontrol (id=6) for TVGuide and RadioGuide uses a hard-coded format that does not respect the current culture (i.e., it always shows day before month). The attached patch changes the values so they display day and month in the appropriate order and use the appropriate date separator character (both of these are decided based upon the current culture).

I submitted a bug report on this as well which has not yet been accepted. I apologize if I was supposed to wait for the bug to get logged/accepted before submitting the patch (this is my first contribution)..

The attached patch is for svn 23545 and changes TvEngine3\TVLibrary\TvPlugin: TvGuideBase.cs and RadioGuideBase.cs

Thank you for your consideration.

EDIT: I updated the patch so it first tries to use MP's current culture. If null (which I wouldn't expect), it will then use the current thread's culture to determine the date format/separator.
 

Attachments

  • LocalizeGuideDaySpincontrol (using svn23545).patch
    30.8 KB

#Coder

Portal Member
September 8, 2009
5
1
Pittsford, NY
Home Country
United States of America United States of America
Thank you for your time and suggestion. I agree with you; the only reason I duplicated it is because there is already a lot of redundancy between TvGuideBase and RadioGuideBase. Your suggestion caused me to rethink this a bit. What if I create a new class, LocalDateTime, in MediaPortal.Util\Localisation and provide generic capability for returning localised date, time and date/time strings (pass it a DateTime and a format specification)? This would allow me to move the code that obtains the short day of the week string into that class as well. It could also potentially be reused elsewhere.

Do you think this would be useful or overkill?
 

Mashenden

Portal Pro
January 13, 2006
113
3
Richmond, VA
Home Country
United States of America United States of America
Currently, the day spincontrol (id=6) for TVGuide and RadioGuide uses a hard-coded format that does not respect the current culture (i.e., it always shows day before month). The attached patch changes the values so they display day and month in the appropriate order and use the appropriate date separator character (both of these are decided based upon the current culture).

I submitted a bug report on this as well which has not yet been accepted. I apologize if I was supposed to wait for the bug to get logged/accepted before submitting the patch (this is my first contribution)..

The attached patch is for svn 23545 and changes TvEngine3\TVLibrary\TvPlugin: TvGuideBase.cs and RadioGuideBase.cs

Thank you for your consideration.

EDIT: I updated the patch so it first tries to use MP's current culture. If null (which I wouldn't expect), it will then use the current thread's culture to determine the date format/separator.

Please cleanup duplicate code so we can consider including your patch ;)

Simone

Wow, I just ran across your post, #Coder, on this matter. My posts asking for a solution on this have largely gone ignored - it was great to see you may have a solution and that the developers may be adopting it.

I am not familiar with implementing patches. Can you suggest how I would 1) confirm your patch will work with my MP 1.0.2 installation - what does svn23545 mean?? and 2) find instructions on how to implement the patch.

Many thanks.

mashenden
 

Users who are viewing this thread

Top Bottom