Re: display calendar in your native language
| From: | Fernando Correa da Conceição | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: display calendar in your native language | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7356@lists.php.net to get a copy of this message | ||
kksou escreveu:
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
For me it always display my characters, for iso 8859-1(pt_BR) and utf-8.
Try setting the charset on php.ini using
php-gtk.codepage = UTF-8
Works for me, just set your charset on php.ini
--
Fernando Correa da Conceição
fernandoc@php.net
icq: 168518047 msn: fernandocphp@hotmail.com
Blog: http://fernando-php.blogspot.com/
http://manualphp.sf.net
Participe da tradução do manual do PHP