From 84398a7686784f343e060ade8e6863faf048004a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 25 May 2010 16:46:03 +0000 Subject: [PATCH] i18n fixes --- ChangeLog | 1 + libvips/iofuncs/im_init_world.c | 3 --- tools/iofuncs/edvips.c | 3 +++ tools/iofuncs/header.c | 3 +++ tools/iofuncs/vips.c | 3 +++ tools/iofuncs/vipsthumbnail.c | 6 +++++- tools/mosaicing/find_mosaic.c | 3 +++ tools/mosaicing/mergeup.c | 3 +++ tools/other/cooc.c | 3 +++ tools/other/cooc_features.c | 3 +++ tools/other/glds.c | 3 +++ tools/other/glds_features.c | 3 +++ tools/other/simcontr.c | 3 +++ tools/other/sines.c | 3 +++ tools/other/spatres.c | 3 +++ tools/other/squares.c | 3 +++ 16 files changed, 45 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a956bac..5258c846 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ - fixes to --disable-cxx mode (thanks Mike) - added German translation, thanks Chris Leick - fixed typos in some messages, thanks Chris Leick +- fix gettext startup 21/3/10 started 7.21.3 - added progress feedback to threadpool diff --git a/libvips/iofuncs/im_init_world.c b/libvips/iofuncs/im_init_world.c index 65ecfb33..8d024252 100644 --- a/libvips/iofuncs/im_init_world.c +++ b/libvips/iofuncs/im_init_world.c @@ -194,10 +194,7 @@ im_init_world( const char *argv0 ) /* Get i18n .mo files from $VIPSHOME/share/locale/. */ im_snprintf( name, 256, - /* "%s" G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S "locale", - */ - "%s" G_DIR_SEPARATOR_S "share", prefix ); bindtextdomain( GETTEXT_PACKAGE, name ); bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); diff --git a/tools/iofuncs/edvips.c b/tools/iofuncs/edvips.c index 9e018a57..0a61165f 100644 --- a/tools/iofuncs/edvips.c +++ b/tools/iofuncs/edvips.c @@ -55,6 +55,7 @@ Copyright K.Martinez 30/6/93 #include #include #include +#include #include #include @@ -121,6 +122,8 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "%s", _( "unable to start VIPS" ) ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); context = g_option_context_new( _( "vipsfile - edit vipsfile header" ) ); diff --git a/tools/iofuncs/header.c b/tools/iofuncs/header.c index 16b4ab16..f5cf2ecd 100644 --- a/tools/iofuncs/header.c +++ b/tools/iofuncs/header.c @@ -71,6 +71,7 @@ #include #include +#include #include #include @@ -164,6 +165,8 @@ main( int argc, char *argv[] ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); context = g_option_context_new( _( "- print image header" ) ); diff --git a/tools/iofuncs/vips.c b/tools/iofuncs/vips.c index 59b8bf95..a80d6999 100644 --- a/tools/iofuncs/vips.c +++ b/tools/iofuncs/vips.c @@ -885,6 +885,9 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); + #ifdef DEBUG_FATAL /* Set masks for debugging ... stop on any problem. */ diff --git a/tools/iofuncs/vipsthumbnail.c b/tools/iofuncs/vipsthumbnail.c index d7327ed7..7d5ab66a 100644 --- a/tools/iofuncs/vipsthumbnail.c +++ b/tools/iofuncs/vipsthumbnail.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -432,7 +433,10 @@ main( int argc, char **argv ) GError *error = NULL; int i; - im_init_world( argv[0] ); + if( im_init_world( argv[0] ) ) + error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); context = g_option_context_new( _( "- thumbnail generator" ) ); diff --git a/tools/mosaicing/find_mosaic.c b/tools/mosaicing/find_mosaic.c index 70370fe0..11e5d0c7 100644 --- a/tools/mosaicing/find_mosaic.c +++ b/tools/mosaicing/find_mosaic.c @@ -60,6 +60,7 @@ #include #include #include +#include #include @@ -351,6 +352,8 @@ char **argv; if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); /* Too many? */ diff --git a/tools/mosaicing/mergeup.c b/tools/mosaicing/mergeup.c index 3436cf58..166f1a94 100644 --- a/tools/mosaicing/mergeup.c +++ b/tools/mosaicing/mergeup.c @@ -59,6 +59,7 @@ #include #include #include +#include #include @@ -471,6 +472,8 @@ char **argv; if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); /* Too many? */ diff --git a/tools/other/cooc.c b/tools/other/cooc.c index d5371a95..9879cb13 100644 --- a/tools/other/cooc.c +++ b/tools/other/cooc.c @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -59,6 +60,8 @@ argv[0]); if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); xpos = atoi(argv[3]); ypos = atoi(argv[4]); diff --git a/tools/other/cooc_features.c b/tools/other/cooc_features.c index 7b8a9ea6..d9d8a687 100644 --- a/tools/other/cooc_features.c +++ b/tools/other/cooc_features.c @@ -45,6 +45,7 @@ #include #include +#include #include @@ -56,6 +57,8 @@ main( int argc, char *argv[] ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if( argc != 2 ) error_exit( "usage: %s matrix_image", argv[0] ); diff --git a/tools/other/glds.c b/tools/other/glds.c index 814df4ff..cc7e4e85 100644 --- a/tools/other/glds.c +++ b/tools/other/glds.c @@ -41,6 +41,7 @@ #include #include +#include #include @@ -52,6 +53,8 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if (argc != 9) error_exit("Usage:\n\ diff --git a/tools/other/glds_features.c b/tools/other/glds_features.c index 07aff552..7859429e 100644 --- a/tools/other/glds_features.c +++ b/tools/other/glds_features.c @@ -41,6 +41,7 @@ #include #include +#include #include @@ -52,6 +53,8 @@ main( int argc, char *argv[] ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if( argc != 2 ) error_exit( "usage: %s matrix_image", argv[0] ); diff --git a/tools/other/simcontr.c b/tools/other/simcontr.c index a79a98a3..c3320ae4 100644 --- a/tools/other/simcontr.c +++ b/tools/other/simcontr.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -53,6 +54,8 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if (argc != 4) error_exit("Usage:\n%s file xsize ysize\n\n\ diff --git a/tools/other/sines.c b/tools/other/sines.c index 0612a99b..bd1056ea 100644 --- a/tools/other/sines.c +++ b/tools/other/sines.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -54,6 +55,8 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if (argc != 6) error_exit("Usage:\n%s file xsize ysize horfreq verfreq\n\n\ diff --git a/tools/other/spatres.c b/tools/other/spatres.c index c41b46a5..a6ed3e3e 100644 --- a/tools/other/spatres.c +++ b/tools/other/spatres.c @@ -44,6 +44,7 @@ #include #include +#include #include @@ -55,6 +56,8 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if ( (argc != 4)||(argv[1][0] == '-') ) error_exit( diff --git a/tools/other/squares.c b/tools/other/squares.c index 62c42f81..9865c0a8 100644 --- a/tools/other/squares.c +++ b/tools/other/squares.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -55,6 +56,8 @@ main( int argc, char **argv ) if( im_init_world( argv[0] ) ) error_exit( "unable to start VIPS" ); + textdomain( GETTEXT_PACKAGE ); + setlocale( LC_ALL, "" ); if (argc != 6) error_exit("Usage:\n%s file xsize ysize horfreq verfreq\n\n\