Forum: wxRuby CalendarCtrl - Weekdays names - Month names

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Carlos Troncoso Phillips (Guest)
on 2008-12-29 09:28
(Received via mailing list)
Hi there!
I've been using wxRuby for some days, and already done some quite neat
apps, but (there is always a but) even though I thought WeekDays names
and month names where governed by the OS (and local localization), my
calendar shows up with english names.
I haven't been able to find a method or attr on the calendarctrl to
override this.
So, is it possible to use custom names (Mon-Tue-Wed-Thu-Fri-Sat-Sun) ->
(Lu-Ma-Mi-Ju-Vi-Sa-Do) as well as month names for use in foreign apps?
Best regards
Carlos Troncoso Phillips
Alex F. (Guest)
on 2008-12-31 18:12
(Received via mailing list)
Hi

Carlos Troncoso Phillips wrote:
> I've been using wxRuby for some days, and already done some quite neat
> apps, but (there is always a but) even though I thought WeekDays names
> and month names where governed by the OS (and local localization), my
> calendar shows up with english names.
> I haven't been able to find a method or attr on the calendarctrl to
> override this.
> So, is it possible to use custom names (Mon-Tue-Wed-Thu-Fri-Sat-Sun) ->
> (Lu-Ma-Mi-Ju-Vi-Sa-Do) as well as month names for use in foreign apps?
>

My native locale is en_GB, but when I added this to the top of the
calendar sample:

Wx::Locale.new(Wx::LANGUAGE_FRENCH)

the calendar control correctly displays the weekdays as "Lun Mar Mer
Jeu..." and with the french month names. This is on OS X.

I had a look at the wxWidgets code that handles this, and it should be
using the same locale-sensitive system calls as Ruby itself. Could you
say a) what operating system you're using and b) whether a ruby call
like

Time.now.strftime("%A")

returns the correct local name?

You could try adding a call like the above
Wx::Locale.new(Wx::LANGUAGE_XXX) for the correct language to see if that
sets what you want.

alex
This topic is locked and can not be replied to.