lp://qastaging/~zyga/command-not-found/rework-locale-support
- Get this branch:
- bzr branch lp://qastaging/~zyga/command-not-found/rework-locale-support
Branch merges
- Command Not Found Developers: Pending requested
-
Diff: 126 lines (+36/-38)3 files modifiedCommandNotFound/CommandNotFound.py (+2/-1)
CommandNotFound/util.py (+3/-33)
command-not-found (+31/-4)
Branch information
Recent revisions
- 140. By Zygmunt Krynicki
-
Rework locale support.
This patch fixes locale issues I have observed on my laptop while testing
unrelated patch. There are three changes that seem to make everything work:1) OptionParser is broken with regards to locale support. All the messages it
translates are converted to sys.getdefaultencoding( ) which seems to be 'ascii'.
This breaks our UTF-8 encoded strings so to work around that a simple subclass
is provided that uses locale.getpreferredenc oding() . This is much better as the
returned values depends on user's locale setting.2) Drop the set of hacky gettext/nogettext functions and use
gettext.translation( ).ugettext( ) everywhere. This makes all the c-n-f modules
work correctly and return translated unicode strings.3) In command-not-found executable call
gettext.translation( ).install( unicode= True) to provide fallback translations
for the entire runtime. Calling install() makes '_' available in the builtin
namespace which covers use cases in the executable itself (command-not-found)
as well as in arbitrary places that use _ to resolve translations elsewhere in
python.I have tested this on natty with several combinations of LANG=... settings,
including different encodings (.UTF-8, ISO8859-{1,2}) and it seems to work
every time. - 139. By Michael Vogt
-
merged lp:~julien-nicoulaud/command-not-found/fix-zsh-hook,
many thanks to Julien Nicoulaud (LP: #624565) - 133. By Michael Vogt
-
* automatically update the scan.data in the pre-build.sh hook
(thanks to Steve Langasek for this suggestion)
* updated to oneiric
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)