Historical bug tracker for the Pacman package manager.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
FS#34240 - Do not remove source code references in PO/POT files
Attached to Project:
Pacman
Opened by Rafael Fontenelle (josephg) - Sunday, 10 March 2013, 04:39 GMT
Last edited by Allan McRae (Allan) - Saturday, 08 February 2014, 12:10 GMT
Opened by Rafael Fontenelle (josephg) - Sunday, 10 March 2013, 04:39 GMT
Last edited by Allan McRae (Allan) - Saturday, 08 February 2014, 12:10 GMT
|
DetailsSummary and Info:
xgettext is able to generate POT files keeping the source file reference of the translateable string. This is particularly useful for translators as one can sniff around the source code provided in GIT to better understand/verify the context of a string in the PO file, which eases the translation process. xgettext's default behavior is to keep references, but it can be (and it is currently being) disabled using the --no-location option in the po/Makevars files. As attachment, a patch that removes "--no-location" from XGETTEXT_OPTIONS, which generated POT/PO files without issue. Steps to Reproduce (files with references): 1- cd <pacman git dir> 2- sed -i 's/--no-location//' src/pacman/po/Makevars lib/libalpm/po/Makevars scripts/po/Makevars 3- ./autogen.sh && ./configure 4- make update-po |
This task depends upon
Closed by Allan McRae (Allan)
Saturday, 08 February 2014, 12:10 GMT
Reason for closing: Fixed
Additional comments about closing: git commit 236f1795
Saturday, 08 February 2014, 12:10 GMT
Reason for closing: Fixed
Additional comments about closing: git commit 236f1795
remove-no-location.patch
commit 8725dce2948f9e1eb9c6f9d66cdb5ef985e6de6c
Author: Chantry Xavier <shiningxc@gmail.com>
Date: Mon Mar 3 21:32:54 2008 +0100
Disable the line number in .po files.
Add the --no-location xgettext option to disable the line numbers. They are
not very useful, and generate a huge number of pointless line changes on
every update.
Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011332.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
- While it introduces a lot of "pointless line changes", it makes very easy for the translator to figure out which line is in which file, so one can read around this line to see the context.
- Without the src code references in strings, I have to run several 'grep -R <string-content>', or whatever cmd line, if I want to understand the meaning of a string (and sometimes it get cloudy) or if I want to be highly accurate in the translation (and I want to be accurate - I'm perfectionist on pacman and AUR translation ;)
- With a translation tool (ex.: poEdit), one can open the source code in view-mode through the GUI (how to reproduce: do the "Steps to reproduce above", run poEdit in a PO file, right-click to see the reference)
Let me show one example that I consider critical:
msgid "Creating working copy of %s %s repo..."
In the above msgid I would never figure out that first %s is repo name and the second is 'bzr' without looking at the src code. It makes different for pt_BR laguange because I need to invert order of the variables, using %1s and %2s, to maintain its meaning.
msgstr "Criando cópia de trabalho do repositório %2s de %1s..."
msgstr "Criando cópia de trabalho do repositório %2s de %1s..."
Please don't - that is in the pacman-scripts file so order parameters can not be used.
Things like '--option option description' are obvious candidates for splitting; the above bit seems like a thing we can't safely split in a translatable way. I do agree that having to proofread translations to look for those bits that shouldn't be translated would really suck though. Of course, these things should get caught and corrected quickly if people are actually using the translations.
Just FYI, you might be able to send some info for the translators using comment blocks right above the translation string plus a "XGETTEXT_OPTIONS= --add-comments" (msgctxt). e.g.: "first %s is the repo name and the second %s is 'bzr' - don't invert order here". With this, hopefully we can avoid the probability of the end-user being the proofreader.
I am also not sure that the comments work in bash scripts either - but definitely something to consider with the C code parts.
Anyway, with or without msgctxt, with location makes it easier (for the translator) to know where a string is from. It doesn't even bring a great increase in the file size, just a lot more lines in the commit log. IMHO, the benefit (for the translators) compensates adding the locations/references back.
About positional parameters: would be great to have the inability to use them in pacman scripts documented at https://www.archlinux.org/pacman/translation-help.html
Code comments starting with "TRANSLATORS:" are not msgctxt (also known more generally as disambiguation context). They are instead extracted comments. A random example from random another project using gettext (trader):
#. TRANSLATORS: "Player" is used as a column title in a
#. table containing all player names.
#: src/game.c:606 src/move.c:868
#, c-format
msgctxt "subtitle"
msgid "Player"
msgstr "Pelaaja"
Both generally work for adding comments for translators. Adding disambiguation context also solves another problem, though. Because the disambiguation context is part of the message key, adding or changing it makes the translations fuzzy, which forces all translators to review them. This is useful because some translations probably had mistakes because of missing context.