[gnome-games] Update error messages to latest styling



commit 288beba536b36037a707af0951a7de389bfef447
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Jul 26 10:32:47 2016 +0200

    Update error messages to latest styling
    
    Update the error messages to the styling added in the previous commit.
    
    This internationalize the commit messages.
    
    Fixes #314

 plugins/desktop/src/desktop-tracker-query.vala     |   12 ++++++------
 plugins/dreamcast/src/dreamcast-header.vala        |   12 ++++++------
 plugins/game-boy/src/game-boy-header.vala          |    4 ++--
 plugins/game-cube/src/game-cube-header.vala        |    8 ++++----
 plugins/love/src/love-package.vala                 |    4 ++--
 plugins/mame/src/mame-plugin.vala                  |    2 +-
 .../master-system/src/master-system-header.vala    |    4 ++--
 plugins/mega-drive/src/mega-drive-header.vala      |    4 ++--
 plugins/sega-saturn/src/sega-saturn-header.vala    |   10 +++++-----
 plugins/steam/src/steam-game-source.vala           |    2 +-
 plugins/steam/src/steam-registry.vala              |    8 ++++----
 plugins/steam/src/steam-title.vala                 |    2 +-
 plugins/wii/src/wii-header.vala                    |    8 ++++----
 po/POTFILES.in                                     |   18 ++++++++++++++++++
 src/command/command-runner.vala                    |    4 ++--
 src/core/plugin-registrar.vala                     |    6 +++---
 src/gamepad/gamepad-mapping.vala                   |    4 ++--
 src/gamepad/linux/linux-raw-gamepad.vala           |    4 ++--
 src/retro/retro-runner.vala                        |   13 +++++--------
 19 files changed, 72 insertions(+), 57 deletions(-)
