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