[PATCH] Use the current locale in sensors program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 6 Apr 2008 23:02:32 +0200, Aurelien Jarno wrote:
> The previous patch fixed libsensors behaviour wrt locales, so I guess it
> is now safe to use the current locale for all categories in the sensors 
> program. This includes LC_NUMERIC, so the values are printed using the
> correct decimal separator wrt to the locale settings.
> 
> 
> Index: prog/sensors/main.c
> ===================================================================
> --- prog/sensors/main.c	(r?vision 5168)
> +++ prog/sensors/main.c	(copie de travail)
> @@ -257,7 +257,7 @@
>  		{ 0, 0, 0, 0 }
>  	};
>  
> -	setlocale(LC_CTYPE, "");
> +	setlocale(LC_ALL, "");
>  
>  	do_raw = 0;
>  	do_sets = 0;
> 

I'm a bit reluctant to apply this. For one thing, it assumes that the
libsensors locale fix is applied, while it should be possible to use
sensors 3.0.1 with libsensors 3.0.2. This is unlikely to happen, but
still.

For another, this will change the output of "sensors" and "sensors -u",
which we know some people are parsing. While there is a workaround
(have the caller change LC_ALL) this is still likely to break scripts
out there.

Last but not least, sensors isn't internationalized, and I think it's a
bit confusing to have sensors use English words (adapter, sensor,
thermistor, alarm etc.) but write numbers using the French syntax.

I welcome other opinions on this patch though. If a clear majority
think that this patch should be applied, my opinion on the matter isn't
that strong.

-- 
Jean Delvare




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux