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 709537 - Some complex strings ("Rendering — %d%% complete", "Importing clip X of Y") never show their translated / localized version
Some complex strings ("Rendering — %d%% complete", "Importing clip X of Y") n...
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: User interface
0.91
Other Linux
: Normal minor
: 0.94
Assigned To: Pitivi maintainers
Pitivi maintainers
Depends on: 709539
Blocks:
 
 
Reported: 2013-10-07 01:18 UTC by Jean-François Fortin Tam
Modified: 2014-11-01 21:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-François Fortin Tam 2013-10-07 01:18:08 UTC
In render.py, we do:

  self.window.set_title(_("Rendering — %d%% complete") % int(100 * fraction))

Which ends up as a string such as "Rendering — 55% complete"

However, I noticed that even if translators *did* translate this string in the .po files, it remains untranslated when displayed in the UI. I'm suspecting something is wrong with %% but I don't know what; I took that trick from http://stackoverflow.com/questions/3728272/how-can-i-escape-character-in-a-gettext-string

This type of string is also used in autoaligner.py.
Comment 1 Jean-François Fortin Tam 2013-10-07 01:40:40 UTC
Oh what the heck. There are other strings that never get shown in their translated form even if they are properly picked up and translated in the .po files:

- In pitivi/medialibrary.py:

    progressbar_text = _("Importing clip %(current_clip)d of %(total)d" %
        {"current_clip": current_clip_iter,
         "total": total_clips})


- All the strings in pitivi/utils/ui.py's "beautify_stream" method, such as:

  templ = ngettext("<b>Audio:</b> %d channel at %d <i>Hz</i> (%d <i>bits</i>)",
          "<b>Audio:</b> %d channels at %d <i>Hz</i> (%d <i>bits</i>)",
          stream.get_channels())

  templ = _("<b>Video:</b> %d×%d <i>pixels</i> at %.3f <i>fps</i>")

  templ = _("<b>Image:</b> %d×%d <i>pixels</i>")
Comment 2 Jean-François Fortin Tam 2013-10-07 02:04:10 UTC
Placeholder text in medialibrary.ui and effectslibrary.ui does not show up, but that's because glade doesn't let me mark those strings as translatable (see bug #709539)
Comment 3 Claude Paroz 2014-11-01 20:31:09 UTC
In the progressbar_text case, the error is obvious, you have to make the placeholder replacement on the result of the translation function, not inside the function.
I have no explanations for the other errors, though :-(
Comment 4 Jean-François Fortin Tam 2014-11-01 21:00:02 UTC
Oh, thanks for the hint Claude! The progressbar_text issue was the only remaining bug, somehow the others started working nowadays.

So I pushed a fix as commit 42b194d77a