On 2013.05.28 11:25, Hans de Goede wrote:
> +int LIBUSB_CALL libusb_set_strerror_locale(const char *locale);
> +const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode);

Why not go:
const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode, 
const char *locale);
?

Since it's been removed for so long, we're pretty introducing the call 
at this stage, so we don't care about compatibility with past 
implementation (or the not yet release libusb's). To make it intuitive, 
accept NULL as a locale, and make it work the same as "en".

I also really wouldn't bother with trying to figure out whether 
"american" should really mean English,

IMO, and this is one of the few things that I think Windows did fairly 
well when it comes to NLS (but then again, they seem to have extended 
just a little bit on ISO 639-1), and since this is a libusbx specific 
convenience function (that doesn't have to follow any established set of 
rules as long as we can make it intuitive), what we should really use as 
locale parameter is the Language Culture Name name from 
http://msdn.microsoft.com/en-us/library/ee825488.aspx

You want English? Then your locale should start with "en". You want 
"colour" instead of "color", then try "en-GB", in case we also added 
support for the 'dash filter' (which will be very easy to implement on 
our side) to provide subculture localisation.

There. One call, one easily referable page for the locale code, no 
enums, and if you don't have a clue or don't care, you can just pass 
NULL and get English. Hard to be any more KISS than that.

Regards,

/Pete

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to