---
diff --git a/plugins/desktop/src/desktop-tracker-query.vala b/plugins/desktop/src/desktop-tracker-query.vala
index 9276b08..e38473c 100644
--- a/plugins/desktop/src/desktop-tracker-query.vala
+++ b/plugins/desktop/src/desktop-tracker-query.vala
@@ -44,7 +44,7 @@ private class Games.DesktopTrackerQuery : Object, TrackerQuery {
                string[] args;
                var command = app_info.get_commandline ();
                if (!Shell.parse_argv (command, out args))
-                       throw new CommandError.INVALID_COMMAND ("Invalid command '%s'", command);
+                       throw new CommandError.INVALID_COMMAND (_("Invalid command '%s'."), command);
                var runner = new CommandRunner (args, true);
 
                games += new GenericGame (title, icon, cover, runner);
@@ -72,13 +72,13 @@ private class Games.DesktopTrackerQuery : Object, TrackerQuery {
                var file = File.new_for_uri (uri);
 
                if (!file.query_exists ())
-                       throw new TrackerError.FILE_NOT_FOUND ("Tracker listed file not found: '%s'.", uri);
+                       throw new TrackerError.FILE_NOT_FOUND (_("Tracker listed file not found: '%s'."), 
uri);
 
                var path = file.get_path ();
                var app_info = new DesktopAppInfo.from_filename (path);
 
                if (app_info == null)
-                       throw new DesktopError.INVALID_APPINFO ("Couldn't parse desktop entry '%s'.", path);
+                       throw new DesktopError.INVALID_APPINFO (_("Couldn't parse desktop entry '%s'."), 
path);
 
                check_categories (app_info);
                check_executable (app_info);
@@ -91,7 +91,7 @@ private class Games.DesktopTrackerQuery : Object, TrackerQuery {
 
                foreach (var category in get_categories_black_list ())
                        if (category in categories)
-                               throw new DesktopError.BLACKLISTED_GAME ("'%s' has blacklisted category 
'%s'.", app_info.filename, category);
+                               throw new DesktopError.BLACKLISTED_GAME (_("'%s' has blacklisted category 
'%s'."), app_info.filename, category);
        }
 
        private void check_executable (DesktopAppInfo app_info) throws Error {
@@ -100,14 +100,14 @@ private class Games.DesktopTrackerQuery : Object, TrackerQuery {
                foreach (var executable in get_executable_black_list ())
                        if (app_executable == executable ||
                            app_executable.has_suffix ("/" + executable))
-                               throw new DesktopError.BLACKLISTED_GAME ("'%s' has blacklisted executable 
'%s'.", app_info.filename, executable);
+                               throw new DesktopError.BLACKLISTED_GAME (_("'%s' has blacklisted executable 
'%s'."), app_info.filename, executable);
        }
 
        private void check_base_name (File file) throws Error {
                var base_name = file.get_basename ();
 
                if (base_name in get_base_name_black_list ())
-                       throw new DesktopError.BLACKLISTED_GAME ("'%s' is blacklisted.", file.get_path ());
+                       throw new DesktopError.BLACKLISTED_GAME (_("'%s' is blacklisted."), file.get_path ());
        }
 
        private static string[] categories_black_list;
diff --git a/plugins/dreamcast/src/dreamcast-header.vala b/plugins/dreamcast/src/dreamcast-header.vala
index 4317648..bd6f7ba 100644
--- a/plugins/dreamcast/src/dreamcast-header.vala
+++ b/plugins/dreamcast/src/dreamcast-header.vala
@@ -49,7 +49,7 @@ private class Games.DreamcastHeader : Object {
                                header_offset = offset;
 
                if (header_offset == null)
-                       throw new DreamcastError.INVALID_HEADER ("The file doesn't have a Dreamcast header.");
+                       throw new DreamcastError.INVALID_HEADER (_("The file doesn't have a Dreamcast 
header."));
 
                return header_offset;
        }
@@ -60,7 +60,7 @@ private class Games.DreamcastHeader : Object {
                        stream.seek (offset + MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new DreamcastError.INVALID_SIZE (@"Invalid Dreamcast header size: 
$(e.message)");
+                       throw new DreamcastError.INVALID_SIZE (_("Invalid Dreamcast header size: %s"), 
e.message);
                }
 
                // The header must start with $MAGIC_VALUE.
@@ -81,7 +81,7 @@ private class Games.DreamcastHeader : Object {
                        stream.seek (offset + MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new DreamcastError.INVALID_SIZE (@"Invalid Dreamcast header size: 
$(e.message)");
+                       throw new DreamcastError.INVALID_SIZE (_("Invalid Dreamcast header size: %s"), 
e.message);
                }
 
                // The header must be $HEADER_SIZE ASCII characters long.
@@ -105,7 +105,7 @@ private class Games.DreamcastHeader : Object {
                        stream.seek (header_offset + offset, SeekType.SET);
                }
                catch (Error e) {
-                       throw new DreamcastError.INVALID_SIZE (@"Invalid Dreamcast header size: 
$(e.message)");
+                       throw new DreamcastError.INVALID_SIZE (_("Invalid Dreamcast header size: %s"), 
e.message);
                }
 
                var buffer = new uint8[size];
@@ -113,7 +113,7 @@ private class Games.DreamcastHeader : Object {
                        stream.read (buffer);
                }
                catch (Error e) {
-                       throw new DreamcastError.INVALID_HEADER ("The file doesn't have a Dreamcast header.");
+                       throw new DreamcastError.INVALID_HEADER (_("The file doesn't have a Dreamcast 
header."));
                }
 
                return (string) buffer;
@@ -124,7 +124,7 @@ private class Games.DreamcastHeader : Object {
                        return file.read ();
                }
                catch (Error e) {
-                       throw new DreamcastError.CANT_READ_FILE (@"Couldn't read file: $(e.message)");
+                       throw new DreamcastError.CANT_READ_FILE (_("Couldn't read file: %s"), e.message);
                }
        }
 }
diff --git a/plugins/game-boy/src/game-boy-header.vala b/plugins/game-boy/src/game-boy-header.vala
index 5a903a2..52f9cd1 100644
--- a/plugins/game-boy/src/game-boy-header.vala
+++ b/plugins/game-boy/src/game-boy-header.vala
@@ -91,7 +91,7 @@ private class Games.GameBoyHeader : Object {
                        stream.seek (MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new GameBoyError.INVALID_SIZE (@"Invalid Game Boy header size: $(e.message)");
+                       throw new GameBoyError.INVALID_SIZE (_("Invalid Game Boy header size: %s"), 
e.message);
                }
 
                var buffer = new uint8[MAGIC_VALUE.length];
@@ -104,7 +104,7 @@ private class Games.GameBoyHeader : Object {
 
                var magic = (string) buffer;
                if (magic != MAGIC_VALUE)
-                       throw new GameBoyError.INVALID_HEADER ("The file doesn't have a Game Boy header.");
+                       throw new GameBoyError.INVALID_HEADER (_("The file doesn't have a Game Boy header."));
        }
 }
 
diff --git a/plugins/game-cube/src/game-cube-header.vala b/plugins/game-cube/src/game-cube-header.vala
index 2261501..6294560 100644
--- a/plugins/game-cube/src/game-cube-header.vala
+++ b/plugins/game-cube/src/game-cube-header.vala
@@ -17,7 +17,7 @@ private class Games.GameCubeHeader: Object {
                        stream.seek (MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new GameCubeError.INVALID_SIZE (@"Invalid Game Cube header size: $(e.message)");
+                       throw new GameCubeError.INVALID_SIZE (_("Invalid Game Cube header size: %s"), 
e.message);
                }
 
                var buffer = new uint8[MAGIC_VALUE.length];
@@ -30,7 +30,7 @@ private class Games.GameCubeHeader: Object {
 
                var magic = (string) buffer;
                if (magic != MAGIC_VALUE)
-                       throw new GameCubeError.INVALID_HEADER ("The file doesn't have a Game Cube header.");
+                       throw new GameCubeError.INVALID_HEADER (_("The file doesn't have a Game Cube 
header."));
        }
 
        public string get_game_id () throws GameCubeError {
@@ -41,7 +41,7 @@ private class Games.GameCubeHeader: Object {
                        stream.read (buffer);
                }
                catch (Error e) {
-                       throw new GameCubeError.INVALID_HEADER ("The file doesn't have a Game Cube header.");
+                       throw new GameCubeError.INVALID_HEADER (_("The file doesn't have a Game Cube 
header."));
                }
 
                return (string) buffer;
@@ -52,7 +52,7 @@ private class Games.GameCubeHeader: Object {
                        return file.read ();
                }
                catch (Error e) {
-                       throw new GameCubeError.CANT_READ_FILE (@"Couldn't read file: $(e.message)");
+                       throw new GameCubeError.CANT_READ_FILE (_("Couldn't read file: %s"), e.message);
                }
        }
 }
diff --git a/plugins/love/src/love-package.vala b/plugins/love/src/love-package.vala
index 8779b2d..b31cb8c 100644
--- a/plugins/love/src/love-package.vala
+++ b/plugins/love/src/love-package.vala
@@ -10,11 +10,11 @@ private class Games.LovePackage : Object {
                this.uri = uri;
 
                if (!contains_file ("main.lua"))
-                       throw new LoveError.INVALID_PACKAGE ("This doesn't represent a valid LÖVE package: 
'%s'.", uri);
+                       throw new LoveError.INVALID_PACKAGE (_("This doesn't represent a valid LÖVE package: 
'%s'."), uri);
 
                var config_file = get_file_string ("conf.lua");
                if (config_file == null)
-                       throw new LoveError.INVALID_PACKAGE ("This doesn't represent a valid LÖVE package: 
'%s'.", uri);
+                       throw new LoveError.INVALID_PACKAGE (_("This doesn't represent a valid LÖVE package: 
'%s'."), uri);
 
                var regex = /^\s*[^\s]+\.([^\s\.]+)\s*=\s*(.+?)\s*$/;
 
diff --git a/plugins/mame/src/mame-plugin.vala b/plugins/mame/src/mame-plugin.vala
index 2a4a9ba..529582e 100644
--- a/plugins/mame/src/mame-plugin.vala
+++ b/plugins/mame/src/mame-plugin.vala
@@ -22,7 +22,7 @@ private class Games.MamePlugin : Object, Plugin {
                game_id = /\.zip$/.replace (game_id, game_id.length, 0, "");
 
                if (!supported_games.contains (game_id))
-                       throw new MameError.INVALID_GAME_ID ("Invalid MAME game id '%s' for '%s'", game_id, 
uri);
+                       throw new MameError.INVALID_GAME_ID (_("Invalid MAME game id '%s' for '%s'."), 
game_id, uri);
 
                var uid_string = @"mame-$game_id".down ();
                var uid = new GenericUid (uid_string);
diff --git a/plugins/master-system/src/master-system-header.vala 
b/plugins/master-system/src/master-system-header.vala
index d7fc7e0..08cf5da 100644
--- a/plugins/master-system/src/master-system-header.vala
+++ b/plugins/master-system/src/master-system-header.vala
@@ -60,7 +60,7 @@ private class Games.MasterSystemHeader : Object {
                        stream.seek (MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new MasterSystemError.INVALID_SIZE (@"Invalid Master System header size: 
$(e.message)");
+                       throw new MasterSystemError.INVALID_SIZE (_("Invalid Master System header size: %s"), 
e.message);
                }
 
                var buffer = new uint8[MAGIC_VALUE.length];
@@ -73,7 +73,7 @@ private class Games.MasterSystemHeader : Object {
 
                var magic = (string) buffer;
                if (magic != MAGIC_VALUE)
-                       throw new MasterSystemError.INVALID_HEADER ("The file doesn't have a Master System 
header.");
+                       throw new MasterSystemError.INVALID_HEADER (_("The file doesn't have a Master System 
header."));
        }
 }
 
diff --git a/plugins/mega-drive/src/mega-drive-header.vala b/plugins/mega-drive/src/mega-drive-header.vala
index 384d287..66828c6 100644
--- a/plugins/mega-drive/src/mega-drive-header.vala
+++ b/plugins/mega-drive/src/mega-drive-header.vala
@@ -57,7 +57,7 @@ private class Games.MegaDriveHeader : Object {
                        stream.seek (MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new MegaDriveError.INVALID_SIZE (@"Invalid Mega Drive/Genesis/32X header size: 
$(e.message)");
+                       throw new MegaDriveError.INVALID_SIZE (_("Invalid Mega Drive/Genesis/32X header size: 
%s"), e.message);
                }
 
                var buffer = new uint8[MAGIC_SIZE];
@@ -71,7 +71,7 @@ private class Games.MegaDriveHeader : Object {
                var magic = (string) buffer;
                magic = magic.chomp ();
                if (!(magic in MAGIC_VALUES))
-                       throw new MegaDriveError.INVALID_HEADER ("The file doesn't have a Mega 
Drive/Genesis/32X header.");
+                       throw new MegaDriveError.INVALID_HEADER (_("The file doesn't have a Mega 
Drive/Genesis/32X header."));
        }
 }
 
diff --git a/plugins/sega-saturn/src/sega-saturn-header.vala b/plugins/sega-saturn/src/sega-saturn-header.vala
index b43122e..f634d66 100644
--- a/plugins/sega-saturn/src/sega-saturn-header.vala
+++ b/plugins/sega-saturn/src/sega-saturn-header.vala
@@ -48,7 +48,7 @@ private class Games.SegaSaturnHeader : Object {
                                header_offset = offset;
 
                if (header_offset == null)
-                       throw new SegaSaturnError.INVALID_HEADER ("The file doesn't have a Sega Saturn 
header.");
+                       throw new SegaSaturnError.INVALID_HEADER (_("The file doesn't have a Sega Saturn 
header."));
 
                return header_offset;
        }
@@ -59,7 +59,7 @@ private class Games.SegaSaturnHeader : Object {
                        stream.seek (offset + MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new SegaSaturnError.INVALID_SIZE (@"Invalid Sega Saturn header size: 
$(e.message)");
+                       throw new SegaSaturnError.INVALID_SIZE (_("Invalid Sega Saturn header size: %s"), 
e.message);
                }
 
                var buffer = new uint8[MAGIC_VALUE.length];
@@ -82,7 +82,7 @@ private class Games.SegaSaturnHeader : Object {
                        stream.seek (header_offset + offset, SeekType.SET);
                }
                catch (Error e) {
-                       throw new SegaSaturnError.INVALID_SIZE (@"Invalid Sega Saturn header size: 
$(e.message)");
+                       throw new SegaSaturnError.INVALID_SIZE (_("Invalid Sega Saturn header size: %s"), 
e.message);
                }
 
                var buffer = new uint8[size];
@@ -90,7 +90,7 @@ private class Games.SegaSaturnHeader : Object {
                        stream.read (buffer);
                }
                catch (Error e) {
-                       throw new SegaSaturnError.INVALID_HEADER ("The file doesn't have a Sega Saturn 
header.");
+                       throw new SegaSaturnError.INVALID_HEADER (_("The file doesn't have a Sega Saturn 
header."));
                }
 
                return (string) buffer;
@@ -101,7 +101,7 @@ private class Games.SegaSaturnHeader : Object {
                        return file.read ();
                }
                catch (Error e) {
-                       throw new SegaSaturnError.CANT_READ_FILE (@"Couldn't read file: $(e.message)");
+                       throw new SegaSaturnError.CANT_READ_FILE (_("Couldn't read file: %s"), e.message);
                }
        }
 }
diff --git a/plugins/steam/src/steam-game-source.vala b/plugins/steam/src/steam-game-source.vala
index 0d7b0f7..024db08 100644
--- a/plugins/steam/src/steam-game-source.vala
+++ b/plugins/steam/src/steam-game-source.vala
@@ -87,7 +87,7 @@ private class Games.SteamGameSource : Object, GameSource {
                        game_id = registry.get_data ({"AppState", "appID"});
 
                if (game_id == null)
-                       throw new SteamError.NO_APPID (@"Couldn't get Steam appid from manifest 
'$appmanifest_path'");
+                       throw new SteamError.NO_APPID (_("Couldn't get Steam appid from manifest '%s'."), 
appmanifest_path);
 
                var title = new SteamTitle (registry);
                var icon = new SteamIcon (game_id);
diff --git a/plugins/steam/src/steam-registry.vala b/plugins/steam/src/steam-registry.vala
index d6be919..2d1e46d 100644
--- a/plugins/steam/src/steam-registry.vala
+++ b/plugins/steam/src/steam-registry.vala
@@ -65,7 +65,7 @@ private class Games.SteamRegistry {
                var file = File.new_for_path (appmanifest_path);
 
                if (!file.query_exists ())
-                       throw new IOError.NOT_FOUND ("File '%s' doesn't exist.\n", file.get_path ());
+                       throw new IOError.NOT_FOUND (_("File '%s' doesn't exist."), file.get_path ());
 
                var dis = new DataInputStream (file.read ());
 
@@ -93,7 +93,7 @@ private class Games.SteamRegistry {
 
                while (index < tokens.length) {
                        if (tokens[index] == "{")
-                               throw new SteamRegistryError.UNEXPECTED_TOKEN ("Unexpected token '{'");
+                               throw new SteamRegistryError.UNEXPECTED_TOKEN (_("Unexpected token '{'."));
 
                        if (tokens[index] == "}") {
                                index++;
@@ -107,10 +107,10 @@ private class Games.SteamRegistry {
                        index++;
 
                        if (index >= tokens.length)
-                               throw new SteamRegistryError.UNEXPECTED_END ("Unexpected end of tokens");
+                               throw new SteamRegistryError.UNEXPECTED_END (_("Unexpected end of tokens."));
 
                        if (tokens[index] == "}")
-                               throw new SteamRegistryError.UNEXPECTED_TOKEN ("Unexpected token '}'");
+                               throw new SteamRegistryError.UNEXPECTED_TOKEN (_("Unexpected token '}'."));
 
                        if (tokens[index] == "{") {
                                index++;
diff --git a/plugins/steam/src/steam-title.vala b/plugins/steam/src/steam-title.vala
index 0a04540..18ff101 100644
--- a/plugins/steam/src/steam-title.vala
+++ b/plugins/steam/src/steam-title.vala
@@ -14,7 +14,7 @@ private class Games.SteamTitle : Object, Title {
 
                name = registry.get_data ({"AppState", "name"});
                if (name == null)
-                       throw new SteamError.NO_NAME (@"Couldn't get name from Steam registry.");
+                       throw new SteamError.NO_NAME (_("Couldn't get name from Steam registry."));
 
                return name;
        }
diff --git a/plugins/wii/src/wii-header.vala b/plugins/wii/src/wii-header.vala
index 0e952f9..5fe2b3f 100644
--- a/plugins/wii/src/wii-header.vala
+++ b/plugins/wii/src/wii-header.vala
@@ -17,7 +17,7 @@ private class Games.WiiHeader: Object {
                        stream.seek (MAGIC_OFFSET, SeekType.SET);
                }
                catch (Error e) {
-                       throw new WiiError.INVALID_SIZE (@"Invalid Wii header size: $(e.message)");
+                       throw new WiiError.INVALID_SIZE (_("Invalid Wii header size: %s"), e.message);
                }
 
                var buffer = new uint8[MAGIC_VALUE.length];
@@ -30,7 +30,7 @@ private class Games.WiiHeader: Object {
 
                var magic = (string) buffer;
                if (magic != MAGIC_VALUE)
-                       throw new WiiError.INVALID_HEADER ("The file doesn't have a Wii header.");
+                       throw new WiiError.INVALID_HEADER (_("The file doesn't have a Wii header."));
        }
 
        public string get_game_id () throws WiiError {
@@ -41,7 +41,7 @@ private class Games.WiiHeader: Object {
                        stream.read (buffer);
                }
                catch (Error e) {
-                       throw new WiiError.INVALID_HEADER ("The file doesn't have a Wii header.");
+                       throw new WiiError.INVALID_HEADER (_("The file doesn't have a Wii header."));
                }
 
                return (string) buffer;
@@ -52,7 +52,7 @@ private class Games.WiiHeader: Object {
                        return file.read ();
                }
                catch (Error e) {
-                       throw new WiiError.CANT_READ_FILE (@"Couldn't read file: $(e.message)");
+                       throw new WiiError.CANT_READ_FILE (_("Couldn't read file: %s"), e.message);
                }
        }
 }
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 00d33d4..3ad6cf9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -12,5 +12,23 @@ data/org.gnome.Games.desktop.in
 [type: gettext/glade]data/ui/quit-dialog.ui
 [type: gettext/glade]data/ui/remote-display.ui
 [type: gettext/glade]data/ui/resume-dialog.ui
+plugins/desktop/src/desktop-tracker-query.vala
+plugins/dreamcast/src/dreamcast-header.vala
+plugins/game-boy/src/game-boy-header.vala
+plugins/game-cube/src/game-cube-header.vala
+plugins/love/src/love-package.vala
+plugins/mame/src/mame-plugin.vala
+plugins/master-system/src/master-system-header.vala
+plugins/mega-drive/src/mega-drive-header.vala
+plugins/sega-saturn/src/sega-saturn-header.vala
+plugins/steam/src/steam-game-source.vala
+plugins/steam/src/steam-registry.vala
+plugins/steam/src/steam-title.vala
+plugins/wii/src/wii-header.vala
+src/command/command-runner.vala
+src/core/plugin-registrar.vala
+src/gamepad/gamepad-mapping.vala
+src/gamepad/linux/linux-raw-gamepad.vala
+src/retro/retro-runner.vala
 src/ui/application.vala
 src/ui/preferences-page-plugins.vala
diff --git a/src/command/command-runner.vala b/src/command/command-runner.vala
index baa61cf..2954b3a 100644
--- a/src/command/command-runner.vala
+++ b/src/command/command-runner.vala
@@ -19,7 +19,7 @@ public class Games.CommandRunner : Object, Runner {
 
        public void check_is_valid () throws Error {
                if (args.length < 1)
-                       throw new CommandError.INVALID_COMMAND ("Invalid command: it doesn't have any 
argument.");
+                       throw new CommandError.INVALID_COMMAND (_("Invalid command: it doesn't have any 
argument."));
        }
 
        public Gtk.Widget get_display () {
@@ -48,7 +48,7 @@ public class Games.CommandRunner : Object, Runner {
                                working_directory, args, envp, flags, child_setup, out pid,
                                out standard_input, out standard_output, out standard_error);
                        if (!result)
-                               throw new CommandError.EXECUTION_FAILED ("Couldn't run '%s': execution 
failed\n".printf (args[0]));
+                               throw new CommandError.EXECUTION_FAILED (_("Couldn't run '%s': execution 
failed."), args[0]);
                }
                catch (SpawnError e) {
                        warning ("%s\n", e.message);
diff --git a/src/core/plugin-registrar.vala b/src/core/plugin-registrar.vala
index 5f53576..fb660d0 100644
--- a/src/core/plugin-registrar.vala
+++ b/src/core/plugin-registrar.vala
@@ -24,7 +24,7 @@ private class Games.PluginRegistrar : TypeModule {
                        description = keyfile.get_string ("Plugin", "Description");
                }
                catch (Error e) {
-                       throw new PluginError.INVALID_PLUGIN_DESCRIPTOR ("Invalid plugin descriptor: %s", 
e.message);
+                       throw new PluginError.INVALID_PLUGIN_DESCRIPTOR (_("Invalid plugin descriptor: %s"), 
e.message);
                }
 
                loaded = false;
@@ -45,11 +45,11 @@ private class Games.PluginRegistrar : TypeModule {
 
                var object = Object.new (type);
                if (object == null)
-                       throw new PluginError.NOT_A_PLUGIN ("Couldn't create a new instance of plugin in 
'%s'.", module_path);
+                       throw new PluginError.NOT_A_PLUGIN (_("Couldn't create a new instance of plugin in 
'%s'."), module_path);
 
                var plugin = object as Plugin;
                if (plugin == null)
-                       throw new PluginError.NOT_A_PLUGIN ("Couldn't create a new instance of plugin in 
'%s'.", module_path);
+                       throw new PluginError.NOT_A_PLUGIN (_("Couldn't create a new instance of plugin in 
'%s'."), module_path);
 
                return plugin;
        }
diff --git a/src/gamepad/gamepad-mapping.vala b/src/gamepad/gamepad-mapping.vala
index 8e50942..b497b32 100644
--- a/src/gamepad/gamepad-mapping.vala
+++ b/src/gamepad/gamepad-mapping.vala
@@ -9,10 +9,10 @@ private class Games.GamepadMapping : Object {
 
        public GamepadMapping.from_sdl_string (string? mapping_string) throws GamepadMappingError {
                if (mapping_string == null)
-                       throw new GamepadMappingError.NOT_A_MAPPING ("The mapping string can't be null.");
+                       throw new GamepadMappingError.NOT_A_MAPPING (_("The mapping string can't be null."));
 
                if (mapping_string == "")
-                       throw new GamepadMappingError.NOT_A_MAPPING ("The mapping string can't be empty.");
+                       throw new GamepadMappingError.NOT_A_MAPPING (_("The mapping string can't be empty."));
 
                var mappings = mapping_string.split (",");
                foreach (var mapping in mappings) {
diff --git a/src/gamepad/linux/linux-raw-gamepad.vala b/src/gamepad/linux/linux-raw-gamepad.vala
index c25bc19..38ca20d 100644
--- a/src/gamepad/linux/linux-raw-gamepad.vala
+++ b/src/gamepad/linux/linux-raw-gamepad.vala
@@ -36,11 +36,11 @@ private class Games.LinuxRawGamepad : Object, RawGamepad {
                fd = Posix.open (file_name, Posix.O_RDONLY | Posix.O_NONBLOCK);
 
                if (fd < 0)
-                       throw new FileError.FAILED (@"Unable to open file $file_name: $(Posix.strerror 
(Posix.errno))");
+                       throw new FileError.FAILED (_("Unable to open file '%s': %s"), file_name, 
Posix.strerror (Posix.errno));
 
                device = new Libevdev.Evdev ();
                if (device.set_fd (fd) < 0)
-                       throw new FileError.FAILED (@"Evdev is unable to open $file_name: $(Posix.strerror 
(Posix.errno))");
+                       throw new FileError.FAILED (_("Evdev is unable to open '%s': %s"), file_name, 
Posix.strerror (Posix.errno));
 
                // Poll the events in the default main loop
                var channel = new IOChannel.unix_new (fd);
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 126614d..0546d64 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -154,11 +154,8 @@ public class Games.RetroRunner : Object, Runner {
        private void prepare_core (string module_basename, string uri) throws Error {
                var module_path = Retro.search_module (module_basename);
                var module = File.new_for_path (module_path);
-               if (!module.query_exists ()) {
-                       var msg = @"Couldn't run game: module '$module_basename' not found.";
-
-                       throw new RetroError.MODULE_NOT_FOUND (msg);
-               }
+               if (!module.query_exists ())
+                       throw new RetroError.MODULE_NOT_FOUND (_("Couldn't run game: module '%s' not 
found."), module_basename);
 
                core = new Retro.Core (module_path);
                audio = new RetroGtk.PaPlayer ();
@@ -175,7 +172,7 @@ public class Games.RetroRunner : Object, Runner {
                core.init ();
 
                if (!try_load_game (core, uri))
-                       throw new RetroError.INVALID_GAME_FILE (@"Invalid game file: $uri");
+                       throw new RetroError.INVALID_GAME_FILE (_("Invalid game file: '%s'."), uri);
        }
 
        private bool try_load_game (Retro.Core core, string uri) {
@@ -302,7 +299,7 @@ public class Games.RetroRunner : Object, Runner {
                var buffer = new uint8[size];
 
                if (!core.serialize (buffer))
-                       throw new RetroError.COULDNT_WRITE_SNAPSHOT ("Couldn't write snapshot.");
+                       throw new RetroError.COULDNT_WRITE_SNAPSHOT (_("Couldn't write snapshot."));
 
                var dir = Application.get_snapshots_dir ();
                try_make_dir (dir);
@@ -329,7 +326,7 @@ public class Games.RetroRunner : Object, Runner {
                        warning ("Unexpected serialization data size: got %lu, expected %lu\n", data.length, 
expected_size);
 
                if (!core.unserialize (data))
-                       throw new RetroError.COULDNT_LOAD_SNAPSHOT ("Couldn't load snapshot.");
+                       throw new RetroError.COULDNT_LOAD_SNAPSHOT (_("Couldn't load snapshot."));
        }
 
        private string get_screenshot_path () throws Error {


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