[pitivi] ui: Include %d in the translated message



commit bd2c1f5086c67c17ecf811a47fc69622136da3c3
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Wed Dec 21 14:13:51 2016 +0100

    ui: Include %d in the translated message
    
    Reviewed-by: Thibault Saunier <tsaunier gnome org>
    Differential Revision: https://phabricator.freedesktop.org/D1569

 pitivi/utils/ui.py          |   14 ++++++--------
 tests/test_media_library.py |    5 ++---
 2 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index 27f5851..ea83ae2 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -250,6 +250,9 @@ def beautify_asset(asset):
     Args:
         asset (GES.Asset): The asset to display.
     """
+    uri = get_proxy_target(asset).props.id
+    res = ["<b>" + path_from_uri(uri) + "</b>"]
+
     ranks = {
         DiscovererVideoInfo: 0,
         DiscovererAudioInfo: 1,
@@ -263,9 +266,7 @@ def beautify_asset(asset):
             return len(ranks)
 
     info = asset.get_info()
-    uri = get_proxy_target(asset).props.id
     info.get_stream_list().sort(key=stream_sort_key)
-    nice_streams_txts = []
     for stream in info.get_stream_list():
         try:
             beautified_string = beautify_stream(stream)
@@ -273,15 +274,12 @@ def beautify_asset(asset):
             doLog(ERROR, "Beautify", "None", "Cannot beautify %s", stream)
             continue
         if beautified_string:
-            nice_streams_txts.append(beautified_string)
-
-    res = "<b>" + path_from_uri(uri) + "</b>\n" + "\n".join(nice_streams_txts)
+            res.append(beautified_string)
 
     if asset.creation_progress < 100:
-        res += _("\n<b>Proxy creation progress: ") + \
-            "</b>%d%%" % asset.creation_progress
+        res.append(_("<b>Proxy creation progress:</b> %d%%") % asset.creation_progress)
 
-    return res
+    return "\n".join(res)
 
 
 def info_name(info):
diff --git a/tests/test_media_library.py b/tests/test_media_library.py
index 8002b81..19da700 100644
--- a/tests/test_media_library.py
+++ b/tests/test_media_library.py
@@ -201,12 +201,11 @@ class TestMediaLibrary(BaseTestMediaLibrary):
         self.assertIsNone(asset.get_proxy())
 
         # And let's recreate the proxy file.
-        self.app.project_manager.current_project.useProxiesForAssets(
-            [asset])
+        self.app.project_manager.current_project.useProxiesForAssets([asset])
         self.assertEqual(asset.creation_progress, 0)
 
         # Check that the info column notifies the user about progress
-        self.assertTrue(_("Proxy creation progress: ") in
+        self.assertTrue("Proxy creation progress:" in
                         self.medialibrary.storemodel[0][medialibrary.COL_INFOTEXT])
 
         # Run the mainloop and let _progressBarCb stop it when the proxy is


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