From fa14c5dd9a80d98296fb0230be3c99daae3e0131 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 25 Apr 2014 19:01:34 +1200 Subject: Making preparations for gettext --- trayfreq_set/trayfreq_set.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'trayfreq_set/trayfreq_set.c') diff --git a/trayfreq_set/trayfreq_set.c b/trayfreq_set/trayfreq_set.c index 9318403..ac22a8b 100644 --- a/trayfreq_set/trayfreq_set.c +++ b/trayfreq_set/trayfreq_set.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "../strings.h" #include "../freq_tray/getfreq.h" @@ -37,7 +38,7 @@ void prepare_path(const char* file, const char* core) void file_open_error() { - printf(S_TRAYFREQ_SET_C_FILE_OPEN_ERROR, file_path); + printf( _("FAILED: Couldn't open %s for writing\n") , file_path); } void set_freq_max(const char* freq, const char* core) @@ -109,43 +110,43 @@ int main(int argc, char *argv[]) if(!argv[1]) { - printf(S_TRAYFREQ_SET_C_NO_ARGS); + printf( _("Use -g to set the governor or -f to set the frequency\n") ); } else if(strcmp(argv[1], "-g") == 0) { if(!argv[2]) - printf(S_TRAYFREQ_SET_C_SET_GOVERNOR_ARG); + printf( _("Pass the governor with -g\n") ); else { if(!argv[3]) - printf(S_TRAYFREQ_SET_C_SET_CORE_ARG); + printf( _("Pass the core with -c\n") ); else if(strcmp(argv[3], "-c") == 0) { if(!argv[4]) - printf(S_TRAYFREQ_SET_C_SET_CORE_ARG); + printf( _("Pass the core with -c\n") ); else set_gov(argv[2], argv[4]); } else - printf(S_TRAYFREQ_SET_C_SET_CORE_ARG); + printf( _("Pass the core with -c\n") ); } } else if(strcmp(argv[1], "-f") == 0) { if(!argv[2]) { - printf(S_TRAYFREQ_SET_C_SET_FREQUENCY_ARG); + printf( _("Pass the frequency with -f\n") ); } else { if(!argv[3]) { - printf(S_TRAYFREQ_SET_C_SET_CORE_ARG); + printf( _("Pass the core with -c\n") ); } else if(strcmp(argv[3], "-c") == 0) { if(!argv[4]) - printf(S_TRAYFREQ_SET_C_SET_CORE_ARG); + printf( _("Pass the core with -c\n") ); else set_freq(argv[2], argv[4]); } else { - printf(S_TRAYFREQ_SET_C_SET_CORE_ARG); + printf( _("Pass the core with -c\n") ); } } } else { - printf(S_TRAYFREQ_SET_C_NO_ARGS); + printf( _("Use -g to set the governor or -f to set the frequency\n") ); } return 0; } \ No newline at end of file -- cgit v1.1