Translate most shellscript output, translate internal completion descriptions, and several translation bugfixes

darcs-hash:20060105134159-ac50b-0a7805971e079dd1a511c6bca227db4504902ef0.gz
This commit is contained in:
axel
2006-01-05 23:41:59 +10:00
parent 48030576e4
commit e12902fe3c
9 changed files with 340 additions and 107 deletions

View File

@@ -229,9 +229,10 @@ doc.h:$(BUILTIN_DOC_SRC) $(CMD_DOC_SRC) doc_src/doc.hdr
fi fi
# Create a template translation object # Create a template translation object
messages.pot: *.c *.h messages.pot: *.c *.h init/*.in init/*.fish
if test $(HAVE_GETTEXT) = 1;then \ if test $(HAVE_GETTEXT) = 1;then \
xgettext -k_ -kN_ --no-wrap *.c *.h -o messages.pot; \ xgettext -k_ -kN_ -kcomplete_desc --no-wrap *.c *.h -o messages.pot; \
xgettext -j -k_ -LShell --no-wrap init/*.in init/*.fish -o messages.pot; \
fi fi
# Generate the internal help functions by making doxygen create # Generate the internal help functions by making doxygen create

View File

@@ -49,63 +49,63 @@
/** /**
Description for ~USER completion Description for ~USER completion
*/ */
#define COMPLETE_USER_DESC COMPLETE_SEP_STR L"User home" #define COMPLETE_USER_DESC _( L"User home" )
/** /**
Description for short variables. The value is concatenated to this description Description for short variables. The value is concatenated to this description
*/ */
#define COMPLETE_VAR_DESC_VAL COMPLETE_SEP_STR L"Variable: " #define COMPLETE_VAR_DESC_VAL _( L"Variable: " )
/** /**
Description for generic executable Description for generic executable
*/ */
#define COMPLETE_EXEC_DESC COMPLETE_SEP_STR L"Executable" #define COMPLETE_EXEC_DESC _( L"Executable" )
/** /**
Description for link to executable Description for link to executable
*/ */
#define COMPLETE_EXEC_LINK_DESC COMPLETE_SEP_STR L"Executable link" #define COMPLETE_EXEC_LINK_DESC _( L"Executable link" )
/** /**
Description for regular file Description for regular file
*/ */
#define COMPLETE_FILE_DESC COMPLETE_SEP_STR L"File" #define COMPLETE_FILE_DESC _( L"File" )
/** /**
Description for character device Description for character device
*/ */
#define COMPLETE_CHAR_DESC COMPLETE_SEP_STR L"Character device" #define COMPLETE_CHAR_DESC _( L"Character device" )
/** /**
Description for block device Description for block device
*/ */
#define COMPLETE_BLOCK_DESC COMPLETE_SEP_STR L"Block device" #define COMPLETE_BLOCK_DESC _( L"Block device" )
/** /**
Description for fifo buffer Description for fifo buffer
*/ */
#define COMPLETE_FIFO_DESC COMPLETE_SEP_STR L"Fifo" #define COMPLETE_FIFO_DESC _( L"Fifo" )
/** /**
Description for symlink Description for symlink
*/ */
#define COMPLETE_SYMLINK_DESC COMPLETE_SEP_STR L"Symbolic link" #define COMPLETE_SYMLINK_DESC _( L"Symbolic link" )
/** /**
Description for Rotten symlink Description for Rotten symlink
*/ */
#define COMPLETE_ROTTEN_SYMLINK_DESC COMPLETE_SEP_STR L"Rotten symbolic link" #define COMPLETE_ROTTEN_SYMLINK_DESC _( L"Rotten symbolic link" )
/** /**
Description for socket Description for socket
*/ */
#define COMPLETE_SOCKET_DESC COMPLETE_SEP_STR L"Socket" #define COMPLETE_SOCKET_DESC _( L"Socket" )
/** /**
Description for directory Description for directory
*/ */
#define COMPLETE_DIRECTORY_DESC COMPLETE_SEP_STR L"Directory" #define COMPLETE_DIRECTORY_DESC _( L"Directory" )
/** /**
Description for function Description for function
*/ */
#define COMPLETE_FUNCTION_DESC COMPLETE_SEP_STR L"Function" #define COMPLETE_FUNCTION_DESC _( L"Function" )
/** /**
Description for builtin command Description for builtin command
*/ */
#define COMPLETE_BUILTIN_DESC COMPLETE_SEP_STR L"Builtin" #define COMPLETE_BUILTIN_DESC _( L"Builtin" )
/** /**
The command to run to get a description from a file suffix The command to run to get a description from a file suffix
@@ -205,6 +205,9 @@ static hash_table_t *condition_cache=0;
*/ */
static hash_table_t *loaded_completions=0; static hash_table_t *loaded_completions=0;
static string_buffer_t *get_desc_buff=0;
void complete_init() void complete_init()
{ {
} }
@@ -425,9 +428,7 @@ void complete_add( const wchar_t *cmd,
if( desc && wcslen( desc ) ) if( desc && wcslen( desc ) )
{ {
tmp = wcsdupcat( COMPLETE_SEP_STR, desc ); opt->desc = intern( desc );
opt->desc = intern( tmp );
free( tmp );
} }
else else
opt->desc = L""; opt->desc = L"";
@@ -846,15 +847,15 @@ static const wchar_t *complete_get_desc_suffix( const wchar_t *suff_orig )
if( al_get_count( &l )>0 ) if( al_get_count( &l )>0 )
{ {
wchar_t *ln = (wchar_t *)al_get(&l, 0 ); wchar_t *ln = (wchar_t *)al_get(&l, 0 );
if( wcscmp( ln, _(L"unknown") ) != 0 ) if( wcscmp( ln, L"unknown" ) != 0 )
{ {
desc = wcsdupcat( COMPLETE_SEP_STR, ln); desc = wcsdup( ln);
/* /*
I have decided I prefer to have the description I have decided I prefer to have the description
begin in uppercase and the whole universe will just begin in uppercase and the whole universe will just
have to accept it. Hah! have to accept it. Hah!
*/ */
desc[1]=towupper(desc[1]); desc[0]=towupper(desc[0]);
} }
} }
@@ -881,43 +882,48 @@ static const wchar_t *complete_get_desc_suffix( const wchar_t *suff_orig )
const wchar_t *complete_get_desc( const wchar_t *filename ) const wchar_t *complete_get_desc( const wchar_t *filename )
{ {
struct stat buf; struct stat buf;
const wchar_t *desc = COMPLETE_FILE_DESC; // const wchar_t *desc = COMPLETE_FILE_DESC;
if( !get_desc_buff )
{
get_desc_buff = malloc(sizeof(string_buffer_t) );
sb_init( get_desc_buff );
}
else
{
sb_clear( get_desc_buff );
}
if( lwstat( filename, &buf )==0) if( lwstat( filename, &buf )==0)
{ {
if( waccess( filename, X_OK ) == 0 )
{
desc = COMPLETE_EXEC_DESC;
}
if( S_ISCHR(buf.st_mode) ) if( S_ISCHR(buf.st_mode) )
desc= COMPLETE_CHAR_DESC; {
sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_CHAR_DESC );
}
else if( S_ISBLK(buf.st_mode) ) else if( S_ISBLK(buf.st_mode) )
desc = COMPLETE_BLOCK_DESC; sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_BLOCK_DESC );
else if( S_ISFIFO(buf.st_mode) ) else if( S_ISFIFO(buf.st_mode) )
desc = COMPLETE_FIFO_DESC; sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_FIFO_DESC );
else if( S_ISLNK(buf.st_mode)) else if( S_ISLNK(buf.st_mode))
{ {
struct stat buf2; struct stat buf2;
desc = COMPLETE_SYMLINK_DESC;
if( waccess( filename, X_OK ) == 0 )
desc = COMPLETE_EXEC_LINK_DESC;
if( wstat( filename, &buf2 ) == 0 ) if( wstat( filename, &buf2 ) == 0 )
{ {
if( S_ISDIR(buf2.st_mode) ) if( S_ISDIR(buf2.st_mode) )
{ {
desc = L"/" COMPLETE_SYMLINK_DESC; sb_printf( get_desc_buff, L"/%lc%ls", COMPLETE_SEP, COMPLETE_SYMLINK_DESC );
} }
else if( waccess( filename, X_OK ) == 0 )
sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_EXEC_LINK_DESC );
else
sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_SYMLINK_DESC );
} }
else else
{ {
switch( errno ) switch( errno )
{ {
case ENOENT: case ENOENT:
desc = COMPLETE_ROTTEN_SYMLINK_DESC; sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_ROTTEN_SYMLINK_DESC );
break; break;
case EACCES: case EACCES:
@@ -928,11 +934,17 @@ const wchar_t *complete_get_desc( const wchar_t *filename )
break; break;
} }
} }
} }
else if( S_ISSOCK(buf.st_mode)) else if( S_ISSOCK(buf.st_mode))
desc= COMPLETE_SOCKET_DESC; sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_SOCKET_DESC );
else if( S_ISDIR(buf.st_mode) ) else if( S_ISDIR(buf.st_mode) )
desc= L"/" COMPLETE_DIRECTORY_DESC; sb_printf( get_desc_buff, L"/%lc%ls", COMPLETE_SEP, COMPLETE_DIRECTORY_DESC );
else if( waccess( filename, X_OK ) == 0 )
{
sb_printf( get_desc_buff, L"%lc%ls", COMPLETE_SEP, COMPLETE_EXEC_DESC );
}
} }
/* else /* else
{ {
@@ -949,19 +961,27 @@ const wchar_t *complete_get_desc( const wchar_t *filename )
} }
} }
*/ */
if( desc == COMPLETE_FILE_DESC ) if( wcslen((wchar_t *)get_desc_buff->buff) == 0 )
{ {
wchar_t *suffix = wcsrchr( filename, L'.' ); wchar_t *suffix = wcsrchr( filename, L'.' );
if( suffix != 0 ) if( suffix != 0 )
{ {
if( !wcsrchr( suffix, L'/' ) ) if( !wcsrchr( suffix, L'/' ) )
{ {
desc = complete_get_desc_suffix( suffix ); sb_printf( get_desc_buff,
L"%lc%ls",
COMPLETE_SEP,
complete_get_desc_suffix( suffix ) );
} }
} }
else
sb_printf( get_desc_buff,
L"%lc%ls",
COMPLETE_SEP,
COMPLETE_FILE_DESC );
} }
return desc; return (wchar_t *)get_desc_buff->buff;
} }
/** /**
@@ -1007,6 +1027,7 @@ static void copy_strings_with_prefix( array_list_t *comp_out,
wildcard_complete( next_str, wc, desc, desc_func, comp_out ); wildcard_complete( next_str, wc, desc, desc_func, comp_out );
} }
free( wc ); free( wc );
} }
@@ -1303,7 +1324,7 @@ static void complete_cmd( const wchar_t *cmd,
{ {
wchar_t *nxt = (wchar_t *)al_get( &tmp, i ); wchar_t *nxt = (wchar_t *)al_get( &tmp, i );
wchar_t *desc = wcsrchr( nxt, COMPLETE_SEP ); wchar_t *desc = wcsrchr( nxt, COMPLETE_SEP )+1;
int is_valid = (desc && (wcscmp(desc, int is_valid = (desc && (wcscmp(desc,
COMPLETE_DIRECTORY_DESC)==0)); COMPLETE_DIRECTORY_DESC)==0));
if( is_valid ) if( is_valid )
@@ -1810,7 +1831,7 @@ static int complete_variable( const wchar_t *var,
/* /*
Variable description is 'Variable: VALUE Variable description is 'Variable: VALUE
*/ */
blarg = wcsdupcat2( &name[varlen], COMPLETE_VAR_DESC_VAL, value, 0 ); blarg = wcsdupcat2( &name[varlen], COMPLETE_SEP_STR, COMPLETE_VAR_DESC_VAL, value, 0 );
if( blarg ) if( blarg )
{ {
@@ -1937,6 +1958,7 @@ static int try_complete_user( const wchar_t *cmd,
{ {
wchar_t *blarg = wcsdupcat2( &pw_name[name_len], wchar_t *blarg = wcsdupcat2( &pw_name[name_len],
L"/", L"/",
COMPLETE_SEP_STR,
COMPLETE_USER_DESC, COMPLETE_USER_DESC,
0 ); 0 );
if( blarg != 0 ) if( blarg != 0 )

View File

@@ -422,9 +422,10 @@ static void printed_length( wchar_t *str,
case L'^': case L'^':
case L'<': case L'<':
case L'>': case L'>':
case L'@':
case L'(': case L'(':
case L')': case L')':
case L'[':
case L']':
case L'{': case L'{':
case L'}': case L'}':
case L'?': case L'?':
@@ -432,6 +433,11 @@ static void printed_length( wchar_t *str,
case L'|': case L'|':
case L';': case L';':
case L':': case L':':
case L'\'':
case L'"':
case L'%':
case L'~':
if( has_description ) if( has_description )
desc_len++; desc_len++;
else else

View File

@@ -65,7 +65,7 @@ end
function __fish_complete_directory -d "Complete using directories" function __fish_complete_directory -d "Complete using directories"
set -- comp $argv[1] set -- comp $argv[1]
set -- desc Directory set -- desc (_ Directory)
if test (count $argv) -gt 1 if test (count $argv) -gt 1
set desc $argv[2] set desc $argv[2]
@@ -176,11 +176,14 @@ end
# Completions for the shell and it's builtin commands and functions # Completions for the shell and it's builtin commands and functions
# #
set -l __fish_help_desc (_ "Display help and exit")
for i in (builtin -n|grep -vE '(while|for|if|function|switch)' ) for i in (builtin -n|grep -vE '(while|for|if|function|switch)' )
complete -c $i -s h -l help -d "Display help and exit"
complete -c $i -s h -l help -d $__fish_help_desc
end end
function __fish_print_packages function __fish_print_packages
# apt-cache is much, much faster than rpm, and can do this in real # apt-cache is much, much faster than rpm, and can do this in real
@@ -191,13 +194,16 @@ function __fish_print_packages
return return
end end
#Get the word 'Package' in the current language
set -l package (_ Package)
if which apt-cache >/dev/null ^/dev/null if which apt-cache >/dev/null ^/dev/null
# Apply the following filters to output of apt-cache: # Apply the following filters to output of apt-cache:
# 1) Remove package names with parentesis in them, since these seem to not correspond to actual packages as reported by rpm # 1) Remove package names with parentesis in them, since these seem to not correspond to actual packages as reported by rpm
# 2) Remove package names that are .so files, since these seem to not correspond to actual packages as reported by rpm # 2) Remove package names that are .so files, since these seem to not correspond to actual packages as reported by rpm
# 3) Remove path information such as /usr/bin/, as rpm packages do not have paths # 3) Remove path information such as /usr/bin/, as rpm packages do not have paths
apt-cache --no-generate pkgnames (commandline -tc)|grep -v \( |grep -v '\.so\(\.[0-9]\)*$'|sed -e 's/\/.*\///'|sed -e 's/$/\tPackage/' apt-cache --no-generate pkgnames (commandline -tc)|grep -v \( |grep -v '\.so\(\.[0-9]\)*$'|sed -e 's/\/.*\///'|sed -e 's/$/\t'$package'/'
return return
end end
@@ -219,7 +225,7 @@ function __fish_print_packages
end end
# Remove package version information from output and pipe into cache file # Remove package version information from output and pipe into cache file
rpm -qa >$cache_file |sed -e 's/-[^-]*-[^-]*$//' | sed -e 's/$/\tPackage/' & rpm -qa >$cache_file |sed -e 's/-[^-]*-[^-]*$//' | sed -e 's/$/\t'$package'/' &
end end
end end
@@ -235,12 +241,9 @@ end
# Completions for SysV startup scripts # Completions for SysV startup scripts
# #
set -g __fish_service_commands ' complete -x -p "/etc/init.d/*" -a start\t(_ 'Start service')
start\t"Start service" complete -x -p "/etc/init.d/*" -a stop\t(_ 'Stop service')
stop\t"Stop service" complete -x -p "/etc/init.d/*" -a status\t(_ 'Print service status')
status\t"Print service status" complete -x -p "/etc/init.d/*" -a restart\t(_ 'Stop and then start service')
restart\t"Stop and then start service" complete -x -p "/etc/init.d/*" -a reload\t(_ 'Reload service configuration')
reload\t"Reload service configuration"
'
complete -x -p "/etc/init.d/*" -a '$__fish_service_commands'

View File

@@ -55,7 +55,7 @@ function contains -d "Test if a key is contained in a set of values"
end end
if not set -q argv if not set -q argv
echo "contains: Key not specified" printf (_ "%s: Key not specified\n") contains
return 1 return 1
end end
@@ -127,8 +127,8 @@ function help -d "Show help for the fish shell"
end end
if test -z $fish_browser if test -z $fish_browser
printf "help: Could not find a web browser.\n" printf (_ '%s: Could not find a web browser.\n') help
printf "Please set the variable $BROWSER to a suitable browser and try again\n\n" printf (_ 'Please set the variable $BROWSER to a suitable browser and try again\n\n')
return 1 return 1
end end
@@ -270,20 +270,11 @@ function vared -d "Edit variable value"
else else
printf "vared: %s is an array variable. Use " $argv printf (_ 'vared: %s is an array variable. Use %svared%s %s[n] to edit the n:th element of %s\n') $argv (set_color $fish_color_command) (set_color $fish_color_normal) $argv $argv
set_color $fish_color_command
printf vared
set_color $fish_color_normal
printf " %s[n] to edit the n:th element of %s\n" $argv $argv
end end
end end
else else
printf "vared: Expected exactly one argument, got %s.\n\nSynopsis:\n\t" (count $argv) printf (_ 'vared: Expected exactly one argument, got %s.\n\nSynopsis:\n\t%svared%s VARIABLE\n') (count $argv) (set_color $fish_color_command) (set_color $fish_color_normal)
set_color $fish_color_command
printf vared
set_color $fish_color_normal
printf " VARIABLE\n"
end end
end end
@@ -392,7 +383,7 @@ function __fish_move_last -d "Move the last element of a directory history from
if test $size_src = 0 if test $size_src = 0
# Cannot make this step # Cannot make this step
echo "Hit end of history..." printf (_ "Hit end of history...\n")
return 1 return 1
end end
@@ -428,7 +419,7 @@ function prevd -d "Move back in the directory history"
if test $argv[$i] -ge 0 ^/dev/null if test $argv[$i] -ge 0 ^/dev/null
set times $argv[$i] set times $argv[$i]
else else
echo "The number of positions to skip must be a non-negative integer" printf (_ "The number of positions to skip must be a non-negative integer\n")
return 1 return 1
end end
continue continue
@@ -781,11 +772,11 @@ function type -d "Print the type of a command"
set found 1 set found 1
switch $mode switch $mode
case normal case normal
echo $i is a function with definition printf (_ '%s is a function with definition\n') $i
functions $i functions $i
case type case type
echo function printf (_ function)
case path case path
echo echo
@@ -801,10 +792,10 @@ function type -d "Print the type of a command"
set found 1 set found 1
switch $mode switch $mode
case normal case normal
echo $i is a builtin printf (_ '%s is a builtin\n') $i
case type case type
echo builtin printf (_ 'builtin\n')
case path case path
echo echo
@@ -821,10 +812,10 @@ function type -d "Print the type of a command"
set found 1 set found 1
switch $mode switch $mode
case normal case normal
echo $i is (which $i) printf (_ '%s is %s\n') $i (which $i)
case type case type
echo file printf (_ file)
case path case path
which $i which $i
@@ -835,7 +826,7 @@ function type -d "Print the type of a command"
end end
if test $found = 0 if test $found = 0
echo type: $i: not found printf (_ "%s: Could not find '%s'") type $i
end end
end end
@@ -851,7 +842,7 @@ function __fish_umask_parse -d "Parses a file permission specification as into a
else else
# Test if argument really is a valid symbolic mask # Test if argument really is a valid symbolic mask
if not echo $argv | grep -E '^(((u|g|o|a|)(=|\+|-)|)(r|w|x)*)(,(((u|g|o|a|)(=|\+|-)|)(r|w|x)*))*$' >/dev/null if not echo $argv | grep -E '^(((u|g|o|a|)(=|\+|-)|)(r|w|x)*)(,(((u|g|o|a|)(=|\+|-)|)(r|w|x)*))*$' >/dev/null
echo umask: Invalid mask $argv >&2 printf (_ "%s: Invalid mask '%s'\n") umask $argv >&2
return 1 return 1
end end
@@ -1038,7 +1029,7 @@ function umask -d "Set default file permission mask"
end end
case '*' case '*'
echo umask: Too may arguments >&2 printf (_ '%s: Too many arguments\n') umask >&2
end end
@@ -1058,7 +1049,7 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
return 0 return 0
case '*' case '*'
echo psub: Unknown argument $argv[1] printf (_ "%s: Unknown argument '%s'\n") psub $argv[1]
return 1 return 1
end end
end end

View File

@@ -6,26 +6,30 @@ if not status --is-interactive
exit exit
end end
function _ -d "Alias for the gettext command"
gettext fish $argv
end
# #
# Print a greeting # Print a greeting
# #
printf 'Welcome to fish, the friendly interactive shell\n' printf (_ 'Welcome to fish, the friendly interactive shell\n')
printf 'Type %shelp%s for instructions on how to use fish\n' (set_color green) (set_color normal) printf (_ 'Type %shelp%s for instructions on how to use fish\n') (set_color green) (set_color normal)
# #
# Set exit message # Set exit message
# #
function fish_on_exit -d "Commands to execute when fish exits" --on-process %self function fish_on_exit -d (_ "Commands to execute when fish exits") --on-process %self
echo Good bye printf (_ "Good bye\n")
end end
# Set the default prompt command. Make sure that every terminal escape # Set the default prompt command. Make sure that every terminal escape
# string has a newline before and after, so that fish will know how # string has a newline before and after, so that fish will know how
# long it is. # long it is.
function fish_prompt -d "Write out the prompt" function fish_prompt -d (_ "Write out the prompt")
printf '%s@%s %s%s%s> \n' (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) printf '%s@%s %s%s%s> \n' (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end end

205
po/sv.po
View File

@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: fish 1.20.0\n" "Project-Id-Version: fish 1.20.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-01-04 15:14+0100\n" "POT-Creation-Date: 2006-01-05 14:39+0100\n"
"Last-Translator: Axel Liljencrantz <liljencrantz@gmail.com>\n" "Last-Translator: Axel Liljencrantz <liljencrantz@gmail.com>\n"
"Language-Team: Swedish <sv@li.org>\n" "Language-Team: Swedish <sv@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -414,12 +414,12 @@ msgid "Set or get the shells resurce usage limits"
msgstr "Visa eller redigera skalets resursanvändningsgränser" msgstr "Visa eller redigera skalets resursanvändningsgränser"
#: builtin_set.c:96 #: builtin_set.c:96
#, fuzzy, c-format #, c-format
msgid "%ls: Invalid index starting at '%ls'\n" msgid "%ls: Invalid index starting at '%ls'\n"
msgstr "%ls: Ogiltigt index vid '%ls'" msgstr "%ls: Ogiltigt index vid '%ls'\n"
#: builtin_set.c:488 #: builtin_set.c:488
#, fuzzy, c-format #, c-format
msgid "" msgid ""
"%ls: Erase needs a variable name\n" "%ls: Erase needs a variable name\n"
"%ls\n" "%ls\n"
@@ -428,7 +428,7 @@ msgstr ""
"%ls\n" "%ls\n"
#: builtin_set.c:525 #: builtin_set.c:525
#, fuzzy, c-format #, c-format
msgid "" msgid ""
"%ls: Values cannot be specfied with erase\n" "%ls: Values cannot be specfied with erase\n"
"%ls\n" "%ls\n"
@@ -436,18 +436,70 @@ msgstr ""
"%ls: Värden kan inte specificeras vid radering\n" "%ls: Värden kan inte specificeras vid radering\n"
"%ls\n" "%ls\n"
#: complete.c:750 complete.c:769 #: complete.c:52
msgid "User home"
msgstr "Hemkatalog"
#: complete.c:57
msgid "Variable: "
msgstr "Variabel: "
#: complete.c:62
msgid "Executable"
msgstr "Program"
#: complete.c:66
msgid "Executable link"
msgstr "Länk till program"
#: complete.c:71
msgid "File"
msgstr "Fil"
#: complete.c:75
msgid "Character device"
msgstr "Teckenenhet"
#: complete.c:79
msgid "Block device"
msgstr "Blockenhet"
#: complete.c:83
msgid "Fifo"
msgstr "Fifo"
#: complete.c:87
msgid "Symbolic link"
msgstr "Symbolisk länk"
#: complete.c:91
msgid "Rotten symbolic link"
msgstr "Rutten symbolisk länk"
#: complete.c:95
msgid "Socket"
msgstr "Uttag (socket)"
#: complete.c:99 init/fish_complete.fish.in:68 init/fish_complete.fish:68
msgid "Directory"
msgstr "Katalog"
#: complete.c:104
msgid "Function"
msgstr "Funktion"
#: complete.c:108
msgid "Builtin"
msgstr "Inbyggt kommando"
#: complete.c:751 complete.c:770
msgid "Unknown option: " msgid "Unknown option: "
msgstr "Okänt argument: " msgstr "Okänt argument: "
#: complete.c:774 #: complete.c:775
msgid "Multiple matches for option: " msgid "Multiple matches for option: "
msgstr "Mer än ett argument passar: " msgstr "Mer än ett argument passar: "
#: complete.c:849 wildcard.c:276
msgid "unknown"
msgstr "okänd"
#: env.c:194 #: env.c:194
msgid "Could not get user information" msgid "Could not get user information"
msgstr "Kunde inte hitta information om användare" msgstr "Kunde inte hitta information om användare"
@@ -574,7 +626,7 @@ msgid "Unable to parse binding"
msgstr "Kunde inte tolka tangentbordsgenväg" msgstr "Kunde inte tolka tangentbordsgenväg"
#: input.c:1041 #: input.c:1041
#, fuzzy, c-format #, c-format
msgid "I don't know what %ls means" msgid "I don't know what %ls means"
msgstr "Vet inte vad '%ls' betyder" msgstr "Vet inte vad '%ls' betyder"
@@ -1087,6 +1139,10 @@ msgstr "Kör jobb i bakgrunden"
msgid "Comment" msgid "Comment"
msgstr "Kommentar" msgstr "Kommentar"
#: wildcard.c:276
msgid "unknown"
msgstr "okänd"
#: wildcard.c:280 #: wildcard.c:280
msgid "empty" msgid "empty"
msgstr "tom" msgstr "tom"
@@ -1141,3 +1197,128 @@ msgstr "%ls: Variabelnamn får inte vara tomma\n"
#: exec.h:19 #: exec.h:19
msgid "An error occurred while setting up pipe" msgid "An error occurred while setting up pipe"
msgstr "Ett fel inträffade under skapandet av en pipa" msgstr "Ett fel inträffade under skapandet av en pipa"
#: init/fish_complete.fish.in:179 init/fish_complete.fish:179
msgid "Display help and exit"
msgstr "Visa hjälp och avsluta"
#: init/fish_complete.fish.in:198 init/fish_complete.fish:198
msgid "Package"
msgstr "Paket"
#: init/fish_complete.fish.in:244 init/fish_complete.fish:244
msgid "Start service"
msgstr "Starta tjänst"
#: init/fish_complete.fish.in:245 init/fish_complete.fish:245
msgid "Stop service"
msgstr "Stanna tjänst"
#: init/fish_complete.fish.in:246 init/fish_complete.fish:246
msgid "Print service status"
msgstr "Visa status för tjänst"
#: init/fish_complete.fish.in:247 init/fish_complete.fish:247
msgid "Stop and then start service"
msgstr "Stanna och starta tjänst"
#: init/fish_complete.fish.in:248 init/fish_complete.fish:248
msgid "Reload service configuration"
msgstr "Ladda om konfiguration för tjänst"
#: init/fish_interactive.fish.in:9 init/fish_interactive.fish:9
msgid "-d"
msgstr ""
#: init/fish_interactive.fish.in:10 init/fish_interactive.fish:10
msgid "fish"
msgstr ""
#: init/fish_interactive.fish.in:17 init/fish_interactive.fish:17
msgid "Welcome to fish, the friendly interactive shell\\n"
msgstr "Välkommen till fish, det vänliga interaktiva skalet\\n"
#: init/fish_interactive.fish.in:18 init/fish_interactive.fish:18
msgid "Type %shelp%s for instructions on how to use fish\\n"
msgstr "Skriv %shelp%s för instruktioner om hur man använder fish\\n"
#: init/fish_interactive.fish.in:24 init/fish_interactive.fish:24
msgid "Commands to execute when fish exits"
msgstr "Kommandon som utförs när fish avslutas"
#: init/fish_interactive.fish.in:25 init/fish_interactive.fish:25
msgid "Good bye\\n"
msgstr "Hej då\\n"
#: init/fish_interactive.fish.in:32 init/fish_interactive.fish:32
msgid "Write out the prompt"
msgstr "Skriver ut prompten"
#: init/fish_function.fish:58
msgid "%s: Key not specified\\n"
msgstr "%s: Ingen nyckel specificerad"
#: init/fish_function.fish:130
msgid "%s: Could not find a web browser.\\n"
msgstr "%s: Kunde inte hitta en webbrowser\\n"
#: init/fish_function.fish:131
#, sh-format
msgid "Please set the variable $BROWSER to a suitable browser and try again\\n\\n"
msgstr "Var vänlig sätt variablen $BROWSER till en lämplig browser och försök igen\\n\\n"
#: init/fish_function.fish:273
msgid "vared: %s is an array variable. Use %svared%s %s[n] to edit the n:th element of %s\\n"
msgstr "vared: %s är en arrayvariabel. Använd %svared%s %s[n] för att redigera det n:te elementet av %s\\n"
#: init/fish_function.fish:277
msgid "vared: Expected exactly one argument, got %s.\\n\\nSynopsis:\\n\\t%svared%s VARIABLE\\n"
msgstr "vared: Förväntade exakt ett argument, fick %s\\n\\nSynopsis:\\n\\t%svared%s VARIABEL\\n"
#: init/fish_function.fish:386
msgid "Hit end of history...\\n"
msgstr "Inga fler kataloger..."
#: init/fish_function.fish:422
msgid "The number of positions to skip must be a non-negative integer\\n"
msgstr "Antalet positioner att hoppa över måste vara ett positivt heltal"
#: init/fish_function.fish:775
msgid "%s is a function with definition\\n"
msgstr "%s är en funktion med definitionen\\n"
#: init/fish_function.fish:779
msgid "function"
msgstr "funktion"
#: init/fish_function.fish:795
msgid "%s is a builtin\\n"
msgstr "%s är ett inbygggt kommando\\n"
#: init/fish_function.fish:798
msgid "builtin\\n"
msgstr "inbyggt kommando\\n"
#: init/fish_function.fish:815
msgid "%s is %s\\n"
msgstr "%s är %s\\n"
#: init/fish_function.fish:818
msgid "file"
msgstr "fil"
#: init/fish_function.fish:829
msgid "%s: Could not find '%s'"
msgstr "%s: Kunde inte hitta '%s'"
#: init/fish_function.fish:845
msgid "%s: Invalid mask '%s'\\n"
msgstr "%s: Ogiltigt mask '%s'\\n"
#: init/fish_function.fish:1032
msgid "%s: Too many arguments\\n"
msgstr "%s: För många argument\\n"
#: init/fish_function.fish:1052
msgid "%s: Unknown argument '%s'\\n"
msgstr "%s: Okänt argument '%s'\\n"

View File

@@ -20,13 +20,36 @@ Translation library, internally uses catgets
static string_buffer_t buff[BUFF_COUNT]; static string_buffer_t buff[BUFF_COUNT];
static int curr_buff=0; static int curr_buff=0;
static char *wcs2str_buff=0;
static size_t wcs2str_buff_count=0;
char *translate_wcs2str( const wchar_t *in )
{
size_t len = MAX_UTF8_BYTES*wcslen(in)+1;
if( len > wcs2str_buff_count )
{
wcs2str_buff = realloc( wcs2str_buff, len );
if( wcs2str_buff == 0 )
{
die_mem();
}
}
wcstombs( wcs2str_buff,
in,
MAX_UTF8_BYTES*wcslen(in)+1 );
return wcs2str_buff;
}
const wchar_t *wgettext( const wchar_t *in ) const wchar_t *wgettext( const wchar_t *in )
{ {
char *mbs_in = wcs2str( in ); char *mbs_in = translate_wcs2str( in );
char *out = gettext( mbs_in ); char *out = gettext( mbs_in );
wchar_t *wres=0; wchar_t *wres=0;
sb_clear( &buff[curr_buff] ); sb_clear( &buff[curr_buff] );
sb_printf( &buff[curr_buff], L"%s", out ); sb_printf( &buff[curr_buff], L"%s", out );
wres = (wchar_t *)buff[curr_buff].buff; wres = (wchar_t *)buff[curr_buff].buff;
curr_buff = (curr_buff+1)%BUFF_COUNT; curr_buff = (curr_buff+1)%BUFF_COUNT;
@@ -58,6 +81,8 @@ void translate_destroy()
for(i=0; i<BUFF_COUNT; i++ ) for(i=0; i<BUFF_COUNT; i++ )
sb_destroy( &buff[i] ); sb_destroy( &buff[i] );
free( wcs2str_buff );
} }
#else #else

View File

@@ -155,15 +155,15 @@ static int wildcard_complete_internal( const wchar_t *orig,
/* /*
A descripton generating function is specified, use it A descripton generating function is specified, use it
*/ */
new = wcsdupcat2( str, COMPLETE_SEP_STR, desc_func( orig ), 0); new = wcsdupcat2( str, COMPLETE_SEP_STR, desc_func( orig ), (void *)0);
} }
else else
{ {
/* /*
Append generic description to item, if the description exists Append generic description to item, if the description exists
*/ */
if( desc && wcslen(desc)>1 ) if( desc && wcslen(desc) )
new = wcsdupcat( str, desc ); new = wcsdupcat2( str, COMPLETE_SEP_STR, desc, (void *)0 );
else else
new = wcsdup( str ); new = wcsdup( str );
} }