After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682275 - Do not split strings that need to be translated
Do not split strings that need to be translated
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: General
Git
Other Linux
: High normal
: 0.91
Assigned To: Jean-François Fortin Tam
Pitivi maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-20 15:30 UTC by Gil Forcada
Modified: 2012-09-02 04:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gil Forcada 2012-08-20 15:30:39 UTC
On [1] there is this snippet of code:

visible_option.set_tooltip_markup(_("<b>Enable or disable this layer</b>\n" +
                                    "Disabled layers will not play nor render."))

Unfortunately gettext does get it wrong and the pot file generated [2] the string available to translate is:

#: ../pitivi/timeline/layer.py:107
msgid "<b>Enable or disable this layer</b>\n"
msgstr ""

Which, as you can see, is missing half of the string.

Could be possible to do something like

tmp_string = _("<b>Enable or disable this layer</b>\nDisabled layers will not play nor render.")
visible_option.set_tooltip_markup(tmp_string)

I know it breaks your beautiful 80 characters limit (which I do care when I program too). But I would say that having half of the string translated on the UI could be fare shameful than having a +80 characters on a single line.

I haven't checked if there is any other string like that, I just stumbled upon this one, I leave up to you, the awesome PiTiVi developers, to do the grep magic ;)

Thanks for this amazing video editor!!

[1] http://git.gnome.org/browse/pitivi/tree/pitivi/timeline/layer.py#n107
[2] http://l10n.gnome.org/POT/pitivi.master/pitivi.master.pot
Comment 1 Jean-François Fortin Tam 2012-08-20 15:43:44 UTC
Oh, I wrongly assumed that gettext didn't barf up on this... Guess we'll need to write a rule/guideline for this somewhere, maybe in docs/HACKING.

Do you think a naïve:

git grep "_(" | grep "+"

...would find all of them?
Comment 2 Gil Forcada 2012-08-20 16:27:17 UTC
(In reply to comment #1)
> Oh, I wrongly assumed that gettext didn't barf up on this... Guess we'll need
> to write a rule/guideline for this somewhere, maybe in docs/HACKING.
> 
> Do you think a naïve:
> 
> git grep "_(" | grep "+"
> 
> ...would find all of them?

I would guess so... :)
Comment 3 Jean-François Fortin Tam 2012-08-22 16:53:05 UTC
Actually, this is a bit confusing. I've seen this in the code, which works as far as I know?

            self._info_bar = self.clip_properties.addInfoBar(
                                _("Select a clip on the timeline "
                                  "to configure its associated effects"))
Comment 4 Gil Forcada 2012-08-22 21:10:46 UTC
Not confusing but subtle!

Your string is:
_("Select a clip on the timeline "
  "to configure its associated effects"))

And the one I reported is:
_("<b>Enable or disable this layer</b>\n" +
"Disabled layers will not play nor render."))

Notice the difference? Right! the "+" between the two strings on the "bad" one :)

So, Python by itself already joins two strings like "this" "and" "this". And gettext seems to be able to get that too, but if you add an explicit "+" sign between the strings then gettext get lost in translation (bad joke I know).

Just tried locally (remove the "+" sign and run intltool-update -p within the po folder) and it does work, the pitivi.pot file shows the whole string.

Lesson learned: Python allows you to type less :)
Comment 5 Jean-François Fortin Tam 2012-09-02 04:13:13 UTC
commit 97eee97b68c95556f1385511a1c5770e43d50c82
Author: Paul Lange <palango@gmx.de>
Date:   Sun Aug 26 17:03:59 2012 +0200

    layer: Do not use explicit concatenation for translatable tooltips
    
    Fixes bug #682275