On 2012.09.15 11:35, Hans de Goede wrote:
> BTW I agree that we really need to do a libusb_strerror()
> but I also agree that that should handle translations...
>
> For Linux this can be easily done with gettext, but for
> other platforms it cannot... Either way we should honor
> the LANG / LC_MESSAGES setting under Linux for determining
> which language to use for the messages. For other platforms
> we may need a libusb_set_lang or some such ??

I've said it before and I'll say it again, though not everybody may like 
it; if we want to handle translations in libusb_strerror, we should:
1. State that the function returns an UTF-8 string always.
2. Have it take an extra parameter (ISO code or something) for the 
required translation (would default to returning en_US if not found) and 
let the app developer handle the rest. We spent an awful lot of time on 
this already, and it baffles the mind that we should waste so much 
effort for less than 20 messages. Yeah, it'll make app developers on 
Linux add a couple lines of codes to read LANG/LC_MESSAGE and 
potentially convert the result UTF-8 to whatever. But that's a fairly 
well documented process (heck, I'll write a doc sample on how to do just 
that if needed) and not the end of the world.

There, language support done in a matter of minutes, not days. And since 
our sources *are* UTF-8, no need for splitting languages in zillions of 
subfiles: if someone wants to add a translation, just edit the single 
libusb_intl_messages.h or something we'll have, and send us a patch.

Regards,

/Pete


------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to