Updating translations for SVN trunk

Andreas Hanke andreas.hanke at gmx-topmail.de
Mon Oct 23 05:26:38 PDT 2006


Hi,

Mauricio Teixeira (netmask) schrieb:
> Here it works, and I get no errors or warnings.

Maybe the gettext version is the culprit. I experienced this failure
using gettext-0.15. Are you using gettext-0.14.5?

I found the following in the gettext changelog for 0.15:

"Python:
xgettext now recognizes the source encoding from a "coding:" comment
among the first two lines. The default encoding is now ASCII."

So it seems that xgettext from the new gettext version wants to be
informed about smart/channels/urpmi.py not being ASCII.

> You can see that line 148 is an UTF-8 encoded string.

Yes, it is.

> Maybe it's something with your locale settings (sorry, not a gettext
> expert).

LANG=en_US.UTF-8 (and this should really be generic enough to assume
that it's OK).

Some thoughts:

- smart/channels/urpmi.py does not advertise its encoding using a coding
comment

- xgettext accepts the encoding to assume as a command-line parameter

Each of the following changes fixes the issue for me:



~~~~~~~~~~
--- smart/channels/urpmi.py
+++ smart/channels/urpmi.py
@@ -1,4 +1,4 @@
-#
+# -*- coding: utf-8 -*-
 # Copyright (c) 2005 Canonical
 # Copyright (c) 2004 Conectiva, Inc.
 #
~~~~~~~~~~



~~~~~~~~~~
--- Makefile
+++ Makefile
@@ -24,7 +24,7 @@
        $(PYTHON) setup.py bdist_rpm

 smart.pot:
-       xgettext -o locale/smart.pot `find -name '*.c' -o -name '*.py'`
+       xgettext -o locale/smart.pot --from-code=utf-8 `find -name '*.c'
-o -name '*.py'`

 update-po: smart.pot
        for po in locale/*/LC_MESSAGES/smart.po; do \
~~~~~~~~~~



I can't decide which variant is better.

I'll just do this locally for now to get a smart.pot to work on, maybe
someone with more gettext knowledge can give better hints about this
(and a solution that works across multiple gettext versions).

Andreas



More information about the Smart mailing list