GNOME Bugzilla – Bug 709537
Some complex strings ("Rendering — %d%% complete", "Importing clip X of Y") never show their translated / localized version
Last modified: 2014-11-01 21:00:02 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.
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>")
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)
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 :-(
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