Package: wmtime
Followup-For: Bug #726125

 The real problem is that wmtime try to transliterate an
 abbreviations for the day of week and months with libiconv.
 But iconv has limited support for transliteration
 and can not do it for many languages.
 For example:
> echo "Вс" | iconv -f UTF8 -t ASCII//TRANSLIT - ??

 This is Russian, and I would expect "Vs".
 There is more advanced tool "konwert" and it works perfectly
> echo "Вс" | konwert UTF8-ascii Vs
 but it is not obvious how to connect it with wmtime.
 Probably the old idea to keep possible abbreviations
 in /use/share/wmtime/"language" is not bad at all.

 As a simple solution I would prefer to have additional
 flag to switch off any attempt to transliterate and
 use English names.

 The patches (rather simple) are in the attachment.

Regards, Yuri

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wmtime depends on:
ii  libc6     2.17-93
ii  libx11-6  2:1.6.2-1
ii  libxext6  2:1.3.2-1
ii  libxpm4   1:3.5.10-1

wmtime recommends no packages.

wmtime suggests no packages.

-- no debconf information
--- ../wmtime-1.0b2/wmtime/wmtime.1     2013-10-15 14:05:44.000000000 +0400
+++ ./wmtime.1  2013-10-15 14:05:25.526108646 +0400
@@ -65,6 +65,11 @@
 .IR X(7x) .
 
 .TP
+.BR \-l
+Disables the locale support and use English abbreviations for
+the day of week and months. 
+
+.TP
 .BR \-n , \ \-noseconds
 Disables the second hand.
 
--- ../wmtime-1.0b2/wmtime/wmtime.c     2013-10-15 14:05:44.000000000 +0400
+++ ./wmtime.c  2013-10-15 14:05:25.546108815 +0400
@@ -108,12 +108,13 @@
 void printversion(void);
 
 void wmtime_routine(int, char **);
-void get_lang();
+void get_lang(void);
 
 int main(int argc, char *argv[]) {
 
        int             i;
        char    *name = argv[0];
+       int             use_lang = 1;
 
        for (i=1; i<argc; i++) {
                char *arg = argv[i];
@@ -135,6 +136,9 @@
                                        return 1;
                                }
                                break;
+                       case 'l' :
+                               use_lang = 0;
+                               break;
                        case 'n' :
                                if (strcmp(arg+1, "noseconds") && strcmp(arg+1, 
"n")) {
                                        usage(name);
@@ -153,8 +157,9 @@
                }
        }
 
-       if (setlocale(LC_ALL, "") != NULL)
-               get_lang();
+       if (use_lang)
+               if (setlocale(LC_ALL, "") != NULL)
+                       get_lang();
 
        wmtime_routine(argc, argv);
        return 0;
@@ -670,6 +675,7 @@
        printf("  -d, -digital         display the digital clock\n");
        printf("  -display DISPLAY     contact the DISPLAY X server\n");
        printf("  -geometry GEOMETRY   position the clock at GEOMETRY\n");
+       printf("  -l,                  use English abbreviations for date\n");
        printf("  -n, -noseconds       disables the second hand\n");
        printf("  -h                   display this help and exit\n");
        printf("  -v                   output version information and exit\n");

Reply via email to