You are not logged in.
Hello Forum,
I'm trying to bypass the poor localisation the yahoo weather api has to offer.
I'm trying to set up a conky config in which the english weekday abbreviations are replaced by their german counter parts.
This is the code I have so far:
tr '[Mon,Tue,Wed,Thu,Fri,Sat,Sun]' '[Mo.,Di.,Mi.,Do.,Fr.,Sa.,So.]'
However: Thu is translated to Doo (instead of Do.)
I confess I'm not the most gifted shell expert, but I'm pretty sure there is a way to achieve my desired outcome.
By the way
tr '['Mon','Tue','Wed','Thu','Fri','Sat','Sun']' '['Mo.','Di.','Mi.','Do.','Fr.','Sa.','So.']'
doesn't help either.
A helping hand/hint would be really appreciated
Last edited by tulek (2013-06-12 22:26:02)
Offline
You also get 'Doi' instead of 'Di'
Offline
You also get 'Doi' instead of 'Di'
Yes, I know
The problem is: Tue and Thu are sharing quite a lot of letters
But there should be a way to search for the whole string/matching the string. At least I hope so.
Last edited by tulek (2013-06-12 22:19:10)
Offline
I think it matches characters, not strings.
Offline
use sed.
sed "s/Mon/Mo/g;s/Tue/Di/g;s/Wed/Mi/g;s/Thu/Do/g;s/Fri/Fr/g;s/Sat/Sa/g;s/Sun/So/g"
Last edited by progandy (2013-06-12 22:24:51)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
Thanks,
That worked, I've experimented with sed but couldn't wrap my head around it.
Edit: Is there a "mark thread as solved button", can't find it?
Last edited by tulek (2013-06-12 22:28:26)
Offline
Is there a "mark thread as solved button", can't find it?
Offline