[pitivi] medialibrary: Pluralize translatable message



commit 241922f15c233f00617aecbe9de8cdd00b57c00e
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Jul 5 19:12:32 2016 +0200

    medialibrary: Pluralize translatable message
    
    Fixes https://phabricator.freedesktop.org/T7353
    
    Differential Revision: https://phabricator.freedesktop.org/D1156

 pitivi/medialibrary.py |   44 +++++++++++++++++++++++++-------------------
 1 files changed, 25 insertions(+), 19 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 0f93c80..51e1e12 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -846,25 +846,31 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
 
         if progress == 0:
             self._startImporting(project)
-        else:
-            if project.loaded:
-                num_proxying_files = [asset for asset in project.loading_assets if not asset.ready]
-                if estimated_time:
-                    self.__last_proxying_estimate_time = beautify_ETA(int(
-                        estimated_time * Gst.SECOND))
-
-                # Translators: this string indicates the estimated time
-                # remaining until an action (such as rendering) completes.
-                # The "%s" is an already-localized human-readable duration,
-                # such as "31 seconds", "1 minute" or "1 hours, 14 minutes".
-                # In some languages, "About %s left" can be expressed roughly as
-                # "There remains approximatively %s" (to handle gender and plurals)
-                progress_message = _("Transcoding %d assets: %d%% (About %s left)") % (
-                    len(num_proxying_files), progress,
-                    self.__last_proxying_estimate_time)
-                self._progressbar.set_text(progress_message)
-                self._last_imported_uris.update([asset.props.id for asset in
-                                                 project.loading_assets])
+            return
+
+        if project.loaded:
+            num_proxying_files = [asset
+                                  for asset in project.loading_assets
+                                  if not asset.ready]
+            if estimated_time:
+                self.__last_proxying_estimate_time = beautify_ETA(int(
+                    estimated_time * Gst.SECOND))
+
+            # Translators: this string indicates the estimated time
+            # remaining until an action (such as rendering) completes.
+            # The "%s" is an already-localized human-readable duration,
+            # such as "31 seconds", "1 minute" or "1 hours, 14 minutes".
+            # In some languages, "About %s left" can be expressed roughly as
+            # "There remains approximatively %s" (to handle gender and plurals)
+            template = ngettext("Transcoding %d asset: %d%% (About %s left)",
+                                "Transcoding %d assets: %d%% (About %s left)",
+                                len(num_proxying_files))
+            progress_message = template % (
+                len(num_proxying_files), progress,
+                self.__last_proxying_estimate_time)
+            self._progressbar.set_text(progress_message)
+            self._last_imported_uris.update([asset.props.id for asset in
+                                             project.loading_assets])
 
         if progress == 100:
             self._doneImporting()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]