update translations

This commit is contained in:
2020-08-06 20:38:10 -04:00
parent 95d084883f
commit e093aed41a
9 changed files with 506 additions and 282 deletions

View File

@@ -332,49 +332,49 @@ namespace TUFManager {
var current_setting = get_fan_mode ();
switch (current_setting) {
case 0:
command_line.print (_ ("Current fan mode: Balanced\n"));
command_line.print (_ ("Current fan mode: ") + _ ("Balanced\n"));
break;
case 1:
command_line.print (_ ("Current fan mode: Turbo\n"));
command_line.print (_ ("Current fan mode: ") + _ ("Turbo\n"));
break;
case 2:
command_line.print (_ ("Current fan mode: Silent\n"));
command_line.print (_ ("Current fan mode: ") + _ ("Silent\n"));
break;
default:
command_line.printerr (_ ("Error: Could not get current fan mode!\n"));
command_line.printerr (_ ("Error: ") + _ ("Could not get current fan mode!\n"));
break;
}
current_setting = get_keyboard_mode ();
switch (current_setting) {
case 0:
command_line.print (_ ("Current keyboard lighting: Static\n"));
command_line.print (_ ("Current keyboard lighting: ") + _ ("Static\n"));
break;
case 1:
command_line.print (_ ("Current keyboard lighting: Breathing\n"));
command_line.print (_ ("Current keyboard lighting: ") + _ ("Breathing\n"));
break;
case 2:
command_line.print (_ ("Current keyboard lighting: Color Cycle\n"));
command_line.print (_ ("Current keyboard lighting: ") + _ ("Color Cycle\n"));
break;
case 3:
command_line.print (_ ("Current keyboard lighting: Strobing\n"));
command_line.print (_ ("Current keyboard lighting: ") + _ ("Strobing\n"));
break;
default:
command_line.printerr (_ ("Error: Could not get current keyboard mode!\n"));
command_line.printerr (_ ("Error: ") + _ ("Could not get current keyboard mode!\n"));
break;
}
current_setting = get_keyboard_speed ();
switch (current_setting) {
case 0:
command_line.print (_ ("Current keyboard speed: Slow\n"));
command_line.print (_ ("Current keyboard speed: ") + _ ("Slow\n"));
break;
case 1:
command_line.print (_ ("Current keyboard speed: Medium\n"));
command_line.print (_ ("Current keyboard speed: ") + _ ("Medium\n"));
break;
case 2:
command_line.print (_ ("Current keyboard speed: Fast\n"));
command_line.print (_ ("Current keyboard speed: ") + _ ("Fast\n"));
break;
default:
command_line.printerr (_ ("Error: Could not get current fan mode!\n"));
command_line.printerr (_ ("Error: ") + _ ("Could not get current keyboard speed!\n"));
break;
}
var current_color = get_keyboard_color ();
@@ -383,7 +383,7 @@ namespace TUFManager {
(uint) (Math.round (current_color.green * 255)),
(uint) (Math.round (current_color.blue * 255))
).up ();
command_line.print (_ ("Current keyboard color: " + color_hex + "\n"));
command_line.print (_ ("Current keyboard color: ") + color_hex + "\n");
release_cli ();
return 0;
}
@@ -494,17 +494,17 @@ namespace TUFManager {
* @param command_line The command line currently in use to print to
*/
private void print_usage (ApplicationCommandLine command_line) {
command_line.print ("Usage: tuf-cli COMMAND [SUBCOMMAND] ...\n\n");
command_line.print (" version Print the version of tuf-cli\n");
command_line.print (" help Show this help screen\n");
command_line.print (" fan [balanced, turbo, silent] Set the fan mode\n");
command_line.print (" lighting [static, breath, cycle, stobe] Set the keyboard lighting\n");
command_line.print (" speed [slow, medium, fast] Set the keyboard lighting speed\n");
command_line.print (" color [\"#XXXXXX\"] Set the keyboard color\n");
command_line.print (" info Show the current config\n\n");
command_line.print ("Examples:\n");
command_line.print (" Silence fan: tuf-cli fan silent\n");
command_line.print (" Change RGB color: tuf-cli color \"#FF0000\"\n");
command_line.print (_ ("Usage:") + " tuf-cli " + _ ("COMMAND [SUBCOMMAND]") + " ...\n\n");
command_line.print (" version " + _ ("Print the version of tuf-cli\n"));
command_line.print (" help " + _ ("Show this help screen\n"));
command_line.print (" fan [balanced, turbo, silent] " + _ ("Set the fan mode\n"));
command_line.print (" lighting [static, breath, cycle, stobe] " + _ ("Set the keyboard lighting\n"));
command_line.print (" speed [slow, medium, fast] " + _ ("Set the keyboard lighting speed\n"));
command_line.print (" color [\"#XXXXXX\"] " + _ ("Set the keyboard color\n"));
command_line.print (" info " + _ ("Show the current config\n\n"));
command_line.print (_ ("Examples:\n"));
command_line.print (" " + _ ("Silence fan:") + " tuf-cli fan silent\n");
command_line.print (" " + _ ("Change RGB color:") + " tuf-cli color \"#FF0000\"\n");
}
/**

View File

@@ -79,7 +79,7 @@ namespace TUFManager {
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
return -3;
}
@@ -94,10 +94,10 @@ namespace TUFManager {
tuf_server.set_fan_mode (mode, bus_name);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
@@ -111,10 +111,10 @@ namespace TUFManager {
return tuf_server.get_keyboard_color ();
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
return Gdk.RGBA ();
}
@@ -129,10 +129,10 @@ namespace TUFManager {
tuf_server.set_keyboard_color (color, bus_name);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
@@ -146,10 +146,10 @@ namespace TUFManager {
return tuf_server.get_keyboard_mode ();
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
return -3;
}
@@ -164,10 +164,10 @@ namespace TUFManager {
tuf_server.set_keyboard_mode (mode, bus_name);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
@@ -181,10 +181,10 @@ namespace TUFManager {
return tuf_server.get_keyboard_speed ();
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
return -3;
}
@@ -199,10 +199,10 @@ namespace TUFManager {
tuf_server.set_keyboard_speed (speed, bus_name);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
}

View File

@@ -76,14 +76,14 @@ namespace TUFManager {
connect_tuf_server ();
}
catch (TUFError e) {
stderr.printf ("Error: %s:\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
if (e.code == TUFError.UNMATCHED_VERSIONS) {
Gtk.MessageDialog msg;
msg = new Gtk.MessageDialog (this,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE,
_ ("The current running tuf-server version doesn't match the gui version!"));
_ ("The current running tuf-server version doesn't match the GUI version!"));
msg.response.connect ((response_id) => {
msg.destroy ();
this.close ();
@@ -106,7 +106,7 @@ namespace TUFManager {
print (_ ("Current fan mode: ") + fan_mode.get_active_text () + "\n");
}
else {
stderr.printf ("%s\n", _ ("Error: Could not get current fan mode!"));
stderr.printf ("%s\n", _ ("Error: ") + _ ("Could not get current fan mode!"));
}
// Get the keyboard mode
@@ -122,7 +122,7 @@ namespace TUFManager {
print (_ ("Current keyboard mode: ") + keyboard_mode.get_active_text () + "\n");
}
else {
stderr.printf ("%s\n", _ ("Error: Could not get current keyboard mode!"));
stderr.printf ("%s\n", _ ("Error: ") + _ ("Could not get current keyboard mode!"));
}
// Get the keyboard speed
@@ -132,7 +132,7 @@ namespace TUFManager {
print (_ ("Current keyboard speed: ") + keyboard_speed.get_active_text () + "\n");
}
else {
stderr.printf ("%s\n", _ ("Error: Could not get current keyboard speed!"));
stderr.printf ("%s\n", _ ("Error: ") + _ ("Could not get current keyboard speed!"));
}
// Get the keyboard color

View File

@@ -31,7 +31,7 @@ namespace TUFManager {
stderr.printf (_ ("Error: %s\n"), e.message);
}
if (application.get_is_remote ()) {
stderr.printf (_ ("Error: %s\n"), _ ("Another instance of TUF Manager is already running!"));
stderr.printf (_ ("Error: ") + _ ("Another instance of TUF Manager is already running!\n"));
return -1;
}
return application.run (args);

View File

@@ -75,7 +75,7 @@ namespace TUFManager {
if (pid < 0) {
Posix.exit (Posix.EXIT_FAILURE);
}
if (pid > 0) {
try {
File file = File.new_for_path ("/run/tufmanager");
@@ -89,11 +89,11 @@ namespace TUFManager {
}
var stream = FileStream.open ("/run/tufmanager/pid", "w");
if (stream == null) {
stderr.printf (_ ("Could not create pid file!\n"));
stderr.printf (_ ("Error: ") + _ ("Could not create pid file!\n"));
}
else {
uint32 pidfile = pid;
stream.puts (pidfile.to_string ());
stream.puts (pidfile.to_string ());
}
Posix.exit (Posix.EXIT_SUCCESS);
}
@@ -119,7 +119,7 @@ namespace TUFManager {
on_bus_acquired,
() => {},
() => {
stderr.printf (_ ("Could not acquire bus name!\n"));
stderr.printf (_ ("Error: ") + _ ("Could not acquire bus name!\n"));
});
loop = new MainLoop ();

View File

@@ -47,7 +47,7 @@ namespace TUFManager {
conn.register_object ("/org/tuf/manager/server", tuf_server);
}
catch (IOError e) {
stderr.printf (_ ("Error: Could not register service\n"));
stderr.printf (_ ("Error: ") + _ ("Could not register service!\n"));
if (loop != null) {
loop.quit ();
}
@@ -198,10 +198,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
if (authorized) {
@@ -209,10 +209,10 @@ namespace TUFManager {
set_fan_mode_authorized (mode, sender);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
else {
@@ -318,10 +318,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
if (authorized) {
@@ -329,10 +329,10 @@ namespace TUFManager {
set_keyboard_color_authorized (color, sender);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
else {
@@ -444,10 +444,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
if (authorized) {
@@ -455,10 +455,10 @@ namespace TUFManager {
set_keyboard_mode_authorized (mode, sender);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
else {
@@ -556,10 +556,10 @@ namespace TUFManager {
authorized = get_authorization.end (res);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
if (authorized) {
@@ -567,10 +567,10 @@ namespace TUFManager {
set_keyboard_speed_authorized (speed, sender);
}
catch (TUFError e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
stderr.printf (_ ("Error: %s\n"), e.message);
}
}
else {