Add i18n support
Let's make a step towards the growing strace userbase all around the world and translate something to the language of their choice. This change enables translation of error messages corresponding to errno codes, making it consistent with error diagnostics of other i18n-aware tools, e.g. $ LANG=es_ES strace -qq -a38 -P /missing unlink /missing unlink("/missing") = -1 ENOENT (No existe el fichero o el directorio) unlink: no se puede deshacer el enlace '/missing': No existe el fichero o el directorio * strace.c: Include <locale.h>. (main): Invoke setlocale. * tests/init.sh: Export LC_ALL=C. * NEWS: Mention this enhancement.
This commit is contained in:
parent
884d3ae479
commit
53b0d9c438
1
NEWS
1
NEWS
@ -24,6 +24,7 @@ Noteworthy changes in release ?.?? (????-??-??)
|
||||
* Known pixel/SDR format names are printed as comments for pixelformat fields
|
||||
in v4l2 structures.
|
||||
* Enhanced decoding of kern_features syscall.
|
||||
* Added i18n support.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed build on m68k.
|
||||
|
2
strace.c
2
strace.c
@ -44,6 +44,7 @@
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <dirent.h>
|
||||
#include <locale.h>
|
||||
#include <sys/utsname.h>
|
||||
#ifdef HAVE_PRCTL
|
||||
# include <sys/prctl.h>
|
||||
@ -2668,6 +2669,7 @@ terminate(void)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
setlocale(LC_ALL, "");
|
||||
init(argc, argv);
|
||||
|
||||
exit_code = !nprocs;
|
||||
|
@ -26,6 +26,7 @@
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
export LC_ALL=C
|
||||
ME_="${0##*/}"
|
||||
LOG="log"
|
||||
OUT="out"
|
||||
|
Loading…
x
Reference in New Issue
Block a user