Bug 854226 - Ambiguous meaning of string marked for translation
Summary: Ambiguous meaning of string marked for translation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 18
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: David Shea
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-04 12:53 UTC by Göran Uddeborg
Modified: 2013-09-21 20:05 UTC (History)
4 users (show)

Fixed In Version: anaconda-20.18-1.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-21 20:05:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Göran Uddeborg 2012-09-04 12:53:48 UTC
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 12:22:35 UTC
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 14:01:45 UTC
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

  --keyword=pgettext:1c,2

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 19:34:16 UTC
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 19:57:09 UTC
> 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

   self.close_screen()

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 15:46:37 UTC
anaconda-20.18-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.18-1.fc20

Comment 6 Fedora Update System 2013-09-18 17:44:09 UTC
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:
https://admin.fedoraproject.org/updates/FEDORA-2013-17065/anaconda-20.18-1.fc20
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-09-21 20:05:18 UTC
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.