core,plugins,ui: Avoid '+' for translatable strings
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 19 Apr 2010 13:28:55 +0000 (16:28 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 19 Apr 2010 13:28:55 +0000 (16:28 +0300)
Since translation tools don't know how to deal with vala files, they only
take the first string if strings are cancatenated using '+' operator.

27 files changed:
src/plugins/media-export/rygel-media-export-item.vala
src/plugins/media-export/rygel-media-export-root-container.vala
src/plugins/mediathek/rygel-mediathek-asx-playlist.vala
src/plugins/mediathek/rygel-mediathek-root-container.vala
src/plugins/mediathek/rygel-mediathek-video-item.vala
src/plugins/tracker/rygel-tracker-plugin-factory.vala
src/rygel/rygel-database.vala
src/rygel/rygel-dbus-service.vala
src/rygel/rygel-gst-utils.vala
src/rygel/rygel-http-get-handler.vala
src/rygel/rygel-http-identity-handler.vala
src/rygel/rygel-item-creator.vala
src/rygel/rygel-live-response.vala
src/rygel/rygel-log-handler.vala
src/rygel/rygel-media-db.vala
src/rygel/rygel-meta-config.vala
src/rygel/rygel-metadata-extractor.vala
src/rygel/rygel-mp2ts-transcoder-bin.vala
src/rygel/rygel-mp3-transcoder-bin.vala
src/rygel/rygel-plugin-loader.vala
src/rygel/rygel-root-device-factory.vala
src/rygel/rygel-search.vala
src/rygel/rygel-thumbnailer.vala
src/rygel/rygel-user-config.vala
src/rygel/rygel-wma-transcoder-bin.vala
src/rygel/rygel-wmv-transcoder-bin.vala
src/rygel/rygel-xbox-hacks.vala

index ab3d29e..63bae47 100644 (file)
@@ -49,8 +49,7 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
 
         if (item_class == null) {
             item_class = MediaItem.AUDIO_CLASS;
-            warning (_("Failed to detect UPnP class for '%s'," +
-                       " assuming it's '%s'"),
+            warning (_("Failed to detect UPnP class for '%s', assuming '%s'"),
                      file.get_uri (),
                      item_class);
         }
@@ -87,8 +86,7 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
                                                 out duration)) {
                             class_guessed = MediaItem.VIDEO_CLASS;
                         } else {
-                            warning(_("There's no codec inside and file" +
-                                      " is no image: %s"),
+                            warning(_("File '%s' is of unknown format/type."),
                                     file.get_uri ());
                             return null;
                         }
index 2701667..bae1c89 100644 (file)
@@ -437,8 +437,8 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
 
                     this.harvest (file, parent_container);
                 } catch (Rygel.DatabaseError error) {
-                    warning (_("Error while getting parent container for " +
-                               "filesystem event: %s"),
+                    warning (_("Error fetching object '%s' from database: %s"),
+                             id,
                              error.message);
                 }
                 break;
index fa7ad6d..d9b7f28 100644 (file)
@@ -98,8 +98,7 @@ public class Rygel.MediathekAsxPlaylist : Object {
         }
         else {
             throw new MediathekAsxPlaylistError.NETWORK_ERROR (
-                                        _("Could not download playlist: " +
-                                          ", error code was %u (%s)"),
+                                        _("Playlist download failed: %u (%s)"),
                                         message.status_code,
                                         Soup.status_get_phrase (
                                                         message.status_code));
index 3d8a999..e6a0108 100644 (file)
@@ -57,8 +57,7 @@ public class Rygel.MediathekRootContainer : Rygel.SimpleContainer {
         }
 
         if (feeds.size == 0) {
-            message (_("Could not get RSS items from configuration," +
-                       " using defaults"));
+            message (_("Could not get RSS from configuration, using defaults"));
             feeds.add (508);
         }
 
index 54b6a12..5e55f9d 100644 (file)
@@ -99,9 +99,9 @@ public class Rygel.MediathekVideoItem : Rygel.MediaItem {
                         }
                     }
                     else {
-                        throw new MediathekVideoItemError.XML_PARSE_ERROR (
-                                        _("Invalid or no namespace" +
-                                          " on group node"));
+                        var msg = _("Invalid or no namespace on group node");
+
+                        throw new MediathekVideoItemError.XML_PARSE_ERROR (msg);
                     }
                     break;
                 default:
@@ -110,14 +110,14 @@ public class Rygel.MediathekVideoItem : Rygel.MediaItem {
 
         }
         if (title == null) {
-            throw new MediathekVideoItemError.XML_PARSE_ERROR (_("Could not " +
-                                                                 "find title"));
+            throw new MediathekVideoItemError.XML_PARSE_ERROR (
+                                        _("Could not find title"));
         }
 
 
         if (asx == null) {
-            throw new MediathekVideoItemError.XML_PARSE_ERROR (_("Could not " +
-                                                                 "find uris"));
+            throw new MediathekVideoItemError.XML_PARSE_ERROR (
+                                        _("Could not find URIs"));
         }
 
         video_item = new MediathekVideoItem (parent, title);
index 9871fbb..e3b0451 100644 (file)
@@ -33,9 +33,8 @@ public void module_init (PluginLoader loader) {
     try {
         plugin_factory = new TrackerPluginFactory (loader);
     } catch (DBus.Error err) {
-        warning (_("Failed to start Tracker service: ") +
-                 err.message +
-                 _(". Tracker plugin disabled."));
+        warning (_("Failed to start Tracker service: %s. Plugin disabled.") +
+                 err.message);
     }
 }
 
index e603108..ff5ac09 100644 (file)
@@ -57,10 +57,10 @@ internal class Rygel.Database : Object {
         debug (_("Using database file %s"), db_file);
         var rc = Sqlite.Database.open (db_file, out this.db);
         if (rc != Sqlite.OK) {
-            throw new DatabaseError.IO_ERROR (_("Failed to open database: " +
-                                                "%d (%s)"),
-                                              rc,
-                                              db.errmsg ());
+            throw new DatabaseError.IO_ERROR (
+                                        _("Failed to open database: %d (%s)"),
+                                        rc,
+                                        db.errmsg ());
         }
 
         this.db.exec ("PRAGMA cache_size = 32768");
index 7d06aab..2a0118b 100644 (file)
@@ -42,8 +42,7 @@ public class Rygel.DBusService : Object {
                                                      (uint) 0);
 
         if (request_name_result != DBus.RequestNameReply.PRIMARY_OWNER) {
-            warning (_("Failed to start D-Bus service," +
-                       " name '%s' already taken"),
+            warning ("Failed to start D-Bus service  name '%s' already taken",
                      RYGEL_SERVICE);
         } else {
             conn.register_object (RYGEL_PATH, this);
index 1d53068..1260f49 100644 (file)
@@ -34,9 +34,9 @@ internal abstract class Rygel.GstUtils {
                                           throws Error {
         Element element = ElementFactory.make (factoryname, name);
         if (element == null) {
-            throw new GstError.MISSING_PLUGIN (_("Required element factory" +
-                                                 " %s missing"),
-                                               factoryname);
+            throw new GstError.MISSING_PLUGIN (
+                                        _("Required element %s missing"),
+                                        factoryname);
         }
 
         return element;
index 99a0adc..21caf69 100644 (file)
@@ -54,8 +54,8 @@ internal abstract class Rygel.HTTPGetHandler: GLib.Object {
             request.msg.response_headers.append ("contentFeatures.dlna.org",
                                                  tokens[3]);
         } catch (Error err) {
-            warning (_("Received request for 'contentFeatures.dlna.org' but " +
-                       "failed to provide the value in response headers"));
+            warning ("Received request for 'contentFeatures.dlna.org' but " +
+                       "failed to provide the value in response headers");
         }
 
         // Handle Samsung DLNA TV proprietary subtitle headers
index 4c3e7ca..e519aa4 100644 (file)
@@ -105,9 +105,9 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler {
                                      this.cancellable);
         } else {
             if (item.uris.size == 0) {
-                throw new HTTPRequestError.NOT_FOUND (_("Requested item '%s' " +
-                                                        "didn't provide a URI"),
-                                                      item.id);
+                throw new HTTPRequestError.NOT_FOUND (
+                                        _("Item '%s' didn't provide a URI"),
+                                        item.id);
             }
 
             return new SeekableResponse (request.server,
index 855956a..2d863c3 100644 (file)
@@ -64,10 +64,9 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
             });
             this.didl_parser.parse_didl (this.elements);
             if (this.didl_item == null) {
-                throw new ItemCreatorError.PARSE (
-                                        _("Failed to find any item in " +
-                                          "DIDL-Lite from client: '%s'"),
-                                        this.elements);
+                var message = _("No items in DIDL-Lite from client: '%s'");
+
+                throw new ItemCreatorError.PARSE (message, this.elements);
             }
 
             this.item = new MediaItem (didl_item.id,
index ab2a064..ebb7353 100644 (file)
@@ -80,8 +80,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse {
         dynamic Element sink = ElementFactory.make ("fakesink", SINK_NAME);
 
         if (sink == null) {
-            throw new GstError.MISSING_PLUGIN (_("Required plugin " +
-                                                 "'fakesink' missing"));
+            throw new GstError.MISSING_PLUGIN (_("Plugin 'fakesink' missing"));
         }
 
         sink.signal_handoffs = true;
index 7a498f7..a466e54 100644 (file)
@@ -59,8 +59,7 @@ public class Rygel.LogHandler : GLib.Object {
         } catch (Error err) {
             this.levels = DEFAULT_LEVELS;
 
-            warning (_("Failed to get log level from" +
-                       " configuration sources: %s"),
+            warning (_("Failed to get log level from configuration: %s"),
                      err.message);
         }
 
index 0ceb20b..a454e61 100644 (file)
@@ -348,8 +348,7 @@ public class Rygel.MediaDB : Object {
                                 throws DatabaseError, MediaDBError {
         var object = get_object (item_id);
         if (object != null && !(object is MediaItem)) {
-            throw new MediaDBError.INVALID_TYPE (_("Object with id %s is not" +
-                                                   " a MediaItem"),
+            throw new MediaDBError.INVALID_TYPE (_("Object %s is not an item"),
                                                  item_id);
         }
 
index f7e38c7..ebaaf3c 100644 (file)
@@ -242,9 +242,9 @@ public class Rygel.MetaConfig : GLib.Object, Configuration {
         }
 
         if (unavailable) {
-            throw new ConfigurationError.NO_VALUE_SET (_("No value available" +
-                                                         " for '%s/enabled'"),
-                                                       section);
+            throw new ConfigurationError.NO_VALUE_SET (
+                                        _("No value set for '%s/enabled'"),
+                                        section);
         }
 
         return val;
@@ -261,9 +261,9 @@ public class Rygel.MetaConfig : GLib.Object, Configuration {
         }
 
         if (val == null) {
-            throw new ConfigurationError.NO_VALUE_SET (_("No value available" +
-                                                         " for '%s/enabled'"),
-                                                       section);
+            throw new ConfigurationError.NO_VALUE_SET (
+                                        _("No value set for '%s/enabled'"),
+                                        section);
         }
 
         return val;
index 35cf4a4..63fa997 100644 (file)
@@ -113,8 +113,8 @@ public class Rygel.MetadataExtractor: GLib.Object {
                 if (factory != null) {
                     debug (_("Using playbin"));
                 } else {
-                    critical (_("Could not find any playbin. " +
-                                "Please check your gstreamer setup"));
+                    critical (_("Could not find any playbin. ") +
+                              _("Please check your gstreamer setup"));
                     return null;
                 }
             }
@@ -152,9 +152,9 @@ public class Rygel.MetadataExtractor: GLib.Object {
                  this.file_queue.peek_head ().get_uri ());
         this.playbin.set_state (State.NULL);
 
+        var message = _("Pipeline stuck while reading file info");
         this.error (file_queue.peek_head (),
-                    new IOChannelError.FAILED (_("Pipeline stuck while" +
-                                                 " reading file info")));
+                    new IOChannelError.FAILED (message));
         this.file_queue.pop_head ();
         extract_next ();
         return false;
index bf245f6..dc6059f 100644 (file)
@@ -85,12 +85,10 @@ internal class Rygel.MP2TSTranscoderBin : Gst.Bin {
         encoder.link (this.muxer);
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
-            GstUtils.post_error (this,
-                                 new GstError.LINK (_("Failed to link pad" +
-                                                      " %s to %s"),
-                                                    new_pad.name,
-                                                    enc_pad.name));
-            return;
+            var error = new GstError.LINK (_("Failed to link pad %s to %s"),
+                                           new_pad.name,
+                                           enc_pad.name);
+            GstUtils.post_error (this, error);
         }
     }
 }
index 694b68f..6420e5a 100644 (file)
@@ -66,11 +66,11 @@ internal class Rygel.MP3TranscoderBin : Gst.Bin {
         }
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
-            GstUtils.post_error (this,
-                                 new GstError.LINK (_("Failed to link pad" +
-                                                      "%s to %s"),
-                                                    new_pad.name,
-                                                    enc_pad.name));
+            var error = new GstError.LINK (_("Failed to link pad %s to %s"),
+                                           new_pad.name,
+                                           enc_pad.name);
+            GstUtils.post_error (this, error);
+
             return;
         }
     }
index 91f10df..d1875ba 100644 (file)
@@ -136,8 +136,8 @@ public class Rygel.PluginLoader : Object {
         void* function;
 
         if (!module.symbol("module_init", out function)) {
-            warning (_("Failed to find entry point function 'module_init'" +
-                       " in module loaded from path '%s': %s"),
+            warning (_("Failed to find entry point function '%s' in '%s': %s"),
+                     "module_init",
                      file_path,
                      Module.error ());
 
index 8c20e33..0992573 100644 (file)
@@ -289,10 +289,9 @@ internal class Rygel.RootDeviceFactory {
             res = doc.doc.dump (f);
 
         if (f == null || res == -1) {
-            string message = _("Failed to write modified description" +
-                               " to %s.\n").printf (desc_path);
+            var message = _("Failed to write modified description to %s");
 
-            throw new IOError.FAILED (message);
+            throw new IOError.FAILED (message, desc_path);
         }
     }
 
index 5714530..10eeae8 100644 (file)
@@ -150,9 +150,9 @@ internal class Rygel.Search: GLib.Object, Rygel.StateMachine {
                                               out this.total_matches,
                                               this.cancellable);
         if (results.size == 0) {
-            throw new ContentDirectoryError.CANT_PROCESS (
-                                        _("No objects found that could " +
-                                          "satisfy given search criteria."));
+            var message = _("No object satisfies given search criteria.");
+
+            throw new ContentDirectoryError.CANT_PROCESS (message);
         }
 
         this.number_returned = results.size;
index 5582f56..54d79be 100644 (file)
@@ -53,8 +53,9 @@ internal class Rygel.Thumbnailer : GLib.Object {
             file = File.new_for_path (dir);
 
             if (!file.query_exists (null)) {
-                throw new ThumbnailerError.NO_DIR (_("Failed to find " +
-                                                     "thumbnails directory."));
+                var message = _("Failed to find thumbnails directory.");
+
+                throw new ThumbnailerError.NO_DIR (message);
             } else {
                 this.template.mime_type = "image/png";
                 this.template.dlna_profile = "PNG_TN";
index 0bfe53a..14f34c0 100644 (file)
@@ -210,9 +210,9 @@ public class Rygel.UserConfig : GLib.Object, Configuration {
         var val = this.key_file.get_string (section, key);
 
         if (val == null || val == "") {
-            throw new ConfigurationError.NO_VALUE_SET (_("No value available" +
-                                                         " for '%s'"),
-                                                       key);
+            throw new ConfigurationError.NO_VALUE_SET (
+                                        _("No value available for '%s'"),
+                                        key);
         }
 
         return val;
@@ -239,9 +239,9 @@ public class Rygel.UserConfig : GLib.Object, Configuration {
         int val = this.key_file.get_integer (section, key);
 
         if (val == 0 || val < min || val > max) {
-            throw new ConfigurationError.VALUE_OUT_OF_RANGE (_("Value of '%s'" +
-                                                               " out of range"),
-                                                             key);
+            throw new ConfigurationError.VALUE_OUT_OF_RANGE (
+                                        _("Value of '%s' out of range"),
+                                        key);
         }
 
         return val;
index b38f263..e2ad192 100644 (file)
@@ -55,11 +55,11 @@ internal class Rygel.WMATranscoderBin : Gst.Bin {
         }
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
-            GstUtils.post_error (this,
-                                 new GstError.LINK (_("Failed to link pad" +
-                                                      " %s to %s"),
-                                                    new_pad.name,
-                                                    enc_pad.name));
+            var error = new GstError.LINK (_("Failed to link pad %s to %s"),
+                                           new_pad.name,
+                                           enc_pad.name);
+            GstUtils.post_error (this, error);
+
             return;
         }
     }
index e2b8aa1..435d924 100644 (file)
@@ -83,12 +83,10 @@ internal class Rygel.WMVTranscoderBin : Gst.Bin {
         encoder.link (this.muxer);
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
-            GstUtils.post_error (this,
-                                 new GstError.LINK (_("Failed to link pad" +
-                                                      " %s to %s"),
-                                                    new_pad.name,
-                                                    enc_pad.name));
-            return;
+            var error = new GstError.LINK (_("Failed to link pad %s to %s"),
+                                           new_pad.name,
+                                           enc_pad.name);
+            GstUtils.post_error (this, error);
         }
     }
 }
index 9cbe4b3..2e20125 100644 (file)
@@ -145,10 +145,9 @@ internal class Rygel.XBoxHacks : GLib.Object {
             res = doc.doc.dump (f);
 
         if (f == null || res == -1) {
-            throw new IOError.FAILED (_("Failed to write modified" +
-                                        " description to %s."),
-                                      desc_path);
+            var message = _("Failed to write modified description to %s.");
 
+            throw new IOError.FAILED (message, desc_path);
         }
     }
 }