diff options
author | axel <axel@liljencrantz.se> | 2006-01-04 22:51:02 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-01-04 22:51:02 +1000 |
commit | ec43c635cc65145dc4c36b4b284b86119534533e (patch) | |
tree | f563bf720ab28d1269a0be9805a3fef4dbd6e05d /builtin_commandline.c | |
parent | 26de6ba26b71f06c15ee7e8a54a7b52e0437047d (diff) |
Add i18n through gettext, as well as a Swedish translation
darcs-hash:20060104125102-ac50b-5bf026578a69bd94f7a7a3c8dee0ebccd95e5c24.gz
Diffstat (limited to 'builtin_commandline.c')
-rw-r--r-- | builtin_commandline.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/builtin_commandline.c b/builtin_commandline.c index e000eeb6..532c380c 100644 --- a/builtin_commandline.c +++ b/builtin_commandline.c @@ -22,6 +22,7 @@ Functions used for implementing the commandline builtin. #include "tokenizer.h" #include "input_common.h" #include "input.h" +#include "translate.h" /** Which part of the comandbuffer are we operating on @@ -260,13 +261,10 @@ int builtin_commandline( wchar_t **argv ) case 0: if(long_options[opt_index].flag != 0) break; - sb_append2( sb_err, - argv[0], - BUILTIN_ERR_UNKNOWN, - L" ", - long_options[opt_index].name, - L"\n", - (void *)0 ); + sb_printf( sb_err, + BUILTIN_ERR_UNKNOWN, + argv[0], + long_options[opt_index].name ); builtin_print_help( argv[0], sb_err ); return 1; @@ -322,10 +320,11 @@ int builtin_commandline( wchar_t **argv ) */ if( buffer_part || cut_at_cursor || append_mode || tokenize ) { + sb_printf(sb_err, + BUILTIN_ERR_COMBO, + argv[0] ); + sb_append2(sb_err, - argv[0], - BUILTIN_ERR_COMBO, - L"\n", parser_current_line(), L"\n", (void *)0); @@ -335,10 +334,11 @@ int builtin_commandline( wchar_t **argv ) if( argc == woptind ) { + sb_printf( sb_err, + BUILTIN_ERR_MISSING, + argv[0] ); + sb_append2( sb_err, - argv[0], - BUILTIN_ERR_MISSING, - L"\n", parser_current_line(), L"\n", (void *)0 ); @@ -394,22 +394,23 @@ int builtin_commandline( wchar_t **argv ) if( (tokenize || cut_at_cursor) && (argc-woptind) ) { - sb_append2( sb_err, - argv[0], - BUILTIN_ERR_COMBO, - L",\n --cut-at-cursor and --tokenize can not be used when setting the commandline", - (void *)0 ); + sb_printf( sb_err, + BUILTIN_ERR_COMBO2, + argv[0], + L"--cut-at-cursor and --tokenize can not be used when setting the commandline" ); + + builtin_print_help( argv[0], sb_err ); return 1; } if( append_mode && !(argc-woptind) ) { - sb_append2( sb_err, + sb_printf( sb_err, + BUILTIN_ERR_COMBO2, argv[0], - BUILTIN_ERR_COMBO, - L",\n insertion mode switches can not be used when not in insertion mode", - (void *)0 ); + L"insertion mode switches can not be used when not in insertion mode" ); + builtin_print_help( argv[0], sb_err ); return 1; } |