Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: simple completion example? (aptitude completion doesn't work)

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

> 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.


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=( ${${(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.

Messages sorted by: Reverse Date, Date, Thread, Author