このconky(Conky Vision)が英語以外の言語で動作するようにするにはどうすればよいですか?

このconky(Conky Vision)が英語以外の言語で動作するようにするにはどうすればよいですか?

このconkyスクリプトを使いたいです。コンキビジョン

ここに画像の説明を入力してください。

しかし、曜日を英語で表示したくありません。

ロケールを別の言語に変更すると、今日はその言語で表示されますが、システム言語を別の言語に変更しても、画像の下部の5日間の名前は常に英語で表示されます。

システム言語も変わりましたが、最近はまだ英語で出てきますね。

必要な言語に従うには、このスクリプトをどのように変更する必要がありますか?

conkyrc ファイルには次の内容が含まれています。

# 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}\

~/.cache/weather.xmlそのファイルに関連しているようです(詳細はここ)。

ファイルには次の行が含まれています。

<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" />

コメントに示されているように、以下のコマンドは上に投稿された行(日付の名前が英語で含まれています)を作成して更新する---Name of the day---#ようです。しかし、私が見ると、このコマンドは "yweather:forecast"にのみ関連しています。これは、おそらく英語の日付がYahoo WeatherEnglish_USのウェブサイトからスクラップされているため、英語になっているということです。.conkyrc~/.cache/weather.xmlcurl

しかし、私が興味を持っていたのは、私がこのコンキを初めて見たときでした。すべてのコンテンツがスペイン語で提供されるスペイン語のウェブサイト。 PPAはもう機能しないようです。


私はデフォルトのOS Freyaを使用しています(*ubuntu 14.04ベース)。

ベストアンサー1

私はそのconkyテーマの創始者です。 :)

日付名はxmlファイルに提供され、YahooのAPIは英語でのみ提供されます。

「execi」を使用し、dateコマンドを実行してすべての日付を表示し、LANG変数を使用して出力言語を変更できます。


例は次のとおりです。

#---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)}'}\

修正する:

上記(および質問)は、このconkyスクリプトの以前のバージョンに関連しています。

これConky Visionsの新バージョンconky(バージョン1.10が必要(ここ)およびjq他のフォントを使用するために).conkyrcロケール行(テンプレート9)を編集して、さまざまな言語を簡単に設定できます。

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

おすすめ記事