If you are giving the English text you might as well use the English text as your key in your map for your lookups. People have been doing that successfully for 20+ years.
Posted Jan 25, 2013 4:17 UTC (Fri) by skissane (subscriber, #38675)
[Link]
Well, you can't just use the English text as-is. You actually have to use the English text with substitution variables, e.g. "File %s not found", and then pass the substitution variables separately - so passing a single string variable from user-space doesn't work very well, you'd need to do something like pass a structure containing the format string and the arguments to go with it...
And, while this approach is popular with e.g. the gettext API, I see a couple of drawbacks:
Assigning numeric error IDs helps: if a non-English user needs help from an English-speaking resource, the English-speaker can quickly identify the error if a numeric code is included; otherwise, off to Google translate
What if the English message in the kernel has bad spelling or grammar? Well, you don't want to change it now, its part of the user-space ABI. If the kernel was to pass a numeric error code to user space, the English text can be corrected much more easily
log why the permission is denied
Posted Jan 25, 2013 4:25 UTC (Fri) by dlang (✭ supporter ✭, #313)
[Link]
actually google does amazingly well with just pasting in the full error text. I used to carefully modify the messages when searching for them, then I saw a co-worker just pasting in the full error and it sure saves time :-)