3

I want to use this conky script: Conky Vision

enter image description here

But I don't want the days of the week to be displayed in English.

When I change my locale to another language, the day of today is displayed in that language but the 5-day names from the lower part of the image are always in English, even if I change the system language to something different.

I have also changed the system language but those days are still displayed in English.

What changes should I make to that script for it to follow the language I want?

The conkyrc file has this content:

# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes

# Window specifications #
gap_x 0
gap_y 0
alignment middle_middle
minimum_size 600 460
maximum_width 600
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_argb_visual yes
own_window_argb_value 255
#border_margin 0
#border_inner_margin 0
#border_outer_margin 0

# Graphics settings #
draw_shades no
draw_outline no 
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
xftalpha 0
xftfont Raleway:size=10

override_utf8_locale yes

imlib_cache_size 0

# Color scheme #
default_color FFFFFF

color1 FFFFFF

TEXT
\
#-----WOIED-----#
\
\
${execi 300 curl -s "http://weather.yahooapis.fr/forecastrss?w=615702&u=c" -o ~/.cache/weather.xml}\
\
\
#---Clock+Date---#
\
\
${font Raleway:weight=Light :size=100}${alignc}${time %H}${alignc}:${alignc}${time %M}
${font Raleway:weight=Light:size=32}${voffset -60}${alignc}${time %A %B %d}\
\
\
#---High Temperatures---#
\
\
${font Raleway:size=20}\
${voffset 76}${goto 40}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°
${font Raleway:weight=Light:size=14}\
${voffset -28}${goto 160}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°\
${goto 270}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°\
${goto 380}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°\
${goto 490}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°\
\
\
#---Low Temparatures---#
\
\
${font Raleway:weight=Light:size=10}\
${voffset 48}${goto 210}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°\
${goto 320}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°\
${goto 430}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°\
${goto 540}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°\
\
\
#---Name of the day---#
\
\
${font Raleway:weight=Light:size=14}\
${voffset 30}${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}\
${goto 170}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}\
${goto 280}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}\
${goto 390}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}\
${goto 500}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}\
\
\
#---Weather Icons---#
\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 61,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 171,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 281,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p 391,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p 501,260 -s 32x32}${font}${voffset -46}\

It seems related to the file ~/.cache/weather.xml (more details on that here).

This file contains lines like:

<yweather:forecast day="Fri" date="10 Jul 2015" low="14" high="26" text="Mostly Sunny" code="34" />
<yweather:forecast day="Sat" date="11 Jul 2015" low="15" high="27" text="Mostly Sunny" code="34" />
<yweather:forecast day="Sun" date="12 Jul 2015" low="14" high="22" text="Showers" code="11" />
<yweather:forecast day="Mon" date="13 Jul 2015" low="16" high="24" text="Cloudy" code="26" />
<yweather:forecast day="Tue" date="14 Jul 2015" low="12" high="23" text="AM Showers" code="39" />

I guess, as indicated in a comment, the commands under ---Name of the day---# in .conkyrc are writing and updating the lines in ~/.cache/weather.xml posted above (containing names of days in English). But as I see those commands just relate to the "yweather:forecast", which might mean that the days in English are written as they are grabbed by curl from the yahoo weather English_US website, and that's why they are in English.

But what intrigues me is that when I've first seen this conky was on a Spanish site where all was in Spanish. That PPA does not work anymore it seems.


I'm in elementary OS Freya (based on *ubuntu 14.04)

  • You should change the lines of the config file after #---Name of the day---#; these are the commands that extract the weekdays from the cache file. I'm afraid I can't be of any more help as I don't know much about Conky syntax. – dr01 Jul 10 '15 at 12:04
  • @dr01 - Yes, I guess those commands are the ones that write in ~/.cache/weather.xml the lines that I posted above (containing names of days in English). But as I see those commands just relate to the "yweather:forecast", which might mean that the days in English are written as they are grabbed by curl from the yahoo weather English_US website. What intrigues me is that when I first seen this conky was on a Spanish site where all was in Spanish. That PPA does not work anymore it seems. – user32012 Jul 10 '15 at 12:17
3

I'm the creator of that conky theme. :)

The names of days are provided in the xml file, and yahoo's API only offers English.

You can use 'execi' and run the date command to show all the days instead, and use the LANG variable to change the output language.


Here is an example:

#---Names of days---#
\
\
${font Raleway:weight=Light:size=14}\
${voffset 30}${goto 60}${execi 300 LANG=es_ES.UTF-8 date +%a | awk '{print toupper($0)}'}\
${goto 170}${execi 300 LANG=es_ES.UTF-8 date -d +1day  +%a | awk '{print toupper($0)}'}\
${goto 280}${execi 300 LANG=es_ES.UTF-8 date -d +2days +%a | awk '{print toupper($0)}'}\
${goto 390}${execi 300 LANG=es_ES.UTF-8 date -d +3days +%a | awk '{print toupper($0)}'}\
${goto 500}${execi 300 LANG=es_ES.UTF-8 date -d +4days +%a | awk '{print toupper($0)}'}\

UPDATE:

The above (as well as the question) is related to an older version of this conky script.

The newer version of Conky Visions (that needs conky version 1.10 (here) and jq in order to work, as well as a different font) can easily set a different language by editing the .conkyrc line for locale, template 9:

-------------------------------------
--  Locale (e.g. "es_ES.UTF-8")
--  Leave empty for default
-------------------------------------
template9=""

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy