Bug 854226 - Ambiguous meaning of string marked for translation
Ambiguous meaning of string marked for translation
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
All All
unspecified Severity unspecified
: ---
: ---
Assigned To: David Shea
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-09-04 08:53 EDT by Göran Uddeborg
Modified: 2013-09-21 16:05 EDT (History)
4 users (show)

See Also:
Fixed In Version: anaconda-20.18-1.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-21 16:05:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Göran Uddeborg 2012-09-04 08:53:48 EDT
Description of problem:
When translating anaconda/master for F18, I came across this string:

#: pyanaconda/ui/tui/hubs/__init__.py:104
#: pyanaconda/ui/tui/simpleline/base.py:301
msgid "c"
msgstr ""

Taking a look in the gitweb, it seems this is used as a short command.  In the __init__.py file it means "close", and in base.py it means "continue".

However, the Swedish translations of these two words don't start with the same letter.  So there isn't really any sensible way to translate this string to Swedish.  To get it right, the two cases need to be separated.  Something like the pgettext() functionality in C.
Comment 1 Martin Sivák 2012-10-17 08:22:35 EDT
This might be a bit harder to do.. python for some reason does not export pgettext method (there is an upstream bug about it - http://bugs.python.org/issue2504).

The workaround with \0x04 might work, but I am not sure how to "package" it so the automatic gettext tools pick it up properly.
Comment 2 Göran Uddeborg 2012-10-17 10:01:45 EDT
Maybe the reason it isn't already available in Python is that it is implemented as a C macro, not as a real function.  It's just a guess, I don't know.  See /usr/share/gettext/gettext.h for details on how it is implemented.  Doing a similar function in pure Python would be pretty straightforward, I believe.  But as you say, it isn't there now, so you would have to add it yourself.

As for extraction, are you running the command line gettext tool directly when you build anaconda?  If so, I think all you need to do is to add a flag like


to the invocation, gettext will look for a function pgettext.  It is default in C, but can be added this way to any other language.  (You may of course call the function anything you want, since you will have to add it.)
Comment 3 David Shea 2013-09-13 15:34:16 EDT
Adding gettext context support would really not be straightforward, given that we'd be working against the current context-unaware gettext support in python, but I don't think we actually need it. Both 'c's stand for "continue", at least in the latest anaconda. I added some translator comments to all of the single character TUI inputs.
Comment 4 Göran Uddeborg 2013-09-13 15:57:09 EDT
> Both 'c's stand for "continue", at least in the latest anaconda.

Oh, it does!  There is a comment immediately before the line with the string in base.py saying

   # global close command

and the immediately following line says


That probably led me to believe that the "c" actually meant "close".  But I don't think I investigated the code wider, so I may have jumped to conclusions.

(It seems I swapped the meanings in my original description.)

> I added some translator comments to all of the single character TUI inputs.

That's appreciated! :-)
Comment 5 Fedora Update System 2013-09-18 11:46:37 EDT
anaconda-20.18-1.fc20 has been submitted as an update for Fedora 20.
Comment 6 Fedora Update System 2013-09-18 13:44:09 EDT
Package anaconda-20.18-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing anaconda-20.18-1.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2013-09-21 16:05:18 EDT
anaconda-20.18-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.