erco77/nixieclock

Language of the date

Closed this issue · 3 comments

b4zz4 commented

I wanted the days and month to appear in Spanish:

LANG=es_ES nixieclock -s "%H:%M:%S %a %b %d"

but this doesn't affect the day and month

Mmm, try adding to nixieclock-app.C:

1) To the top of the program add:
     #include <locale.h>
     
2) As the first line in main():
    setlocale(LC_ALL, "");	// multilanguage support

Let me know if that works and I'll add it.

Note that the nixie tube characters are ASCII only; no accent marks are implemented. You'd have to somehow reformat all diacritics to their ASCII equivalent for things to be readable, and I'm not sure that's possible in any manageable way across all languages.

b4zz4 commented

Yeah, ASCII doesn't have accents, so I wrote this:

nixieclock -s "%H:%M $( date "+%a %b %d" | sed 's/é/e/')"

Heh, well, that'll probably work.. until midnight when the date changes ; )