zsh-workers
 help / color / mirror / code / Atom feed
* Re: simple completion example? (aptitude completion doesn't work)
       [not found]           ` <20050805193652.GA6842@spiegl.de>
@ 2005-08-08  9:06             ` Oliver Kiddle
  2005-08-08 12:19               ` Mikael Magnusson
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2005-08-08  9:06 UTC (permalink / raw)
  To: zsh-workers; +Cc: Andy Spiegl

On 5 Aug, Andy Spiegl wrote:

> > If aptitude -h is giving you a German (or other) translation, try adding
> > LC_MESSAGES=C in but I don't think that translation would actually break
> > it in this particular case.
> YES, that was it!  Of course, why didn't I think of that!?

We seem to be getting a lot of these translation related problems. Could
do with someone finding the time to look through for any further
instances.

> But there isn't such a big difference...Hm, maybe Verwendung instead of usage?
> Can you think of a workaround for international users like me?

In general, the patch below adding LC_MESSAGES=C does the job.

It's very tempting to try to make the parsing work with the German
output so that people get translated descriptions. However, if the
formats aren't consistent it's probably only asking for trouble. And the
completion code probably wouldn't handle the umlauts too well either.

Oliver

Index: Completion/Debian/Command/_aptitude
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_aptitude,v
retrieving revision 1.3
diff -u -r1.3 _aptitude
--- Completion/Debian/Command/_aptitude	31 Mar 2005 13:39:18 -0000	1.3
+++ Completion/Debian/Command/_aptitude	8 Aug 2005 08:59:44 -0000
@@ -26,7 +26,7 @@
 
 case $state in
   cmds)
-    cmds=( ${${(M)${(f)"$(aptitude -h 2>/dev/null)"}:#* - *}/(#b) (*[^ ]) #- (*)/$match[1]:$match[2]:l})
+    cmds=( ${${(M)${(f)"$(LC_MESSAGES=C _call_program commands aptitude -h 2>/dev/null)"}:#* - *}/(#b) (*[^ ]) #- (*)/$match[1]:$match[2]:l})
 
     _describe -t commands 'aptitude command' cmds && ret=0
   ;;


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
  2005-08-08  9:06             ` simple completion example? (aptitude completion doesn't work) Oliver Kiddle
@ 2005-08-08 12:19               ` Mikael Magnusson
  2005-08-08 13:05                 ` Clint Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Magnusson @ 2005-08-08 12:19 UTC (permalink / raw)
  To: zsh-workers

On 8/8/05, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> On 5 Aug, Andy Spiegl wrote:
> 
> > > If aptitude -h is giving you a German (or other) translation, try adding
> > > LC_MESSAGES=C in but I don't think that translation would actually break
> > > it in this particular case.
> > YES, that was it!  Of course, why didn't I think of that!?
> 
> We seem to be getting a lot of these translation related problems. Could
> do with someone finding the time to look through for any further
> instances.
> 
> > But there isn't such a big difference...Hm, maybe Verwendung instead of usage?
> > Can you think of a workaround for international users like me?
> 
> In general, the patch below adding LC_MESSAGES=C does the job.
> 
> It's very tempting to try to make the parsing work with the German
> output so that people get translated descriptions. However, if the
> formats aren't consistent it's probably only asking for trouble. And the
> completion code probably wouldn't handle the umlauts too well either.
> 
> Oliver

Setting LC_MESSAGES when LC_ALL is already set won't have any effect
iirc, maybe you should also put LC_ALL="" there?

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
  2005-08-08 12:19               ` Mikael Magnusson
@ 2005-08-08 13:05                 ` Clint Adams
  2005-08-11 14:52                   ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2005-08-08 13:05 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh-workers

> Setting LC_MESSAGES when LC_ALL is already set won't have any effect
> iirc, maybe you should also put LC_ALL="" there?

If people are setting LC_ALL (which is meant to override everything),
shouldn't they be able to override everything?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
  2005-08-08 13:05                 ` Clint Adams
@ 2005-08-11 14:52                   ` Oliver Kiddle
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Kiddle @ 2005-08-11 14:52 UTC (permalink / raw)
  To: zsh-workers

On 8 Aug, Clint Adams wrote:
> If people are setting LC_ALL (which is meant to override everything),
> shouldn't they be able to override everything?

That's certainly arguable. However, it looks like it'll just lead to us
getting bug reports. And it seems that people just set a load of LC_
variables with little idea of which take precedence.

The _aptitude that I checked in now uses LC_ALL. I'm also applying the
following patch to _subversion which also fixes Debian bug #322573
(sorry about that one, my fault).

Oliver
 
Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.14
diff -u -r1.14 _subversion
--- Completion/Unix/Command/_subversion	8 Aug 2005 08:54:21 -0000	1.14
+++ Completion/Unix/Command/_subversion	11 Aug 2005 14:50:43 -0000
@@ -12,7 +12,7 @@
   if [[ -n $state ]] && (( ! $+_svn_cmds )); then
     typeset -gHA _svn_cmds
     _svn_cmds=(
-      ${=${(f)${${"$(LC_MESSAGES=C _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
+      ${=${(f)${${"$(LC_ALL=C _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
     )
   fi
 
@@ -28,9 +28,9 @@
       if (( $#cmd )); then
         curcontext="${curcontext%:*:*}:svn-${cmd}:"
 
-        usage=${${(M)${(f)"$(LC_MESSAGES=C _call_program options svn help $cmd)"}:#usage:*}#usage: $cmd] }
+        usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage: $cmd] }
         args=(
-          ${=${${${(M)${(f)"$(LC_MESSAGES=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"##*Valid options:}:#* :*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
 
         case $cmd in;
@@ -40,7 +40,7 @@
             )
           ;;
           commit)
-            args-+=(
+            args+=(
               '*:file:_files -g "*(e:_svn_status:)"'
             )
           ;;
@@ -101,7 +101,7 @@
   if [[ -n $state ]] && (( ! $+_svnadmin_cmds )); then
     typeset -gHA _svnadmin_cmds
     _svnadmin_cmds=(
-      ${=${(f)${${"$(LC_MESSAGES=C _call_program commands svnadmin help)"#l#*Available subcommands:}}}/(#s)[[:space:]]#(#b)([-a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
+      ${=${(f)${${"$(LC_ALL=C _call_program commands svnadmin help)"#l#*Available subcommands:}}}/(#s)[[:space:]]#(#b)([-a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
     )
   fi
 
@@ -116,9 +116,9 @@
       if (( $#cmd )); then
         curcontext="${curcontext%:*:*}:svnadmin-${cmd}:"
 
-        usage=${${(M)${(f)"$(LC_MESSAGES=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
+        usage=${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"}:#$cmd: usage:*}#$cmd: usage: svnadmin $cmd }
         args=(
-          ${=${${${(M)${(f)"$(LC_MESSAGES=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
+          ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
         )
         if [[ $_svnadmin_subcmd_usage == *REPOS_PATH* ]]; then
           args+=( ":path:_files -/" )


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-08-11 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20050802180158.GA10402@spiegl.de>
     [not found] ` <19401.1123058911@trentino.groupinfra.com>
     [not found]   ` <20050803101007.GA9755@spiegl.de>
     [not found]     ` <2356.1123064346@trentino.groupinfra.com>
     [not found]       ` <20050805154030.GA16800@spiegl.de>
     [not found]         ` <32449.1123262228@trentino.groupinfra.com>
     [not found]           ` <20050805193652.GA6842@spiegl.de>
2005-08-08  9:06             ` simple completion example? (aptitude completion doesn't work) Oliver Kiddle
2005-08-08 12:19               ` Mikael Magnusson
2005-08-08 13:05                 ` Clint Adams
2005-08-11 14:52                   ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).