display calendar in your native language

From: Date: Mon, 16 Oct 2006 15:45:26 +0000
Subject: display calendar in your native language
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7354@lists.php.net to get a copy of this message
Was working on the GtkCalendar example when I discover that php-gtk2 can "automatically" display the calendar in your native language. Have only tested this in winxp. Not sure if it works on linux. All you need is: 1) Go to Control Panel - Regional and Language Options - Advanced, and select your native language 2) Add setlocale(LC_ALL, 'rus') before creating the GtkCalendar widget. For German, use 'deu'. For French, use 'fra'. For Portuguese (Brazilian), use 'ptb'. For other countries, you may refer to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp 3) Add the following 3 lines after creating the GtkCalendar widget. $style = $this->calendar->style->copy(); $style->font = new PangoFontDescription('Arial 12'); $this->calendar->set_style($style); And you will get the following: Russian: http://www.kksou.com/php-gtk2/gif/0062-rus.gif German: http://www.kksou.com/php-gtk2/gif/0062-deu.gif French: http://www.kksou.com/php-gtk2/gif/0062-fra.gif Portuguese (Brazilian): http://www.kksou.com/php-gtk2/gif/0062-ptb.gif For more details, please refer to: http://www.kksou.com/php-gtk2/articles/display-calendar-in-your-native-language.php All the while many of my friends and I have thought that php-gtk2 still doesn not support foreign language, until we saw the GtkCalendar displayed in various native language on a standard English winxp with just 4 lines of codes! So apparently php-gtk2 / Pango does support displaying of foreign characters as they have claimed! We're still trying to figure out how to display foreign characters in GtkLabel and other widgets. The above techniques doesn't work on GtkLabel. If any of you have any clues, would greatly appreciate if you could shed some lights... Regards, /kksou -- View this message in context: http://www.nabble.com/display-calendar-in-your-native-language-tf2453167.html#a6837058 Sent from the Php - GTK - General mailing list archive at Nabble.com.

« previous php.gtk.general (#7354) next »