From 928249ebd8cb62c93c5d2eddbe3c62a2b586b250 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Mon, 19 Apr 2010 03:08:30 +0300 Subject: [PATCH] core,plugins,ui: Mark translatable strings Mark translatable strings fro translation using the '_()' macro. --- .../gst-renderer/rygel-gst-av-transport.vala | 12 +++---- src/plugins/gst-renderer/rygel-gst-changelog.vala | 2 +- src/plugins/gst-renderer/rygel-gst-player.vala | 8 ++--- src/plugins/gst-renderer/rygel-gst-plugin.vala | 2 +- .../gst-renderer/rygel-gst-rendering-control.vala | 8 ++--- .../rygel-media-export-dbus-service.vala | 3 +- .../media-export/rygel-media-export-harvester.vala | 14 ++++---- .../media-export/rygel-media-export-item.vala | 13 ++++--- .../media-export/rygel-media-export-plugin.vala | 4 +-- .../rygel-media-export-query-container.vala | 10 +++--- .../rygel-media-export-recursive-file-monitor.vala | 4 +-- .../rygel-media-export-root-container.vala | 37 +++++++++---------- .../mediathek/rygel-mediathek-asx-playlist.vala | 10 +++--- src/plugins/mediathek/rygel-mediathek-plugin.vala | 2 +- .../mediathek/rygel-mediathek-root-container.vala | 5 +-- .../mediathek/rygel-mediathek-rss-container.vala | 16 ++++----- .../mediathek/rygel-mediathek-video-item.vala | 17 ++++----- .../rygel-tracker-category-all-container.vala | 2 +- .../tracker/rygel-tracker-insertion-query.vala | 2 +- .../tracker/rygel-tracker-item-creation.vala | 4 +-- .../tracker/rygel-tracker-metadata-values.vala | 4 +-- src/plugins/tracker/rygel-tracker-music.vala | 4 +-- .../tracker/rygel-tracker-plugin-factory.vala | 4 +-- src/plugins/tracker/rygel-tracker-plugin.vala | 4 +-- .../tracker/rygel-tracker-search-container.vala | 4 +-- .../tracker/rygel-tracker-selection-query.vala | 2 +- src/plugins/tracker/rygel-tracker-years.vala | 2 +- src/rygel/rygel-browse.vala | 14 ++++---- src/rygel/rygel-cmdline-config.vala | 30 ++++++++-------- src/rygel/rygel-connection-manager.vala | 2 +- src/rygel/rygel-content-directory.vala | 6 ++-- src/rygel/rygel-database.vala | 17 +++++---- src/rygel/rygel-dbus-service.vala | 3 +- src/rygel/rygel-didl-lite-writer.vala | 2 +- src/rygel/rygel-gst-utils.vala | 5 +-- src/rygel/rygel-http-byte-seek.vala | 13 +++---- src/rygel/rygel-http-get-handler.vala | 4 +-- src/rygel/rygel-http-get.vala | 8 ++--- src/rygel/rygel-http-identity-handler.vala | 8 ++--- src/rygel/rygel-http-item-uri.vala | 4 +-- src/rygel/rygel-http-post.vala | 2 +- src/rygel/rygel-http-request.vala | 2 +- src/rygel/rygel-http-server.vala | 8 ++--- src/rygel/rygel-http-time-seek.vala | 11 +++--- src/rygel/rygel-http-transcode-handler.vala | 2 +- src/rygel/rygel-import-resource.vala | 4 +-- src/rygel/rygel-item-creator.vala | 15 ++++---- src/rygel/rygel-l16-transcoder-bin.vala | 8 ++--- src/rygel/rygel-live-response.vala | 18 +++++----- src/rygel/rygel-log-handler.vala | 3 +- src/rygel/rygel-main.vala | 16 ++++----- src/rygel/rygel-media-container.vala | 2 +- src/rygel/rygel-media-db.vala | 14 ++++---- src/rygel/rygel-media-item.vala | 4 +-- src/rygel/rygel-meta-config.vala | 42 +++++++++++----------- src/rygel/rygel-metadata-extractor.vala | 26 +++++++------- src/rygel/rygel-mp2ts-transcoder-bin.vala | 6 ++-- src/rygel/rygel-mp3-transcoder-bin.vala | 6 ++-- src/rygel/rygel-plugin-loader.vala | 16 ++++----- src/rygel/rygel-root-device-factory.vala | 16 ++++----- src/rygel/rygel-search.vala | 12 +++---- src/rygel/rygel-seekable-response.vala | 8 ++--- src/rygel/rygel-subtitle-manager.vala | 2 +- src/rygel/rygel-thumbnailer.vala | 9 ++--- src/rygel/rygel-transcode-manager.vala | 2 +- src/rygel/rygel-user-config.vala | 18 +++++----- src/rygel/rygel-wma-transcoder-bin.vala | 8 ++--- src/rygel/rygel-wmv-transcoder-bin.vala | 8 ++--- src/rygel/rygel-xbox-hacks.vala | 8 ++--- src/ui/rygel-preferences-dialog.vala | 2 +- 70 files changed, 316 insertions(+), 297 deletions(-) diff --git a/src/plugins/gst-renderer/rygel-gst-av-transport.vala b/src/plugins/gst-renderer/rygel-gst-av-transport.vala index 4f827b0..db5ee1e 100644 --- a/src/plugins/gst-renderer/rygel-gst-av-transport.vala +++ b/src/plugins/gst-renderer/rygel-gst-av-transport.vala @@ -200,7 +200,7 @@ public class Rygel.GstAVTransport : Service { action.get ("InstanceID", typeof (uint), out instance_id); if (instance_id != 0) { - action.return_error (718, "Invalid InstanceID"); + action.return_error (718, _("Invalid InstanceID")); return false; } @@ -360,7 +360,7 @@ public class Rygel.GstAVTransport : Service { action.get ("Speed", typeof (string), out speed); if (speed != "1") { - action.return_error (717, "Play speed not supported"); + action.return_error (717, _("Play speed not supported")); return; } @@ -393,7 +393,7 @@ public class Rygel.GstAVTransport : Service { case "ABS_TIME": case "REL_TIME": if (!this.player.seek (target)) { - action.return_error (710, "Seek mode not supported"); + action.return_error (710, _("Seek mode not supported")); return; } @@ -402,18 +402,18 @@ public class Rygel.GstAVTransport : Service { return; default: - action.return_error (710, "Seek mode not supported"); + action.return_error (710, _("Seek mode not supported")); return; } } private void next_cb (Service service, owned ServiceAction action) { - action.return_error (701, "Transition not available"); + action.return_error (701, _("Transition not available")); } private void previous_cb (Service service, owned ServiceAction action) { - action.return_error (701, "Transition not available"); + action.return_error (701, _("Transition not available")); } private void notify_state_cb (Object player, diff --git a/src/plugins/gst-renderer/rygel-gst-changelog.vala b/src/plugins/gst-renderer/rygel-gst-changelog.vala index 0752f33..f25f026 100644 --- a/src/plugins/gst-renderer/rygel-gst-changelog.vala +++ b/src/plugins/gst-renderer/rygel-gst-changelog.vala @@ -69,7 +69,7 @@ public class Rygel.GstChangeLog : Object { private void ensure_timeout () { // Make sure we have a notification timeout if (this.service != null && this.timeout_id == 0) { - debug ("Setting up timeout for LastChange"); + debug (_("Setting up timeout for LastChange")); this.timeout_id = Timeout.add (200, this.timeout); } } diff --git a/src/plugins/gst-renderer/rygel-gst-player.vala b/src/plugins/gst-renderer/rygel-gst-player.vala index 2b25603..4b47cc3 100644 --- a/src/plugins/gst-renderer/rygel-gst-player.vala +++ b/src/plugins/gst-renderer/rygel-gst-player.vala @@ -39,7 +39,7 @@ public class Rygel.GstPlayer : GLib.Object { } set { - debug ("Changing playback state to %s..", value); + debug (_("Changing playback state to %s.."), value); this._playback_state = value; switch (this._playback_state) { @@ -65,7 +65,7 @@ public class Rygel.GstPlayer : GLib.Object { set { this.playbin.uri = value; - debug ("URI set to %s.", value); + debug (_("URI set to %s."), value); } } @@ -76,7 +76,7 @@ public class Rygel.GstPlayer : GLib.Object { set { this.playbin.volume = value; - debug ("volume set to %f.", value); + debug (_("volume set to %f."), value); } } @@ -124,7 +124,7 @@ public class Rygel.GstPlayer : GLib.Object { } public bool seek (string time) { - debug ("Seeking to %s.", time); + debug (_("Seeking to %s."), time); return this.playbin.seek (1.0, Format.TIME, SeekFlags.FLUSH, diff --git a/src/plugins/gst-renderer/rygel-gst-plugin.vala b/src/plugins/gst-renderer/rygel-gst-plugin.vala index c528ff7..00aeabe 100644 --- a/src/plugins/gst-renderer/rygel-gst-plugin.vala +++ b/src/plugins/gst-renderer/rygel-gst-plugin.vala @@ -33,7 +33,7 @@ public void module_init (PluginLoader loader) { var plugin = new Plugin (MEDIA_RENDERER_DESC_PATH, "GstRenderer", - "GStreamer Renderer"); + _("GStreamer Renderer")); plugin.add_resource (new ResourceInfo (ConnectionManager.UPNP_ID, ConnectionManager.UPNP_TYPE, diff --git a/src/plugins/gst-renderer/rygel-gst-rendering-control.vala b/src/plugins/gst-renderer/rygel-gst-rendering-control.vala index 693248e..af7ec46 100644 --- a/src/plugins/gst-renderer/rygel-gst-rendering-control.vala +++ b/src/plugins/gst-renderer/rygel-gst-rendering-control.vala @@ -116,7 +116,7 @@ public class Rygel.GstRenderingControl : Service { action.get ("InstanceID", typeof (uint), out instance_id); if (instance_id != 0) { - action.return_error (702, "Invalid InstanceID"); + action.return_error (702, _("Invalid InstanceID")); return false; } @@ -147,7 +147,7 @@ public class Rygel.GstRenderingControl : Service { action.get ("PresetName", typeof (string), out preset_name); if (preset_name != "") { - action.return_error (701, "Invalid Name"); + action.return_error (701, _("Invalid Name")); return; } @@ -161,7 +161,7 @@ public class Rygel.GstRenderingControl : Service { action.get ("Channel", typeof (string), out channel); if (channel != "Master") { - action.return_error (501, "Action Failed"); + action.return_error (501, _("Action Failed")); return false; } @@ -232,7 +232,7 @@ public class Rygel.GstRenderingControl : Service { action.get ("DesiredVolume", typeof (uint), out volume); if (volume > 100) { - action.return_error (501, "Action Failed"); + action.return_error (501, _("Action Failed")); return; } diff --git a/src/plugins/media-export/rygel-media-export-dbus-service.vala b/src/plugins/media-export/rygel-media-export-dbus-service.vala index a50db3d..c93fc04 100644 --- a/src/plugins/media-export/rygel-media-export-dbus-service.vala +++ b/src/plugins/media-export/rygel-media-export-dbus-service.vala @@ -34,7 +34,8 @@ public class Rygel.MediaExportDBusService : Object { if (conn != null) conn.register_object (RYGEL_MEDIA_EXPORT_PATH, this); } catch (DBus.Error err) { - warning ("Failed to attach to DBus session bus: %s", err.message); + warning (_("Failed to attach to DBus session bus: %s"), + err.message); } } diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala index 4bcca08..c647e59 100644 --- a/src/plugins/media-export/rygel-media-export-harvester.vala +++ b/src/plugins/media-export/rygel-media-export-harvester.vala @@ -66,7 +66,7 @@ public class Rygel.MediaExportHarvester : GLib.Object { return true; } } catch (DatabaseError err) { - warning ("Failed to query database: %s", err.message); + warning (_("Failed to query database: %s"), err.message); } return false; @@ -98,8 +98,7 @@ public class Rygel.MediaExportHarvester : GLib.Object { this.media_db.save_container (container); } } catch (Error err) { - warning ("Failed to update database: %s", - err.message); + warning (_("Failed to update database: %s"), err.message); } } else { string id; @@ -131,8 +130,7 @@ public class Rygel.MediaExportHarvester : GLib.Object { yield enumerator.close_async (Priority.DEFAULT, this.cancellable); } catch (Error err) { - warning ("failed to enumerate directory: %s", - err.message); + warning (_("failed to enumerate directory: %s"), err.message); } cleanup_database (this.containers.peek_head() as DummyContainer); @@ -153,7 +151,7 @@ public class Rygel.MediaExportHarvester : GLib.Object { this.media_db.remove_by_id (child); } } catch (DatabaseError err) { - warning("Failed to get children of container %s: %s", + warning(_("Failed to get children of container %s: %s"), container.id, err.message); } @@ -230,14 +228,14 @@ public class Rygel.MediaExportHarvester : GLib.Object { this.origin = file; this.containers.push_tail (this.parent); } else { - debug ("File %s does not need harvesting", + debug (_("File %s does not need harvesting"), file.get_uri ()); harvested (file); } } } catch (Error err) { - warning ("Failed to harvest file %s: %s", + warning (_("Failed to harvest file %s: %s"), file.get_uri (), err.message); harvested (file); diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala index 75ba2c6..ab3d29e 100644 --- a/src/plugins/media-export/rygel-media-export-item.vala +++ b/src/plugins/media-export/rygel-media-export-item.vala @@ -49,8 +49,10 @@ 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'", - file.get_uri (), item_class); + warning (_("Failed to detect UPnP class for '%s'," + + " assuming it's '%s'"), + file.get_uri (), + item_class); } base (id, parent, info.get_name (), item_class); @@ -85,8 +87,9 @@ 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", file.get_uri ()); + warning(_("There's no codec inside and file" + + " is no image: %s"), + file.get_uri ()); return null; } } @@ -106,7 +109,7 @@ public class Rygel.MediaExportItem : Rygel.MediaItem { } } else { // throw error. Taglist can't be empty - warning("Got empty taglist for file %s", file.get_uri ()); + warning(_("Got empty taglist for file %s"), file.get_uri ()); return null; } diff --git a/src/plugins/media-export/rygel-media-export-plugin.vala b/src/plugins/media-export/rygel-media-export-plugin.vala index e5b1db4..db27d5d 100644 --- a/src/plugins/media-export/rygel-media-export-plugin.vala +++ b/src/plugins/media-export/rygel-media-export-plugin.vala @@ -30,8 +30,8 @@ using GLib; [ModuleInit] public void module_init (PluginLoader loader) { var plugin = new Plugin.MediaServer ("MediaExport", - "@REALNAME@'s media", - typeof (Rygel.MediaExportContentDir)); + _("@REALNAME@'s media"), + typeof (Rygel.MediaExportContentDir)); loader.add_plugin (plugin); } diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala index 5f48862..7339afc 100644 --- a/src/plugins/media-export/rygel-media-export-query-container.vala +++ b/src/plugins/media-export/rygel-media-export-query-container.vala @@ -44,20 +44,20 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer { var args = id.split(","); if ((args.length % 2) != 0) { - warning ("Id does not contain pairs"); + warning (_("Id does not contain pairs")); return false; } for (int i = 0; i < args.length; i += 2) { if (args[i] == "" || args[i + 1] == "") { - warning ("Empty part not allowed in virtual id"); + warning (_("Empty part not allowed in virtual id")); return false; } if (args[i] == "?") { - warning ("Placeholder can only be on second place"); + warning (_("Placeholder can only be on second place")); return false; } @@ -115,7 +115,7 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer { i += 2; } this.child_count = this.count_children (); - debug ("We have %u children", this.child_count); + debug (_("We have %u children"), this.child_count); } private int count_children () { @@ -235,7 +235,7 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer { } if (!virtual_container_map.has_key (md5)) { virtual_container_map[md5] = id; - debug ("registering %s for %s", md5, id); + debug (_("Registering %s for %s"), md5, id); } id = PREFIX + md5; diff --git a/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala b/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala index 558489e..447b943 100644 --- a/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala +++ b/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala @@ -44,7 +44,7 @@ public class Rygel.MediaExportRecursiveFileMonitor : Object { case FileMonitorEvent.DELETED: var file_monitor = this.monitors.get (file); if (file_monitor != null) { - debug ("Directory %s gone, removing watch", + debug (_("Directory %s gone, removing watch"), file.get_uri ()); this.monitors.remove (file); file_monitor.cancel (); @@ -72,7 +72,7 @@ public class Rygel.MediaExportRecursiveFileMonitor : Object { file_monitor.changed.connect (this.on_monitor_changed); } } catch (Error err) { - warning ("Failed to get file info for %s", file.get_uri ()); + warning (_("Failed to get file info for %s"), file.get_uri ()); } } diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala index 82bb3ba..2701667 100644 --- a/src/plugins/media-export/rygel-media-export-root-container.vala +++ b/src/plugins/media-export/rygel-media-export-root-container.vala @@ -47,7 +47,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { // either an error occured or the gconf key is not set if (uris.size == 0) { - debug("Nothing configured, using XDG special directories"); + debug(_("Nothing configured, using XDG special directories")); UserDirectory[] xdg_directories = { UserDirectory.MUSIC, UserDirectory.PICTURES, UserDirectory.VIDEOS }; @@ -73,7 +73,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { MediaExportRootContainer.instance = new MediaExportRootContainer (); } catch (Error error) { - warning("Failed to create instance of database"); + warning(_("Failed to create instance of database")); MediaExportRootContainer.instance = new NullContainer (); } } @@ -94,7 +94,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { try { this.media_db.remove_by_id (id); } catch (Error error) { - warning ("Failed to remove uri: %s", error.message); + warning (_("Failed to remove uri: %s"), error.message); } } @@ -109,7 +109,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { return new MediaExportQueryContainer (this.media_db, id, - "Albums"); + _("Albums")); case "object.container.person.musicArtist": string id = "virtual-container:dc:creator,?,upnp:album,?"; @@ -117,7 +117,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { return new MediaExportQueryContainer (this.media_db, id, - "Artists"); + _("Artists")); default: return null; } @@ -300,7 +300,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { try { this.service = new MediaExportDBusService (this); } catch (Error err) { - warning ("Failed to create MediaExport DBus service: %s", + warning (_("Failed to create MediaExport DBus service: %s"), err.message); } this.dynamic_elements = new MediaExportDynamicContainer (db, this); @@ -343,7 +343,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { var info = container.split ("="); var id = MediaExportQueryContainer.PREFIX + info[1]; if (!MediaExportQueryContainer.validate_virtual_id (id)) { - warning ("%s is not a valid virtual id", id); + warning (_("%s is not a valid virtual id"), id); continue; } @@ -361,7 +361,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { ids.remove (id); } } catch (Error error) { - warning ("Got error while trying to find virtual folders: %s", + warning (_("Got error while trying to find virtual folders: %s"), error.message); } @@ -370,11 +370,11 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { continue; } - debug ("Id %s no longer in config, deleting...", id); + debug (_("Id %s no longer in config, deleting..."), id); try { this.media_db.remove_by_id (id); } catch (DatabaseError error) { - warning ("Failed to remove entry: %s", error.message); + warning (_("Failed to remove entry: %s"), error.message); } } @@ -383,7 +383,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { private void on_file_harvested (MediaExportHarvester harvester, File file) { - message ("'%s' harvested", file.get_uri ()); + message (_("'%s' harvested"), file.get_uri ()); this.harvester.remove (file); } @@ -395,13 +395,13 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { private void harvest (File file, MediaContainer parent = this) { if (this.extractor == null) { - warning ("No Metadata extractor available. Will not crawl"); + warning (_("No Metadata extractor available. Will not crawl")); return; } if (this.harvester.contains (file)) { - debug ("Already harvesting; cancelling"); + debug (_("Already harvesting; cancelling")); var harvester = this.harvester[file]; harvester.harvested.disconnect (this.on_file_harvested); harvester.cancellable.cancel (); @@ -424,8 +424,9 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { switch (event) { case FileMonitorEvent.CREATED: case FileMonitorEvent.CHANGES_DONE_HINT: - debug ("Trying to harvest %s because of %d", file.get_uri (), - event); + debug (_("Trying to harvest %s because of %d"), + file.get_uri (), + event); var parent = file.get_parent (); var id = Checksum.compute_for_string (ChecksumType.MD5, parent.get_uri ()); @@ -436,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 while getting parent container for " + + "filesystem event: %s"), error.message); } break; @@ -460,7 +461,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer { } } } catch (Error error) { - warning ("Error removing object from database: %s", + warning (_("Error removing object from database: %s"), error.message); } break; diff --git a/src/plugins/mediathek/rygel-mediathek-asx-playlist.vala b/src/plugins/mediathek/rygel-mediathek-asx-playlist.vala index 7e4a6e6..fa7ad6d 100644 --- a/src/plugins/mediathek/rygel-mediathek-asx-playlist.vala +++ b/src/plugins/mediathek/rygel-mediathek-asx-playlist.vala @@ -91,16 +91,18 @@ public class Rygel.MediathekAsxPlaylist : Object { else { throw new MediathekAsxPlaylistError.XML_ERROR ( - "Could not received XML"); + _("Could not received XML")); } } catch (RegexError error) { } } else { throw new MediathekAsxPlaylistError.NETWORK_ERROR ( - "Could not download playlist, error code was %u (%s)".printf ( - message.status_code, - Soup.status_get_phrase (message.status_code))); + _("Could not download playlist: " + + ", error code was %u (%s)"), + message.status_code, + Soup.status_get_phrase ( + message.status_code)); } } } diff --git a/src/plugins/mediathek/rygel-mediathek-plugin.vala b/src/plugins/mediathek/rygel-mediathek-plugin.vala index 20c9e0b..b4cdca6 100644 --- a/src/plugins/mediathek/rygel-mediathek-plugin.vala +++ b/src/plugins/mediathek/rygel-mediathek-plugin.vala @@ -26,7 +26,7 @@ using GUPnP; [ModuleInit] public void module_init (PluginLoader loader) { var plugin = new Plugin.MediaServer ("ZDFMediathek", - "ZDF Mediathek", + _("ZDF Mediathek"), typeof (Rygel.MediathekContentDir)); loader.add_plugin (plugin); } diff --git a/src/plugins/mediathek/rygel-mediathek-root-container.vala b/src/plugins/mediathek/rygel-mediathek-root-container.vala index b55e9b3..3d8a999 100644 --- a/src/plugins/mediathek/rygel-mediathek-root-container.vala +++ b/src/plugins/mediathek/rygel-mediathek-root-container.vala @@ -28,7 +28,7 @@ public class Rygel.MediathekRootContainer : Rygel.SimpleContainer { private static MediathekRootContainer instance; private bool on_schedule_update () { - message("Scheduling update for all feeds...."); + message(_("Scheduling update for all feeds....")); foreach (var container in this.children) { ((MediathekRssContainer) container).update (); } @@ -57,7 +57,8 @@ public class Rygel.MediathekRootContainer : Rygel.SimpleContainer { } if (feeds.size == 0) { - message ("Could not get RSS items from GConf, using defaults"); + message (_("Could not get RSS items from configuration," + + " using defaults")); feeds.add (508); } diff --git a/src/plugins/mediathek/rygel-mediathek-rss-container.vala b/src/plugins/mediathek/rygel-mediathek-rss-container.vala index 1681e77..d4c5b4e 100644 --- a/src/plugins/mediathek/rygel-mediathek-rss-container.vala +++ b/src/plugins/mediathek/rygel-mediathek-rss-container.vala @@ -31,7 +31,7 @@ public class Rygel.MediathekRssContainer : Rygel.SimpleContainer { private void on_feed_got (Soup.Session session, Soup.Message msg) { switch (msg.status_code) { case 304: - message("Feed has not changed, nothing to do"); + message(_("Feed has not changed, nothing to do")); break; case 200: if (parse_response ((string) msg.response_body.data, @@ -42,7 +42,7 @@ public class Rygel.MediathekRssContainer : Rygel.SimpleContainer { break; default: // TODO Need to handle redirects.... - warning("Got unexpected response %u (%s)", + warning(_("Got unexpected response %u (%s)"), msg.status_code, Soup.status_get_phrase (msg.status_code)); break; @@ -76,20 +76,20 @@ public class Rygel.MediathekRssContainer : Rygel.SimpleContainer { ret = true; } catch (MediathekVideoItemError error) { - warning ("Error creating video item: %s", + warning (_("Error creating video item: %s"), error.message); } } } else { - warning ("XPath query failed"); + warning (_("XPath query failed")); } delete doc; this.updated (); } else { - warning ("Failed to parse doc"); + warning (_("Failed to parse doc")); } return ret; @@ -100,7 +100,7 @@ public class Rygel.MediathekRssContainer : Rygel.SimpleContainer { "http://www.zdf.de/ZDFmediathek/content/%u?view=rss".printf( zdf_content_id)); if (last_modified != null) { - debug ("Requesting change since %s", + debug (_("Requesting change since %s"), last_modified.to_string(DateFormat.HTTP)); message.request_headers.append("If-Modified-Since", last_modified.to_string(DateFormat.HTTP)); @@ -112,9 +112,9 @@ public class Rygel.MediathekRssContainer : Rygel.SimpleContainer { } public MediathekRssContainer (MediaContainer parent, uint id) { - base ("GroupId:%u".printf(id), + base ("GroupId:%u".printf(id), parent, - "ZDF Mediathek RSS feed %u".printf(id)); + _("ZDF Mediathek RSS feed %u").printf (id)); this.zdf_content_id = id; update (); diff --git a/src/plugins/mediathek/rygel-mediathek-video-item.vala b/src/plugins/mediathek/rygel-mediathek-video-item.vala index 3bb25c4..54b6a12 100644 --- a/src/plugins/mediathek/rygel-mediathek-video-item.vala +++ b/src/plugins/mediathek/rygel-mediathek-video-item.vala @@ -35,7 +35,7 @@ public class Rygel.MediathekVideoItem : Rygel.MediaItem { MediaItem.VIDEO_CLASS); this.mime_type = "video/x-ms-wmv"; - this.author = "ZDF - Zweites Deutsches Fernsehen"; + this.author = _("ZDF - Second German TV Channel Streams"); } private static bool namespace_ok(Xml.Node* node) { @@ -61,12 +61,12 @@ public class Rygel.MediathekVideoItem : Rygel.MediaItem { } else { throw new MediathekVideoItemError.XML_PARSE_ERROR ( - "group node has url property"); + _("group node has url property")); } } else { throw new MediathekVideoItemError.XML_PARSE_ERROR ( - "invalid or no namespace"); + _("invalid or no namespace")); } return asx; @@ -100,7 +100,8 @@ public class Rygel.MediathekVideoItem : Rygel.MediaItem { } else { throw new MediathekVideoItemError.XML_PARSE_ERROR ( - "invalid or no namespace on group node"); + _("Invalid or no namespace" + + " on group node")); } break; default: @@ -109,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); diff --git a/src/plugins/tracker/rygel-tracker-category-all-container.vala b/src/plugins/tracker/rygel-tracker-category-all-container.vala index 02406f2..345eec9 100644 --- a/src/plugins/tracker/rygel-tracker-category-all-container.vala +++ b/src/plugins/tracker/rygel-tracker-category-all-container.vala @@ -35,7 +35,7 @@ public class Rygel.TrackerCategoryAllContainer : Rygel.TrackerSearchContainer { var uri = Filename.to_uri (item_factory.upload_dir, null); this.uris.add (uri); } catch (ConvertError error) { - warning ("Failed to contstruct URI for directory '%s': %s", + warning (_("Failed to contstruct URI for directory '%s': %s"), item_factory.upload_dir, error.message); } diff --git a/src/plugins/tracker/rygel-tracker-insertion-query.vala b/src/plugins/tracker/rygel-tracker-insertion-query.vala index 4130ec2..f6d05b5 100644 --- a/src/plugins/tracker/rygel-tracker-insertion-query.vala +++ b/src/plugins/tracker/rygel-tracker-insertion-query.vala @@ -67,7 +67,7 @@ public class Rygel.TrackerInsertionQuery : Rygel.TrackerQuery { throws DBus.Error { var str = this.to_string (); - debug ("Executing SPARQL query: %s", str); + debug (_("Executing SPARQL query: %s"), str); var result = yield resources.sparql_update_blank (str); diff --git a/src/plugins/tracker/rygel-tracker-item-creation.vala b/src/plugins/tracker/rygel-tracker-item-creation.vala index f69f269..58778f1 100644 --- a/src/plugins/tracker/rygel-tracker-item-creation.vala +++ b/src/plugins/tracker/rygel-tracker-item-creation.vala @@ -74,8 +74,8 @@ public class Rygel.TrackerItemCreation : GLib.Object, Rygel.StateMachine { var dir = yield this.container.get_writable (cancellable); if (dir == null) { throw new ContentDirectoryError.RESTRICTED_PARENT ( - "Object creation in %s no allowed", - this.container.id); + _("Object creation in %s no allowed"), + this.container.id); } var file = dir.get_child_for_display_name (this.item.title); diff --git a/src/plugins/tracker/rygel-tracker-metadata-values.vala b/src/plugins/tracker/rygel-tracker-metadata-values.vala index 941a693..245e991 100644 --- a/src/plugins/tracker/rygel-tracker-metadata-values.vala +++ b/src/plugins/tracker/rygel-tracker-metadata-values.vala @@ -72,7 +72,7 @@ public class Rygel.TrackerMetadataValues : Rygel.SimpleContainer { try { this.create_proxies (); } catch (DBus.Error error) { - critical ("Failed to create to Session bus: %s\n", + critical (_("Failed to create to Session bus: %s"), error.message); return; @@ -130,7 +130,7 @@ public class Rygel.TrackerMetadataValues : Rygel.SimpleContainer { try { yield query.execute (this.resources); } catch (DBus.Error error) { - critical ("error getting all values for '%s': %s", + critical (_("Error getting all values for '%s': %s"), string.joinv (" -> ", this.key_chain), error.message); diff --git a/src/plugins/tracker/rygel-tracker-music.vala b/src/plugins/tracker/rygel-tracker-music.vala index 574fb3a..9112039 100644 --- a/src/plugins/tracker/rygel-tracker-music.vala +++ b/src/plugins/tracker/rygel-tracker-music.vala @@ -37,14 +37,14 @@ public class Rygel.TrackerMusic : Rygel.TrackerCategoryContainer { null }; this.add_child (new TrackerMetadataValues (id + "Artists", this, - "Artists", + _("Artists"), this.item_factory, key_chain)); key_chain = new string[] { "nmm:musicAlbum", "nmm:albumTitle", null }; this.add_child (new TrackerMetadataValues (id + "Albums", this, - "Albums", + _("Albums"), this.item_factory, key_chain)); this.add_child (new TrackerTags (this, item_factory)); diff --git a/src/plugins/tracker/rygel-tracker-plugin-factory.vala b/src/plugins/tracker/rygel-tracker-plugin-factory.vala index 5558fdc..9871fbb 100644 --- a/src/plugins/tracker/rygel-tracker-plugin-factory.vala +++ b/src/plugins/tracker/rygel-tracker-plugin-factory.vala @@ -33,9 +33,9 @@ public void module_init (PluginLoader loader) { try { plugin_factory = new TrackerPluginFactory (loader); } catch (DBus.Error err) { - warning ("Failed to start Tracker service: " + + warning (_("Failed to start Tracker service: ") + err.message + - ". Tracker plugin disabled."); + _(". Tracker plugin disabled.")); } } diff --git a/src/plugins/tracker/rygel-tracker-plugin.vala b/src/plugins/tracker/rygel-tracker-plugin.vala index d95ec8c..5d766de 100644 --- a/src/plugins/tracker/rygel-tracker-plugin.vala +++ b/src/plugins/tracker/rygel-tracker-plugin.vala @@ -30,7 +30,7 @@ public class Rygel.TrackerPlugin : Rygel.Plugin { public TrackerPlugin () { base.MediaServer ("Tracker", - "@REALNAME@'s media", + _("@REALNAME@'s media"), typeof (MediaTracker)); var icon_info = new IconInfo ("image/png"); @@ -43,7 +43,7 @@ public class Rygel.TrackerPlugin : Rygel.Plugin { this.add_icon (icon_info); } catch (ConvertError err) { - warning ("Error creating URI from %s: %s", ICON, err.message); + warning (_("Error creating URI from %s: %s"), ICON, err.message); } } } diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala index e307c6c..8ac5950 100644 --- a/src/plugins/tracker/rygel-tracker-search-container.vala +++ b/src/plugins/tracker/rygel-tracker-search-container.vala @@ -105,7 +105,7 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer { this.get_children_count.begin (); } catch (DBus.Error error) { - critical ("Failed to connect to session bus: %s\n", error.message); + critical (_("Failed to connect to session bus: %s"), error.message); } } @@ -206,7 +206,7 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer { this.child_count = query.result[0,0].to_int (); this.updated (); } catch (GLib.Error error) { - critical ("error getting item count under category '%s': %s", + critical (_("Error getting item count under category '%s': %s"), this.item_factory.category, error.message); diff --git a/src/plugins/tracker/rygel-tracker-selection-query.vala b/src/plugins/tracker/rygel-tracker-selection-query.vala index 7f562ec..a268ea0 100644 --- a/src/plugins/tracker/rygel-tracker-selection-query.vala +++ b/src/plugins/tracker/rygel-tracker-selection-query.vala @@ -70,7 +70,7 @@ public class Rygel.TrackerSelectionQuery : Rygel.TrackerQuery { throws DBus.Error { var str = this.to_string (); - debug ("Executing SPARQL query: %s", str); + debug (_("Executing SPARQL query: %s"), str); result = yield resources.sparql_query (str); } diff --git a/src/plugins/tracker/rygel-tracker-years.vala b/src/plugins/tracker/rygel-tracker-years.vala index 92aeed4..d7dc246 100644 --- a/src/plugins/tracker/rygel-tracker-years.vala +++ b/src/plugins/tracker/rygel-tracker-years.vala @@ -33,7 +33,7 @@ public class Rygel.TrackerYears : Rygel.TrackerMetadataValues { TrackerItemFactory item_factory) { base (parent.id + "Year", parent, - "Year", + _("Year"), item_factory, KEY_CHAIN, year_id_func, diff --git a/src/rygel/rygel-browse.vala b/src/rygel/rygel-browse.vala index b47e135..094c98f 100644 --- a/src/rygel/rygel-browse.vala +++ b/src/rygel/rygel-browse.vala @@ -117,7 +117,7 @@ internal class Rygel.Browse: GLib.Object, Rygel.StateMachine { this.browse_flag == "BrowseMetadata") { this.fetch_metadata = true; } else { - throw new ContentDirectoryError.INVALID_ARGS ("Invalid Args"); + throw new ContentDirectoryError.INVALID_ARGS (_("Invalid Args")); } /* ObjectID */ @@ -136,7 +136,8 @@ internal class Rygel.Browse: GLib.Object, Rygel.StateMachine { if (this.object_id == null) { // Sorry we can't do anything without ObjectID - throw new ContentDirectoryError.NO_SUCH_OBJECT ("No such object"); + throw new ContentDirectoryError.NO_SUCH_OBJECT ( + _("No such object")); } } @@ -149,7 +150,7 @@ internal class Rygel.Browse: GLib.Object, Rygel.StateMachine { this.cancellable); if (media_object == null) { throw new ContentDirectoryError.NO_SUCH_OBJECT ( - "No such object"); + _("No such object")); } return media_object; @@ -178,7 +179,8 @@ internal class Rygel.Browse: GLib.Object, Rygel.StateMachine { MediaObject media_object) throws Error { if (!(media_object is MediaContainer)) { - throw new ContentDirectoryError.NO_SUCH_OBJECT ("No such object"); + throw new ContentDirectoryError.NO_SUCH_OBJECT ( + _("No such object")); } var container = (MediaContainer) media_object; @@ -221,12 +223,12 @@ internal class Rygel.Browse: GLib.Object, Rygel.StateMachine { private void handle_error (Error error) { if (error is ContentDirectoryError) { - warning ("Failed to browse '%s': %s\n", + warning (_("Failed to browse '%s': %s\n"), this.object_id, error.message); this.action.return_error (error.code, error.message); } else { - warning ("Failed to browse '%s': %s\n", + warning (_("Failed to browse '%s': %s\n"), this.object_id, error.message); this.action.return_error (701, error.message); diff --git a/src/rygel/rygel-cmdline-config.vala b/src/rygel/rygel-cmdline-config.vala index 7ee7541..95cc05e 100644 --- a/src/rygel/rygel-cmdline-config.vala +++ b/src/rygel/rygel-cmdline-config.vala @@ -117,12 +117,12 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { // Why would someone lauch rygel to kill itself? public bool get_upnp_enabled () throws GLib.Error { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } public string get_interface () throws GLib.Error { if (iface == null) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return iface; @@ -130,7 +130,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { public int get_port () throws GLib.Error { if (this.port == -1) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return port; @@ -138,7 +138,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { public bool get_transcoding () throws GLib.Error { if (!no_transcoding) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } else { return false; } @@ -146,7 +146,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { public bool get_mp3_transcoder () throws GLib.Error { if (!no_mp3_trans) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } else { return false; } @@ -154,7 +154,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { public bool get_mp2ts_transcoder () throws GLib.Error { if (!no_mp2ts_trans) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } else { return false; } @@ -162,7 +162,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { public bool get_lpcm_transcoder () throws GLib.Error { if (!no_lpcm_trans) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } else { return false; } @@ -174,7 +174,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { public LogLevel get_log_level () throws GLib.Error { if (this.log_level == LogLevel.INVALID) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return log_level; @@ -192,7 +192,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (disabled) { return false; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } @@ -211,7 +211,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (title != null) { return title; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } @@ -235,7 +235,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (value != null) { return value; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } @@ -261,7 +261,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (value != null) { return value; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } @@ -290,7 +290,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (value_set) { return value; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } @@ -316,7 +316,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (value != null) { return value; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } @@ -341,7 +341,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { if (value_set) { return value; } else { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } } } diff --git a/src/rygel/rygel-connection-manager.vala b/src/rygel/rygel-connection-manager.vala index d73a8e4..c6d2cee 100644 --- a/src/rygel/rygel-connection-manager.vala +++ b/src/rygel/rygel-connection-manager.vala @@ -99,7 +99,7 @@ public class Rygel.ConnectionManager : Service { action.get ("ConnectionID", typeof (int), out connection_id); if (connection_id != 0) { - action.return_error (706, "Invalid connection reference"); + action.return_error (706, _("Invalid connection reference")); return; } diff --git a/src/rygel/rygel-content-directory.vala b/src/rygel/rygel-content-directory.vala index 97d5870..52857b2 100644 --- a/src/rygel/rygel-content-directory.vala +++ b/src/rygel/rygel-content-directory.vala @@ -81,7 +81,7 @@ public class Rygel.ContentDirectory: Service { try { this.http_server = new HTTPServer (this, this.get_type ().name ()); } catch (GLib.Error err) { - critical ("Failed to create HTTP server for %s: %s", + critical (_("Failed to create HTTP server for %s: %s"), this.get_type ().name (), err.message); return; @@ -207,7 +207,7 @@ public class Rygel.ContentDirectory: Service { action.return (); } else { - action.return_error (717, "No such file transfer"); + action.return_error (717, _("No such file transfer")); } } @@ -220,7 +220,7 @@ public class Rygel.ContentDirectory: Service { action.return (); } else { - action.return_error (717, "No such file transfer"); + action.return_error (717, _("No such file transfer")); } } diff --git a/src/rygel/rygel-database.vala b/src/rygel/rygel-database.vala index 6415f32..e603108 100644 --- a/src/rygel/rygel-database.vala +++ b/src/rygel/rygel-database.vala @@ -54,14 +54,13 @@ internal class Rygel.Database : Object { "rygel"); DirUtils.create_with_parents (dirname, 0750); var db_file = Path.build_filename (dirname, "%s.db".printf (name)); - debug ("Using database file %s", db_file); + debug (_("Using database file %s"), db_file); var rc = Sqlite.Database.open (db_file, out this.db); if (rc != Sqlite.OK) { - var msg = "Failed to open database: %d, %s".printf ( - rc, - db.errmsg ()); - - throw new DatabaseError.IO_ERROR (msg); + throw new DatabaseError.IO_ERROR (_("Failed to open database: " + + "%d (%s)"), + rc, + db.errmsg ()); } this.db.exec ("PRAGMA cache_size = 32768"); @@ -116,7 +115,7 @@ internal class Rygel.Database : Object { throw new DatabaseError.SQLITE_ERROR (db.errmsg ()); } #if RYGEL_DEBUG_SQL - debug ("Query: %s, Time: %f", sql, t.elapsed ()); + debug (_("Query: %s, Time: %f"), sql, t.elapsed ()); #endif return rc; @@ -162,7 +161,7 @@ internal class Rygel.Database : Object { } } else { var t = values[i].type (); - warning ("Unsupported type %s", t.name ()); + warning (_("Unsupported type %s"), t.name ()); assert_not_reached (); } if (rc != Sqlite.OK) { @@ -215,7 +214,7 @@ internal class Rygel.Database : Object { */ public void rollback () { if (this.db.exec ("ROLLBACK") != Sqlite.OK) { - critical ("Failed to rollback transaction: %s", + critical (_("Failed to rollback transaction: %s"), db.errmsg ()); } } diff --git a/src/rygel/rygel-dbus-service.vala b/src/rygel/rygel-dbus-service.vala index 6a2c6bf..7d06aab 100644 --- a/src/rygel/rygel-dbus-service.vala +++ b/src/rygel/rygel-dbus-service.vala @@ -42,7 +42,8 @@ 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); diff --git a/src/rygel/rygel-didl-lite-writer.vala b/src/rygel/rygel-didl-lite-writer.vala index 7e5e7dc..31b51e2 100644 --- a/src/rygel/rygel-didl-lite-writer.vala +++ b/src/rygel/rygel-didl-lite-writer.vala @@ -45,7 +45,7 @@ internal class Rygel.DIDLLiteWriter : GUPnP.DIDLLiteWriter { this.serialize_container ((MediaContainer) media_object); } else { throw new DIDLLiteWriterError.UNSUPPORTED_OBJECT ( - "Unable to serialize unsupported object"); + _("Unable to serialize unsupported object")); } } diff --git a/src/rygel/rygel-gst-utils.vala b/src/rygel/rygel-gst-utils.vala index 218ec60..1d53068 100644 --- a/src/rygel/rygel-gst-utils.vala +++ b/src/rygel/rygel-gst-utils.vala @@ -34,8 +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 " + - factoryname + " missing"); + throw new GstError.MISSING_PLUGIN (_("Required element factory" + + " %s missing"), + factoryname); } return element; diff --git a/src/rygel/rygel-http-byte-seek.vala b/src/rygel/rygel-http-byte-seek.vala index 51ea055..0876eb7 100644 --- a/src/rygel/rygel-http-byte-seek.vala +++ b/src/rygel/rygel-http-byte-seek.vala @@ -40,13 +40,13 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek { if (range != null) { // We have a Range header. Parse. if (!range.has_prefix ("bytes=")) { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } range_tokens = range.offset (6).split ("-", 2); if (range_tokens[0] == null || range_tokens[1] == null) { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } @@ -55,7 +55,7 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek { if (pos[0].isdigit ()) { start = pos.to_int64 (); } else if (pos != "") { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } @@ -64,11 +64,12 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek { if (pos[0].isdigit ()) { stop = pos.to_int64 (); if (stop < start) { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", - range); + throw new HTTPSeekError.INVALID_RANGE ( + _("Invalid Range '%s'"), + range); } } else if (pos != "") { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } } diff --git a/src/rygel/rygel-http-get-handler.vala b/src/rygel/rygel-http-get-handler.vala index 4beeea5..99a0adc 100644 --- a/src/rygel/rygel-http-get-handler.vala +++ b/src/rygel/rygel-http-get-handler.vala @@ -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 diff --git a/src/rygel/rygel-http-get.vala b/src/rygel/rygel-http-get.vala index e3c5ee8..06e9412 100644 --- a/src/rygel/rygel-http-get.vala +++ b/src/rygel/rygel-http-get.vala @@ -58,8 +58,8 @@ internal class Rygel.HTTPGet : HTTPRequest { /* We only entertain 'HEAD' and 'GET' requests */ if ((this.msg.method != "HEAD" && this.msg.method != "GET") || (header != null && header != "1")) { - this.handle_error ( - new HTTPRequestError.BAD_REQUEST ("Invalid Request")); + this.handle_error (new HTTPRequestError.BAD_REQUEST ( + _("Invalid Request"))); return; } @@ -71,7 +71,7 @@ internal class Rygel.HTTPGet : HTTPRequest { this.cancellable); } } catch (Error err) { - warning ("Failed to parse query: %s", err.message); + warning (_("Failed to parse query: %s"), err.message); } if (this.handler == null) { @@ -102,7 +102,7 @@ internal class Rygel.HTTPGet : HTTPRequest { // Add headers this.handler.add_response_headers (this); - debug ("Following HTTP headers appended to response:"); + debug (_("Following HTTP headers appended to response:")); this.msg.response_headers.foreach ((name, value) => { debug ("%s : %s", name, value); }); diff --git a/src/rygel/rygel-http-identity-handler.vala b/src/rygel/rygel-http-identity-handler.vala index 640b1f5..4c3e7ca 100644 --- a/src/rygel/rygel-http-identity-handler.vala +++ b/src/rygel/rygel-http-identity-handler.vala @@ -94,7 +94,7 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler { if (item.should_stream ()) { Gst.Element src = item.create_stream_source (); if (src == null) { - throw new HTTPRequestError.NOT_FOUND ("Not found"); + throw new HTTPRequestError.NOT_FOUND (_("Not found")); } return new LiveResponse (request.server, @@ -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\n", - item.id); + throw new HTTPRequestError.NOT_FOUND (_("Requested item '%s' " + + "didn't provide a URI"), + item.id); } return new SeekableResponse (request.server, diff --git a/src/rygel/rygel-http-item-uri.vala b/src/rygel/rygel-http-item-uri.vala index 7cf8980..4b0a66f 100644 --- a/src/rygel/rygel-http-item-uri.vala +++ b/src/rygel/rygel-http-item-uri.vala @@ -55,7 +55,7 @@ internal class Rygel.HTTPItemURI : Object { var parts = request_uri.split ("/"); if (parts.length < 2 || parts.length % 2 == 0) { - throw new HTTPRequestError.BAD_REQUEST ("Invalid URI '%s'", + throw new HTTPRequestError.BAD_REQUEST (_("Invalid URI '%s'"), request_uri); } @@ -86,7 +86,7 @@ internal class Rygel.HTTPItemURI : Object { } if (this.item_id == null) { - throw new HTTPRequestError.NOT_FOUND ("Not Found"); + throw new HTTPRequestError.NOT_FOUND (_("Not Found")); } } diff --git a/src/rygel/rygel-http-post.vala b/src/rygel/rygel-http-post.vala index 26f3dab..524fb15 100644 --- a/src/rygel/rygel-http-post.vala +++ b/src/rygel/rygel-http-post.vala @@ -51,7 +51,7 @@ internal class Rygel.HTTPPost : HTTPRequest { this.file = yield this.item.get_writable (this.cancellable); if (this.file == null) { throw new HTTPRequestError.BAD_REQUEST ( - "No writable URI for %s available", + _("No writable URI for %s available"), this.item.id); } diff --git a/src/rygel/rygel-http-request.vala b/src/rygel/rygel-http-request.vala index c510ecc..35dd24f 100644 --- a/src/rygel/rygel-http-request.vala +++ b/src/rygel/rygel-http-request.vala @@ -85,7 +85,7 @@ internal abstract class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine { if (media_object == null || !(media_object is MediaItem)) { this.handle_error (new HTTPRequestError.NOT_FOUND ( - "requested item '%s' not found", + _("Requested item '%s' not found"), this.uri.item_id)); return; } diff --git a/src/rygel/rygel-http-server.vala b/src/rygel/rygel-http-server.vala index 3f8a157..1b8941f 100644 --- a/src/rygel/rygel-http-server.vala +++ b/src/rygel/rygel-http-server.vala @@ -175,7 +175,7 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine { private void on_request_completed (HTTPRequest request) { this.requests.remove (request); - debug ("HTTP %s request for URI '%s' handled.", + debug (_("HTTP %s request for URI '%s' handled."), request.msg.method, request.msg.get_uri ().to_string (false)); } @@ -185,7 +185,7 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine { string server_path, HashTable? query, Soup.ClientContext soup_client) { - debug ("HTTP %s request for URI '%s'. Headers:", + debug (_("HTTP %s request for URI '%s'. Headers:"), msg.method, msg.get_uri ().to_string (false)); msg.request_headers.foreach ((name, value) => { @@ -201,7 +201,7 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine { foreach (var request in this.requests) { if (request.msg == message) { request.cancellable.cancel (); - debug ("HTTP client aborted %s request for URI '%s'.", + debug (_("HTTP client aborted %s request for URI '%s'."), request.msg.method, request.msg.get_uri ().to_string (false)); @@ -219,7 +219,7 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine { private void on_got_headers (Soup.Message msg) { if (msg.method == "POST" && msg.uri.path.has_prefix (this.path_root)) { - debug ("HTTP POST request for URI '%s'", + debug (_("HTTP POST request for URI '%s'"), msg.get_uri ().to_string (false)); this.queue_request (new HTTPPost (this, this.context.server, msg)); diff --git a/src/rygel/rygel-http-time-seek.vala b/src/rygel/rygel-http-time-seek.vala index a855f3c..4f395db 100644 --- a/src/rygel/rygel-http-time-seek.vala +++ b/src/rygel/rygel-http-time-seek.vala @@ -47,7 +47,7 @@ internal class Rygel.HTTPTimeSeek : Rygel.HTTPSeek { range_tokens = range.offset (4).split ("-", 2); if (range_tokens[0] == null || range_tokens[1] == null) { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } @@ -56,7 +56,7 @@ internal class Rygel.HTTPTimeSeek : Rygel.HTTPSeek { if (time[0].isdigit ()) { start = (int64) (time.to_double () * SECOND); } else if (time != "") { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } @@ -65,11 +65,12 @@ internal class Rygel.HTTPTimeSeek : Rygel.HTTPSeek { if (time[0].isdigit()) { stop = (int64) (time.to_double () * SECOND); if (stop < start) { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", - range); + throw new HTTPSeekError.INVALID_RANGE ( + _("Invalid Range '%s'"), + range); } } else if (time != "") { - throw new HTTPSeekError.INVALID_RANGE ("Invalid Range '%s'", + throw new HTTPSeekError.INVALID_RANGE (_("Invalid Range '%s'"), range); } } diff --git a/src/rygel/rygel-http-transcode-handler.vala b/src/rygel/rygel-http-transcode-handler.vala index 1b732de..0e4e791 100644 --- a/src/rygel/rygel-http-transcode-handler.vala +++ b/src/rygel/rygel-http-transcode-handler.vala @@ -53,7 +53,7 @@ internal class Rygel.HTTPTranscodeHandler : HTTPGetHandler { var item = request.item; var src = item.create_stream_source (); if (src == null) { - throw new HTTPRequestError.NOT_FOUND ("Not found"); + throw new HTTPRequestError.NOT_FOUND (_("Not found")); } try { diff --git a/src/rygel/rygel-import-resource.vala b/src/rygel/rygel-import-resource.vala index e6c3b44..5a8b711 100644 --- a/src/rygel/rygel-import-resource.vala +++ b/src/rygel/rygel-import-resource.vala @@ -105,7 +105,7 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine { try { destination_uri = yield this.get_original_uri (); } catch (Error error) { - warning ("Failed to get original URI for '%s': %s", + warning (_("Failed to get original URI for '%s': %s"), this.destination_uri, error.message); @@ -135,7 +135,7 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine { this.status = TransferStatus.COMPLETED; - debug ("Import of '%s' to '%s' completed", + debug (_("Import of '%s' to '%s' completed"), source_uri, destination_uri); this.completed (); diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala index ba7bfec..855956a 100644 --- a/src/rygel/rygel-item-creator.vala +++ b/src/rygel/rygel-item-creator.vala @@ -64,9 +64,10 @@ 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: " + - this.elements); + throw new ItemCreatorError.PARSE ( + _("Failed to find any item in " + + "DIDL-Lite from client: '%s'"), + this.elements); } this.item = new MediaItem (didl_item.id, @@ -93,7 +94,8 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine { if (this.container_id == null || this.elements == null) { // Sorry we can't do anything without ContainerID - throw new ContentDirectoryError.NO_SUCH_OBJECT ("No such object"); + throw new ContentDirectoryError.NO_SUCH_OBJECT ( + _("No such object")); } } @@ -102,7 +104,8 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine { this.container_id, this.cancellable); if (media_object == null || !(media_object is MediaContainer)) { - throw new ContentDirectoryError.NO_SUCH_OBJECT ("No such object"); + throw new ContentDirectoryError.NO_SUCH_OBJECT ( + _("No such object")); } return media_object as MediaContainer; @@ -127,7 +130,7 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine { this.action.return_error (701, error.message); } - warning ("Failed to create item under '%s': %s", + warning (_("Failed to create item under '%s': %s"), this.container_id, error.message); diff --git a/src/rygel/rygel-l16-transcoder-bin.vala b/src/rygel/rygel-l16-transcoder-bin.vala index cfbbbf3..327222d 100644 --- a/src/rygel/rygel-l16-transcoder-bin.vala +++ b/src/rygel/rygel-l16-transcoder-bin.vala @@ -62,10 +62,10 @@ internal class Rygel.L16TranscoderBin : Gst.Bin { if (new_pad.link (enc_pad) != PadLinkReturn.OK) { GstUtils.post_error (this, - new GstError.LINK ("Failed to link pad " + - new_pad.name + - " to " + - enc_pad.name)); + new GstError.LINK ( + _("Failed to link pad %s to %s"), + new_pad.name, + enc_pad.name)); return; } } diff --git a/src/rygel/rygel-live-response.vala b/src/rygel/rygel-live-response.vala index 2ad9b70..ab2a064 100644 --- a/src/rygel/rygel-live-response.vala +++ b/src/rygel/rygel-live-response.vala @@ -80,8 +80,8 @@ 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 (_("Required plugin " + + "'fakesink' missing")); } sink.signal_handoffs = true; @@ -98,8 +98,8 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { } else { // static pads? easy! if (!src.link (sink)) { - throw new GstError.LINK ("Failed to link " + - src.name + " to " + + throw new GstError.LINK (_("Failed to link %s to %s"), + src.name, sink.name); } } @@ -120,7 +120,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { if (depay != null) { this.pipeline.add (depay); if (!depay.link (sink)) { - critical ("Failed to link %s to %s", + critical (_("Failed to link %s to %s"), depay.name, sink.name); this.end (false, Soup.KnownStatusCode.NONE); @@ -133,7 +133,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { } if (src_pad.link (sink_pad) != PadLinkReturn.OK) { - critical ("Failed to link pad %s to %s", + critical (_("Failed to link pad %s to %s"), src_pad.name, sink_pad.name); this.end (false, Soup.KnownStatusCode.NONE); @@ -187,14 +187,14 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { if (message.type == MessageType.ERROR) { message.parse_error (out err, out err_msg); - critical ("Error from pipeline %s:%s", + critical (_("Error from pipeline %s: %s"), this.pipeline.name, err_msg); ret = false; } else if (message.type == MessageType.WARNING) { message.parse_warning (out err, out err_msg); - warning ("Warning from pipeline %s:%s", + warning (_("Warning from pipeline %s: %s"), this.pipeline.name, err_msg); } @@ -228,7 +228,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { this.time_range.start, stop_type, this.time_range.stop)) { - warning ("Failed to seek to offset %lld", this.time_range.start); + warning (_("Failed to seek to offset %lld"), this.time_range.start); this.end (false, Soup.KnownStatusCode.REQUESTED_RANGE_NOT_SATISFIABLE); diff --git a/src/rygel/rygel-log-handler.vala b/src/rygel/rygel-log-handler.vala index c6380cd..7a498f7 100644 --- a/src/rygel/rygel-log-handler.vala +++ b/src/rygel/rygel-log-handler.vala @@ -59,7 +59,8 @@ 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 sources: %s"), err.message); } diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala index 3546822..1899315 100644 --- a/src/rygel/rygel-main.vala +++ b/src/rygel/rygel-main.vala @@ -104,7 +104,7 @@ public class Rygel.Main : Object { GUPnP.Context context) { string iface = null; - debug ("new network context %s (%s) available.", + debug (_("new network context %s (%s) available."), context.interface, context.host_ip); @@ -122,11 +122,11 @@ public class Rygel.Main : Object { this.create_device.begin (iterator.get (), factory); } } catch (GLib.Error err) { - warning ("Failed to create root device factory: %s\n", + warning (_("Failed to create root device factory: %s"), err.message); } } else { - debug ("Ignoring network context %s (%s).", + debug (_("Ignoring network context %s (%s)."), context.interface, context.host_ip); } @@ -134,7 +134,7 @@ public class Rygel.Main : Object { private void on_context_unavailable (GUPnP.ContextManager manager, GUPnP.Context context) { - debug ("Network context %s (%s) now unavailable.", + debug (_("Network context %s (%s) now unavailable."), context.interface, context.host_ip); @@ -173,9 +173,9 @@ public class Rygel.Main : Object { plugin.notify["available"] += this.on_plugin_notify; } catch (GLib.Error error) { - warning ("Failed to create RootDevice for %s. Reason: %s\n", - plugin.name, - error.message); + warning (_("Failed to create RootDevice for %s. Reason: %s"), + plugin.name, + error.message); } } @@ -205,7 +205,7 @@ public class Rygel.Main : Object { main = new Main (); service = new DBusService (main); } catch (DBus.Error err) { - warning ("Failed to start D-Bus service: %s", err.message); + warning (_("Failed to start D-Bus service: %s"), err.message); } catch (CmdlineConfigError.VERSION_ONLY err) { return 0; } catch (GLib.Error err) { diff --git a/src/rygel/rygel-media-container.vala b/src/rygel/rygel-media-container.vala index ad06251..7cb309b 100644 --- a/src/rygel/rygel-media-container.vala +++ b/src/rygel/rygel-media-container.vala @@ -177,7 +177,7 @@ public abstract class Rygel.MediaContainer : MediaObject { var dir = yield this.get_writable (cancellable); if (dir == null) { throw new ContentDirectoryError.RESTRICTED_PARENT ( - "Object creation in %s no allowed", + _("Object creation in %s no allowed"), this.id); } diff --git a/src/rygel/rygel-media-db.vala b/src/rygel/rygel-media-db.vala index c1f527f..0ceb20b 100644 --- a/src/rygel/rygel-media-db.vala +++ b/src/rygel/rygel-media-db.vala @@ -260,7 +260,7 @@ public class Rygel.MediaDB : Object { } else if (object is MediaContainer) { container_removed (object.id); } else { - throw new MediaDBError.INVALID_TYPE ("Invalid object type"); + throw new MediaDBError.INVALID_TYPE (_("Invalid object type")); } } @@ -289,7 +289,7 @@ public class Rygel.MediaDB : Object { object_added (item.id); item_added (item.id); } catch (DatabaseError error) { - warning ("Failed to add item with id %s: %s", + warning (_("Failed to add item with id %s: %s"), item.id, error.message); db.rollback (); @@ -315,7 +315,7 @@ public class Rygel.MediaDB : Object { container_updated (object.id); } } catch (Error error) { - warning ("Failed to add item with id %s: %s", + warning (_("Failed to add item with id %s: %s"), object.id, error.message); db.rollback (); @@ -348,8 +348,8 @@ 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 with id %s is not" + + " a MediaItem"), item_id); } @@ -450,8 +450,8 @@ public class Rygel.MediaDB : Object { return new Gee.ArrayList (); } - debug ("Orignal search: %s", expression.to_string ()); - debug ("Parsed search expression: %s", filter); + debug (_("Orignal search: %s"), expression.to_string ()); + debug (_("Parsed search expression: %s"), filter); for (int i = 0; i < args.n_values; i++) { debug ("Arg %d: %s", i, args.get_nth (i).get_string ()); diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala index 85e0eac..ffbcb77 100644 --- a/src/rygel/rygel-media-item.vala +++ b/src/rygel/rygel-media-item.vala @@ -242,7 +242,7 @@ public class Rygel.MediaItem : MediaObject { private string get_protocol_for_uri (string uri) throws Error { var scheme = Uri.parse_scheme (uri); if (scheme == null) { - throw new MediaItemError.BAD_URI ("Bad URI: %s", uri); + throw new MediaItemError.BAD_URI (_("Bad URI: %s"), uri); } if (scheme == "http") { @@ -254,7 +254,7 @@ public class Rygel.MediaItem : MediaObject { return "rtsp-rtp-udp"; } else { // Assume the protocol to be the scheme of the URI - warning ("Failed to probe protocol for URI %s. Assuming '%s'", + warning (_("Failed to probe protocol for URI %s. Assuming '%s'"), uri, scheme); diff --git a/src/rygel/rygel-meta-config.vala b/src/rygel/rygel-meta-config.vala index 34390ee..f7e38c7 100644 --- a/src/rygel/rygel-meta-config.vala +++ b/src/rygel/rygel-meta-config.vala @@ -54,7 +54,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { var user_config = UserConfig.get_default (); this.configs.add (user_config); } catch (Error err) { - warning ("Failed to load user configuration: %s", err.message); + warning (_("Failed to load user configuration: %s"), err.message); } } @@ -71,7 +71,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -90,7 +90,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -109,7 +109,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -128,7 +128,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -147,7 +147,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -166,7 +166,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -185,7 +185,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -204,7 +204,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -223,7 +223,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET ("No value available"); + throw new ConfigurationError.NO_VALUE_SET (_("No value available")); } return val; @@ -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 available" + + " 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 available" + + " for '%s/enabled'"), + section); } return val; @@ -282,7 +282,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { if (val == null) { throw new ConfigurationError.NO_VALUE_SET ( - "No value available for '%s/%s'", + _("No value available for '%s/%s'"), section, key); } @@ -304,7 +304,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { if (val == null) { throw new ConfigurationError.NO_VALUE_SET ( - "No value available for '%s/%s'", + _("No value available for '%s/%s'"), section, key); } @@ -330,7 +330,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { if (unavailable) { throw new ConfigurationError.NO_VALUE_SET ( - "No value available for '%s/%s'", + _("No value available for '%s/%s'"), section, key); } @@ -352,7 +352,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { if (val == null) { throw new ConfigurationError.NO_VALUE_SET ( - "No value available for '%s/%s'", + _("No value available for '%s/%s'"), section, key); } @@ -376,7 +376,7 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { if (unavailable) { throw new ConfigurationError.NO_VALUE_SET ( - "No value available for '%s/%s'", + _("No value available for '%s/%s'"), section, key); } diff --git a/src/rygel/rygel-metadata-extractor.vala b/src/rygel/rygel-metadata-extractor.vala index e11ccdd..35cf4a4 100644 --- a/src/rygel/rygel-metadata-extractor.vala +++ b/src/rygel/rygel-metadata-extractor.vala @@ -102,19 +102,19 @@ public class Rygel.MetadataExtractor: GLib.Object { public static MetadataExtractor? create() { if (MetadataExtractor.factory == null) { - debug ("Checking for gstreamer playbin..."); + debug (_("Checking for gstreamer playbin...")); var factory = ElementFactory.find("playbin2"); if (factory != null) { - debug ("Using playbin2"); + debug (_("Using playbin2")); } else { - debug ("Could not create Playbin2, trying Playbin"); + debug (_("Could not create Playbin2, trying Playbin")); factory = ElementFactory.find ("playbin"); if (factory != null) { - debug ("Using playbin"); + 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; } } @@ -148,13 +148,13 @@ public class Rygel.MetadataExtractor: GLib.Object { } private bool on_harvesting_timeout () { - warning ("Metadata extractor timed out on %s, restarting", - this.file_queue.peek_head ().get_uri ()); + warning (_("Metadata extractor timed out on %s, restarting"), + this.file_queue.peek_head ().get_uri ()); this.playbin.set_state (State.NULL); this.error (file_queue.peek_head (), - new IOChannelError.FAILED ( - "Pipeline stuck while reading file info")); + new IOChannelError.FAILED (_("Pipeline stuck while" + + " reading file info"))); this.file_queue.pop_head (); extract_next (); return false; @@ -167,7 +167,7 @@ public class Rygel.MetadataExtractor: GLib.Object { if (this.file_queue.get_length () > 0) { try { var item = this.file_queue.peek_head (); - debug ("Scheduling file %s for metadata extraction", + debug (_("Scheduling file %s for metadata extraction"), item.get_uri ()); this.extract_mime_and_size (); renew_playbin (); @@ -253,8 +253,8 @@ public class Rygel.MetadataExtractor: GLib.Object { FileQueryInfoFlags.NONE, null); } catch (Error error) { - warning ("Failed to query content type for '%s'\n", - file.get_uri ()); + warning (_("Failed to query content type for '%s'"), + file.get_uri ()); // signal error to parent this.error (file, error); diff --git a/src/rygel/rygel-mp2ts-transcoder-bin.vala b/src/rygel/rygel-mp2ts-transcoder-bin.vala index 0dbf351..bf245f6 100644 --- a/src/rygel/rygel-mp2ts-transcoder-bin.vala +++ b/src/rygel/rygel-mp2ts-transcoder-bin.vala @@ -86,9 +86,9 @@ internal class Rygel.MP2TSTranscoderBin : Gst.Bin { if (new_pad.link (enc_pad) != PadLinkReturn.OK) { GstUtils.post_error (this, - new GstError.LINK ("Failed to link pad " + - new_pad.name + - " to " + + new GstError.LINK (_("Failed to link pad" + + " %s to %s"), + new_pad.name, enc_pad.name)); return; } diff --git a/src/rygel/rygel-mp3-transcoder-bin.vala b/src/rygel/rygel-mp3-transcoder-bin.vala index 9483ead..694b68f 100644 --- a/src/rygel/rygel-mp3-transcoder-bin.vala +++ b/src/rygel/rygel-mp3-transcoder-bin.vala @@ -67,9 +67,9 @@ 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 " + - new_pad.name + - " to " + + new GstError.LINK (_("Failed to link pad" + + "%s to %s"), + new_pad.name, enc_pad.name)); return; } diff --git a/src/rygel/rygel-plugin-loader.vala b/src/rygel/rygel-plugin-loader.vala index 02ff4d9..91f10df 100644 --- a/src/rygel/rygel-plugin-loader.vala +++ b/src/rygel/rygel-plugin-loader.vala @@ -61,11 +61,11 @@ public class Rygel.PluginLoader : Object { } catch (GLib.Error err) {} if (enabled) { - message ("New plugin '%s' available", plugin.name); + message (_("New plugin '%s' available"), plugin.name); this.plugin_hash.set (plugin.name, plugin); this.plugin_available (plugin); } else { - debug ("Plugin '%s' disabled in user configuration, ignoring..", + debug (_("Plugin '%s' disabled in user configuration, ignoring.."), plugin.name); } } @@ -97,7 +97,7 @@ public class Rygel.PluginLoader : Object { Priority.DEFAULT, null); } catch (Error error) { - critical ("Error listing contents of directory '%s': %s\n", + critical (_("Error listing contents of directory '%s': %s"), dir.get_path (), error.message); @@ -126,7 +126,7 @@ public class Rygel.PluginLoader : Object { private void load_module_from_file (string file_path) { Module module = Module.open (file_path, ModuleFlags.BIND_LOCAL); if (module == null) { - warning ("Failed to load module from path '%s' : %s\n", + warning (_("Failed to load module from path '%s' : %s"), file_path, Module.error ()); @@ -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\n", + warning (_("Failed to find entry point function 'module_init'" + + " in module loaded from path '%s': %s"), file_path, Module.error ()); @@ -152,7 +152,7 @@ public class Rygel.PluginLoader : Object { module_init (this); - debug ("Loaded module source: '%s'\n", module.name()); + debug (_("Loaded module source: '%s'"), module.name()); } private static bool is_dir (File file) { @@ -163,7 +163,7 @@ public class Rygel.PluginLoader : Object { FileQueryInfoFlags.NONE, null); } catch (Error error) { - critical ("Failed to query content type for '%s'\n", + critical (_("Failed to query content type for '%s'"), file.get_path ()); return false; diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala index 9f05079..8c20e33 100644 --- a/src/rygel/rygel-root-device-factory.vala +++ b/src/rygel/rygel-root-device-factory.vala @@ -99,7 +99,7 @@ internal class Rygel.RootDeviceFactory { "device", null); if (device_element == null) { - warning ("Element /root/device not found."); + warning (_("Element /root/device not found.")); return; } @@ -132,7 +132,7 @@ internal class Rygel.RootDeviceFactory { "friendlyName", null); if (element == null) { - warning ("Element /root/device/friendlyName not found."); + warning (_("Element /root/device/friendlyName not found.")); return; } @@ -153,7 +153,7 @@ internal class Rygel.RootDeviceFactory { /* UDN */ element = Utils.get_xml_element (device_element, "UDN"); if (element == null) { - warning ("Element /root/device/UDN not found."); + warning (_("Element /root/device/UDN not found.")); return; } @@ -172,7 +172,7 @@ internal class Rygel.RootDeviceFactory { "modelDescription", null); if (element == null) { - warning ("Element /root/device/modelDescription not found."); + warning (_("Element /root/device/modelDescription not found.")); return; } @@ -186,7 +186,7 @@ internal class Rygel.RootDeviceFactory { "serviceList", null); if (service_list_node == null) { - warning ("Element /root/device/serviceList not found."); + warning (_("Element /root/device/serviceList not found.")); return; } @@ -227,7 +227,7 @@ internal class Rygel.RootDeviceFactory { private void add_icons_to_desc (Xml.Node *device_element, Plugin plugin) { if (plugin.icon_infos == null || plugin.icon_infos.size == 0) { - debug ("No icon provided by %s.", plugin.name); + debug (_("No icon provided by %s."), plugin.name); return; } @@ -289,8 +289,8 @@ 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); + string message = _("Failed to write modified description" + + " to %s.\n").printf (desc_path); throw new IOError.FAILED (message); } diff --git a/src/rygel/rygel-search.vala b/src/rygel/rygel-search.vala index 272688a..5714530 100644 --- a/src/rygel/rygel-search.vala +++ b/src/rygel/rygel-search.vala @@ -89,10 +89,10 @@ internal class Rygel.Search: GLib.Object, Rygel.StateMachine { if (this.container_id == null || this.search_criteria == null) { // Sorry we can't do anything without these two parameters throw new ContentDirectoryError.NO_SUCH_OBJECT ( - "No such container"); + _("No such container")); } - debug ("Executing search request: %s", this.search_criteria); + debug (_("Executing search request: %s"), this.search_criteria); if (this.xbox_hacks != null) { this.xbox_hacks.translate_container_id (ref this.container_id); @@ -126,7 +126,7 @@ internal class Rygel.Search: GLib.Object, Rygel.StateMachine { this.cancellable); if (media_object == null || !(media_object is MediaContainer)) { throw new ContentDirectoryError.NO_SUCH_OBJECT ( - "Specified container does not exist."); + _("Specified container does not exist.")); } return media_object as MediaContainer; @@ -151,8 +151,8 @@ internal class Rygel.Search: GLib.Object, Rygel.StateMachine { this.cancellable); if (results.size == 0) { throw new ContentDirectoryError.CANT_PROCESS ( - "No objects found that could satisfy" + - " the given search criteria."); + _("No objects found that could " + + "satisfy given search criteria.")); } this.number_returned = results.size; @@ -182,7 +182,7 @@ internal class Rygel.Search: GLib.Object, Rygel.StateMachine { } private void handle_error (Error error) { - warning ("Failed to search in '%s': %s\n", + warning (_("Failed to search in '%s': %s"), this.container_id, error.message); diff --git a/src/rygel/rygel-seekable-response.vala b/src/rygel/rygel-seekable-response.vala index 52c7b20..a4dee02 100644 --- a/src/rygel/rygel-seekable-response.vala +++ b/src/rygel/rygel-seekable-response.vala @@ -65,7 +65,7 @@ internal class Rygel.SeekableResponse : Rygel.HTTPResponse { this.input_stream = yield this.file.read_async (this.priority, this.cancellable); } catch (Error err) { - warning ("Failed to read from URI: %s: %s\n", + warning (_("Failed to read from URI: %s: %s"), file.get_uri (), err.message); this.end (false, Soup.KnownStatusCode.NOT_FOUND); @@ -83,7 +83,7 @@ internal class Rygel.SeekableResponse : Rygel.HTTPResponse { SeekType.SET, this.cancellable); } catch (Error err) { - warning ("Failed to seek to %s-%s on URI %s: %s\n", + warning (_("Failed to seek to %s-%s on URI %s: %s"), seek.start.to_string (), seek.stop.to_string (), file.get_uri (), @@ -103,7 +103,7 @@ internal class Rygel.SeekableResponse : Rygel.HTTPResponse { } catch (IOError.CANCELLED cancelled_err) { // This is OK } catch (Error err) { - warning ("Failed to read contents from URI: %s: %s\n", + warning (_("Failed to read contents from URI: %s: %s"), this.file.get_uri (), err.message); this.end (false, Soup.KnownStatusCode.NOT_FOUND); @@ -155,7 +155,7 @@ internal class Rygel.SeekableResponse : Rygel.HTTPResponse { yield this.input_stream.close_async (this.priority, this.cancellable); } catch (Error err) { - warning ("Failed to close stream to URI %s: %s\n", + warning (_("Failed to close stream to URI %s: %s"), this.file.get_uri (), err.message); } diff --git a/src/rygel/rygel-subtitle-manager.vala b/src/rygel/rygel-subtitle-manager.vala index 7ecf86d..cc7a41a 100644 --- a/src/rygel/rygel-subtitle-manager.vala +++ b/src/rygel/rygel-subtitle-manager.vala @@ -63,7 +63,7 @@ internal class Rygel.SubtitleManager : GLib.Object { if (!info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_READ)) { throw new SubtitleManagerError.NO_SUBTITLE ( - "No subtitle available"); + _("No subtitle available")); } var subtitle = new Subtitle (); diff --git a/src/rygel/rygel-thumbnailer.vala b/src/rygel/rygel-thumbnailer.vala index 6376568..5582f56 100644 --- a/src/rygel/rygel-thumbnailer.vala +++ b/src/rygel/rygel-thumbnailer.vala @@ -53,8 +53,8 @@ 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"); + throw new ThumbnailerError.NO_DIR (_("Failed to find " + + "thumbnails directory.")); } else { this.template.mime_type = "image/png"; this.template.dlna_profile = "PNG_TN"; @@ -78,7 +78,7 @@ internal class Rygel.Thumbnailer : GLib.Object { try { thumbnailer = new Thumbnailer (); } catch (ThumbnailerError err) { - warning ("No thumbnailer available: %s", err.message); + warning (_("No thumbnailer available: %s"), err.message); } first_time = false; @@ -101,7 +101,8 @@ internal class Rygel.Thumbnailer : GLib.Object { null); if (!info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_READ)) { - throw new ThumbnailerError.NO_THUMBNAIL ("No thumbnail available"); + throw new ThumbnailerError.NO_THUMBNAIL ( + _("No thumbnail available")); } thumbnail = new Thumbnail (); diff --git a/src/rygel/rygel-transcode-manager.vala b/src/rygel/rygel-transcode-manager.vala index 4fed0fe..709f93d 100644 --- a/src/rygel/rygel-transcode-manager.vala +++ b/src/rygel/rygel-transcode-manager.vala @@ -89,7 +89,7 @@ internal abstract class Rygel.TranscodeManager : GLib.Object { if (transcoder == null) { throw new HTTPRequestError.NOT_FOUND ( - "No transcoder available for target format '%s'", + _("No transcoder available for target format '%s'"), target); } diff --git a/src/rygel/rygel-user-config.vala b/src/rygel/rygel-user-config.vala index 11bef33..0bfe53a 100644 --- a/src/rygel/rygel-user-config.vala +++ b/src/rygel/rygel-user-config.vala @@ -160,7 +160,7 @@ public class Rygel.UserConfig : GLib.Object, Configuration { out path, KeyFileFlags.KEEP_COMMENTS | KeyFileFlags.KEEP_TRANSLATIONS); - debug ("Loaded user configuration from file '%s'", path); + debug (_("Loaded user configuration from file '%s'"), path); try { DBus.Connection connection = DBus.Bus.get (DBus.BusType.SESSION); @@ -174,7 +174,7 @@ public class Rygel.UserConfig : GLib.Object, Configuration { DBUS_PATH, DBUS_INTERFACE); } catch (DBus.Error err) { - debug ("Failed to connect to session bus: %s", err.message); + debug (_("Failed to connect to session bus: %s"), err.message); } } @@ -191,7 +191,7 @@ public class Rygel.UserConfig : GLib.Object, Configuration { try { FileUtils.set_contents (path, data, (long) length); } catch (FileError err) { - critical ("Failed to save configuration data to file '%s': %s", + critical (_("Failed to save configuration data to file '%s': %s"), path, err.message); } @@ -210,8 +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; @@ -238,8 +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; @@ -339,7 +341,7 @@ public class Rygel.UserConfig : GLib.Object, Configuration { this.set_bool ("general", ENABLED_KEY, false); } } catch (GLib.Error err) { - warning ("Failed to %s Rygel service: %s\n", + warning (_("Failed to %s Rygel service: %s"), enable? "start": "stop", err.message); } diff --git a/src/rygel/rygel-wma-transcoder-bin.vala b/src/rygel/rygel-wma-transcoder-bin.vala index c4c3520..b38f263 100644 --- a/src/rygel/rygel-wma-transcoder-bin.vala +++ b/src/rygel/rygel-wma-transcoder-bin.vala @@ -56,10 +56,10 @@ 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)); + new GstError.LINK (_("Failed to link pad" + + " %s to %s"), + new_pad.name, + enc_pad.name)); return; } } diff --git a/src/rygel/rygel-wmv-transcoder-bin.vala b/src/rygel/rygel-wmv-transcoder-bin.vala index 3f3c386..e2b8aa1 100644 --- a/src/rygel/rygel-wmv-transcoder-bin.vala +++ b/src/rygel/rygel-wmv-transcoder-bin.vala @@ -84,10 +84,10 @@ internal class Rygel.WMVTranscoderBin : 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)); + new GstError.LINK (_("Failed to link pad" + + " %s to %s"), + new_pad.name, + enc_pad.name)); return; } } diff --git a/src/rygel/rygel-xbox-hacks.vala b/src/rygel/rygel-xbox-hacks.vala index 10d07c2..9cbe4b3 100644 --- a/src/rygel/rygel-xbox-hacks.vala +++ b/src/rygel/rygel-xbox-hacks.vala @@ -40,7 +40,7 @@ internal class Rygel.XBoxHacks : GLib.Object { public XBoxHacks.for_action (ServiceAction action) throws XBoxHacksError { var agent = action.get_message ().request_headers.get ("User-Agent"); if (!agent.contains ("Xbox")) { - throw new XBoxHacksError.NA ("Not Applicable"); + throw new XBoxHacksError.NA (_("Not Applicable")); } } @@ -145,10 +145,10 @@ internal class Rygel.XBoxHacks : GLib.Object { res = doc.doc.dump (f); if (f == null || res == -1) { - string message = "Failed to write modified description" + - " to %s.\n".printf (desc_path); + throw new IOError.FAILED (_("Failed to write modified" + + " description to %s."), + desc_path); - throw new IOError.FAILED (message); } } } diff --git a/src/ui/rygel-preferences-dialog.vala b/src/ui/rygel-preferences-dialog.vala index c53edeb..065cda8 100644 --- a/src/ui/rygel-preferences-dialog.vala +++ b/src/ui/rygel-preferences-dialog.vala @@ -67,7 +67,7 @@ public class Rygel.PreferencesDialog : GLib.Object { dialog.run (); } catch (Error err) { - error ("Failed to create preferences dialog: %s\n", err.message); + error (_("Failed to create preferences dialog: %s"), err.message); } return 0; -- 2.7.4