On Wed, 08 Dec 2010 10:50:17 +0100 (CET) 桂林 <[email protected]> wrote:

> I want show week in chinese, Wed to "星期三", can I do it?

你好 :)

You need to set your system locale to zh_CN.UTF8 (at least the LC_TIME
locale). If you don't know how, google...

This will however set all your dates in your system to be in chinese.
In the weird case you don't want that (like me, I just like the look of
it in the panel) you can do something like this, but its quite dirty.

os.setlocale("zh_CN.UTF8", "time")
local mydate = widget{type = "textbox"}
local mydate_timer = timer {timeout = 300}
local function mydate_update()
    os.setlocale("zh_CN.UTF8", "time")
    mydate.text = os.date("%B%e号%a")
    os.setlocale("en_GB.UTF8", "time")
end
mydate_update()
mydate_timer:add_signal("timeout", mydate_update)
mydate_timer:start()

Note this just displays the date and the timer is set to 5 minutes so 
its not causing any load at all.

cheers
lukash


> 
> 2010/12/8 桂林 <[email protected]>
> 
> > any good idea?
> >
> > 2010/12/8 Julien Danjou <[email protected]>
> >
> > On Wed, Dec 08 2010, Gwenhael Le Moine wrote:
> >>
> >> > You need to override the default 60s timeout when you create the widget,
> >> > like this:
> >> >         mytextclock = awful.widget.textclock( " %d.%m.%Y %H:%M ", 1 )
> >> >
> >> > the second parameter, 1, is the timeout, the widget will be refreshed
> >> every
> >> > second.
> >> > Note that I'm not sure how it will affect the load...
> >>
> >> It does not load much, but it makes awesome be awaken every second,
> >> which can be considered a bad thing wrt power management.
> >>
> >> --
> >> Julien Danjou
> >> // ᐰ <[email protected]>   http://julien.danjou.info
> >>
> >
> >
> >
> > --
> > Best regards,
> >
> > Jason Green
> > 桂林
> >
> >
> >
> 
> 
> -- 
> Best regards,
> 
> Jason Green
> 桂林

--
To unsubscribe, send mail to [email protected].

Reply via email to