Mark translatable strings fro translation using the '_()' macro.
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;
}
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;
}
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;
}
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,
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);
}
}
}
set {
- debug ("Changing playback state to %s..", value);
+ debug (_("Changing playback state to %s.."), value);
this._playback_state = value;
switch (this._playback_state) {
set {
this.playbin.uri = value;
- debug ("URI set to %s.", value);
+ debug (_("URI set to %s."), value);
}
}
set {
this.playbin.volume = value;
- debug ("volume set to %f.", value);
+ debug (_("volume set to %f."), value);
}
}
}
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,
var plugin = new Plugin (MEDIA_RENDERER_DESC_PATH,
"GstRenderer",
- "GStreamer Renderer");
+ _("GStreamer Renderer"));
plugin.add_resource (new ResourceInfo (ConnectionManager.UPNP_ID,
ConnectionManager.UPNP_TYPE,
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;
}
action.get ("PresetName", typeof (string), out preset_name);
if (preset_name != "") {
- action.return_error (701, "Invalid Name");
+ action.return_error (701, _("Invalid Name"));
return;
}
action.get ("Channel", typeof (string), out channel);
if (channel != "Master") {
- action.return_error (501, "Action Failed");
+ action.return_error (501, _("Action Failed"));
return false;
}
action.get ("DesiredVolume", typeof (uint), out volume);
if (volume > 100) {
- action.return_error (501, "Action Failed");
+ action.return_error (501, _("Action Failed"));
return;
}
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);
}
}
return true;
}
} catch (DatabaseError err) {
- warning ("Failed to query database: %s", err.message);
+ warning (_("Failed to query database: %s"), err.message);
}
return false;
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;
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);
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);
}
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);
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);
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;
}
}
}
} 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;
}
[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);
}
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;
}
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 () {
}
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;
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 ();
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 ());
}
}
// 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 };
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 ();
}
}
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);
}
}
return new MediaExportQueryContainer (this.media_db,
id,
- "Albums");
+ _("Albums"));
case "object.container.person.musicArtist":
string id = "virtual-container:dc:creator,?,upnp:album,?";
return new MediaExportQueryContainer (this.media_db,
id,
- "Artists");
+ _("Artists"));
default:
return null;
}
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);
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;
}
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);
}
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);
}
}
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);
}
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 ();
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 ());
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;
}
}
} catch (Error error) {
- warning ("Error removing object from database: %s",
+ warning (_("Error removing object from database: %s"),
error.message);
}
break;
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));
}
}
}
[ModuleInit]
public void module_init (PluginLoader loader) {
var plugin = new Plugin.MediaServer ("ZDFMediathek",
- "ZDF Mediathek",
+ _("ZDF Mediathek"),
typeof (Rygel.MediathekContentDir));
loader.add_plugin (plugin);
}
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 ();
}
}
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);
}
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,
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;
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;
"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));
}
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 ();
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) {
}
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;
}
else {
throw new MediathekVideoItemError.XML_PARSE_ERROR (
- "invalid or no namespace on group node");
+ _("Invalid or no namespace" +
+ " on group node"));
}
break;
default:
}
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);
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);
}
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);
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);
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;
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);
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));
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."));
}
}
public TrackerPlugin () {
base.MediaServer ("Tracker",
- "@REALNAME@'s media",
+ _("@REALNAME@'s media"),
typeof (MediaTracker));
var icon_info = new IconInfo ("image/png");
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);
}
}
}
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);
}
}
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);
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);
}
TrackerItemFactory item_factory) {
base (parent.id + "Year",
parent,
- "Year",
+ _("Year"),
item_factory,
KEY_CHAIN,
year_id_func,
this.browse_flag == "BrowseMetadata") {
this.fetch_metadata = true;
} else {
- throw new ContentDirectoryError.INVALID_ARGS ("Invalid Args");
+ throw new ContentDirectoryError.INVALID_ARGS (_("Invalid Args"));
}
/* ObjectID */
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"));
}
}
this.cancellable);
if (media_object == null) {
throw new ContentDirectoryError.NO_SUCH_OBJECT (
- "No such object");
+ _("No such object"));
}
return media_object;
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;
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);
// 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;
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;
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;
}
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;
}
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;
}
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;
}
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;
if (disabled) {
return false;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
if (title != null) {
return title;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
if (value != null) {
return value;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
if (value != null) {
return value;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
if (value_set) {
return value;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
if (value != null) {
return value;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
if (value_set) {
return value;
} else {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
}
}
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;
}
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;
action.return ();
} else {
- action.return_error (717, "No such file transfer");
+ action.return_error (717, _("No such file transfer"));
}
}
action.return ();
} else {
- action.return_error (717, "No such file transfer");
+ action.return_error (717, _("No such file transfer"));
}
}
"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");
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;
}
} 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) {
*/
public void rollback () {
if (this.db.exec ("ROLLBACK") != Sqlite.OK) {
- critical ("Failed to rollback transaction: %s",
+ critical (_("Failed to rollback transaction: %s"),
db.errmsg ());
}
}
(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);
this.serialize_container ((MediaContainer) media_object);
} else {
throw new DIDLLiteWriterError.UNSUPPORTED_OBJECT (
- "Unable to serialize unsupported object");
+ _("Unable to serialize unsupported object"));
}
}
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;
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);
}
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);
}
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);
}
}
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
/* 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;
}
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) {
// 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);
});
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,
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,
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);
}
}
if (this.item_id == null) {
- throw new HTTPRequestError.NOT_FOUND ("Not Found");
+ throw new HTTPRequestError.NOT_FOUND (_("Not Found"));
}
}
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);
}
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;
}
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));
}
string server_path,
HashTable<string,string>? 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) => {
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));
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));
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);
}
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);
}
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);
}
}
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 {
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);
this.status = TransferStatus.COMPLETED;
- debug ("Import of '%s' to '%s' completed",
+ debug (_("Import of '%s' to '%s' completed"),
source_uri,
destination_uri);
this.completed ();
});
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,
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"));
}
}
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;
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);
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;
}
}
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;
} 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);
}
}
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);
}
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);
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);
}
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);
} 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);
}
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);
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);
}
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);
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);
}
}
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) {
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);
}
} 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"));
}
}
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 ();
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 ();
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);
}
return new Gee.ArrayList<MediaObject> ();
}
- 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 ());
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") {
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);
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);
}
}
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
if (unavailable) {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
}
return val;
}
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;
}
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;
if (val == null) {
throw new ConfigurationError.NO_VALUE_SET (
- "No value available for '%s/%s'",
+ _("No value available for '%s/%s'"),
section,
key);
}
if (val == null) {
throw new ConfigurationError.NO_VALUE_SET (
- "No value available for '%s/%s'",
+ _("No value available for '%s/%s'"),
section,
key);
}
if (unavailable) {
throw new ConfigurationError.NO_VALUE_SET (
- "No value available for '%s/%s'",
+ _("No value available for '%s/%s'"),
section,
key);
}
if (val == null) {
throw new ConfigurationError.NO_VALUE_SET (
- "No value available for '%s/%s'",
+ _("No value available for '%s/%s'"),
section,
key);
}
if (unavailable) {
throw new ConfigurationError.NO_VALUE_SET (
- "No value available for '%s/%s'",
+ _("No value available for '%s/%s'"),
section,
key);
}
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;
}
}
}
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;
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 ();
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);
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;
}
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;
}
} 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);
}
}
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);
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 ());
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 ());
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) {
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;
"device",
null);
if (device_element == null) {
- warning ("Element /root/device not found.");
+ warning (_("Element /root/device not found."));
return;
}
"friendlyName",
null);
if (element == null) {
- warning ("Element /root/device/friendlyName not found.");
+ warning (_("Element /root/device/friendlyName not found."));
return;
}
/* 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;
}
"modelDescription",
null);
if (element == null) {
- warning ("Element /root/device/modelDescription not found.");
+ warning (_("Element /root/device/modelDescription not found."));
return;
}
"serviceList",
null);
if (service_list_node == null) {
- warning ("Element /root/device/serviceList not found.");
+ warning (_("Element /root/device/serviceList not found."));
return;
}
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;
}
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);
}
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);
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;
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;
}
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);
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);
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 (),
} 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);
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);
}
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 ();
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";
try {
thumbnailer = new Thumbnailer ();
} catch (ThumbnailerError err) {
- warning ("No thumbnailer available: %s", err.message);
+ warning (_("No thumbnailer available: %s"), err.message);
}
first_time = false;
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 ();
if (transcoder == null) {
throw new HTTPRequestError.NOT_FOUND (
- "No transcoder available for target format '%s'",
+ _("No transcoder available for target format '%s'"),
target);
}
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);
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);
}
}
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);
}
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;
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;
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);
}
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;
}
}
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;
}
}
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"));
}
}
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);
}
}
}
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;