SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-01-15 16:46:29

Jimbo_G
#! Barcalounger
From: Paris, France
Registered: 2009-12-08
Posts: 135

Displaying the date in Conky in a different language?

I'm having a play with Conky, and I've added a calendar that I stole from the Ubuntu Forums. However, I would like the month to be displayed in French instead of English. I've read about using "locale" as a way to specify a language other than the system default, but I can't find any details anywhere...

The line that prints the month and year is simply: {execi 300 date +"%B %Y"}.

I'm very new to Conky, so I'd appreciate easy-to-understand explanations of what to do!

Offline

Be excellent to each other!

#2 2010-01-15 17:49:44

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,418

Re: Displaying the date in Conky in a different language?

Afaik date will use your system locale, so if you want date to display in French you have to change your system locale to French.

Offline

#3 2010-01-16 15:05:43

Jimbo_G
#! Barcalounger
From: Paris, France
Registered: 2009-12-08
Posts: 135

Re: Displaying the date in Conky in a different language?

Okay, thanks for the reply. I thought it might have been possible to specify a different locale, but it's really not a big problem so I'll live with it!

Offline

#4 2010-01-16 16:20:41

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,933
Website

Re: Displaying the date in Conky in a different language?

Try:

export LC_TIME=fr_FR.UTF-8
date

Then you've got to get it into conky...

(I guess this also requires you have the French locale installed on your system somewhere. I've just tried it with Japanese and it worked, though my personal locale is en_GB.utf-8)

Last edited by johnraff (2010-01-16 16:23:50)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#5 2010-01-16 22:44:00

IgorP
#! Junkie
From: Zagreb, Croatia
Registered: 2009-07-10
Posts: 338

Re: Displaying the date in Conky in a different language?

Offline

#6 2010-01-17 03:41:49

slapfish
#! Die Hard
From: Athens, Greece
Registered: 2009-10-22
Posts: 601

Re: Displaying the date in Conky in a different language?

Just in case you don't want to change your system locale, you can use if_match to change the date. I don't know why, but I'm keeping mine to en_Gb and my conky calendar in Greek like that:

${if_match "${time %B}" == "January"}Ιανουάριος$else${if_match "${time %B}" == "February"}Φεβρουάριος$else${if_match "${time %B}" == "March"}Μάρτιος$else${if_match "${time %B}" == "April"}Απρίλιος$else${if_match "${time %B}" == "May"}Μάιος$else${if_match "${time %B}" == "June"}Ιούνιος$else${if_match "${time %B}" == "July"}Ιούλιος$else${if_match "${time %B}" == "August"}Αύγουστος$else${if_match "${time %B}" == "September"}Σεπτέμβριος$else${if_match "${time %B}" == "October"}Οκτώβριος$else${if_match "${time %B}" == "November"}Νοέμβριος$else${if_match "${time %B}" == "December"}Δεκέμβριος$endif$endif$endif$endif$endif$endif$endif$endif$endif$endif$endif$endif

Offline

#7 2014-04-29 04:42:30

kungfu_sidekick
Member
From: Taiwan
Registered: 2014-04-05
Posts: 10

Re: Displaying the date in Conky in a different language?

slapfish wrote:

Just in case you don't want to change your system locale, you can use if_match to change the date. I don't know why, but I'm keeping mine to en_Gb and my conky calendar in Greek like that:

${if_match "${time %B}" == "January"}Ιανουάριος$else${if_match "${time %B}" == "February"}Φεβρουάριος$else${if_match "${time %B}" == "March"}Μάρτιος$else${if_match "${time %B}" == "April"}Απρίλιος$else${if_match "${time %B}" == "May"}Μάιος$else${if_match "${time %B}" == "June"}Ιούνιος$else${if_match "${time %B}" == "July"}Ιούλιος$else${if_match "${time %B}" == "August"}Αύγουστος$else${if_match "${time %B}" == "September"}Σεπτέμβριος$else${if_match "${time %B}" == "October"}Οκτώβριος$else${if_match "${time %B}" == "November"}Νοέμβριος$else${if_match "${time %B}" == "December"}Δεκέμβριος$endif$endif$endif$endif$endif$endif$endif$endif$endif$endif$endif$endif

This helped me!

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo