diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | lang/fr.po (renamed from lang/trayfreq_fr.po) | 0 | ||||
-rw-r--r-- | lang/trayfreq_fr.mo | bin | 1029 -> 0 bytes | |||
-rw-r--r-- | strings.h | 49 | ||||
-rw-r--r-- | trayfreq.c | 7 | ||||
-rw-r--r-- | trayfreq_set/trayfreq_set.c | 7 |
7 files changed, 22 insertions, 57 deletions
@@ -42,7 +42,7 @@ trayfreq_set_SOURCES = trayfreq_set/trayfreq_set.c \ ######################################################################## # Make entire suite -all: trayfreq trayfreq-set +all: trayfreq trayfreq-set lang ######################################################################## ######################################################################## @@ -58,11 +58,16 @@ trayfreq: $(CC) -o trayfreq $(trayfreq_SOURCES) $(trayfreq_CFLAGS) $(trayfreq_LDFLAGS) ######################################################################## +######################################################################## +# Make language files +lang: + msgfmt -c -o lang/fr.mo lang/fr.po +######################################################################## ######################################################################## # Remove generated files clean: - rm -f trayfreq trayfreq-set + rm -f trayfreq trayfreq-set lang/*.mo ######################################################################## @@ -71,6 +76,9 @@ clean: install: mkdir -p $(INSTALL_PATH)/usr/share/trayfreq/ cp data/*.png $(INSTALL_PATH)/usr/share/trayfreq/ + + cp lang/fr.mo $(INSTALL_PATH)/usr/share/locale/fr/LC_MESSAGES/trayfreq.mo + install -Dm 644 data/trayfreq.config $(INSTALL_PATH)/usr/share/trayfreq/trayfreq.config install -Dm 644 data/trayfreq.desktop $(INSTALL_PATH)/etc/xdg/autostart/trayfreq.desktop install -Dm 755 trayfreq $(INSTALL_PATH)/usr/bin/trayfreq @@ -1,6 +1,4 @@ What? ===== -The official trayfreq (see AUTHORS) was abandoned in 2009 and stopped working with modern, up-to-date Linux systems. This is a fork which is designed to work on newer Archlinux systems, however it shouldn't be limited to Arch. - -Check out the [ArchWiki](https://wiki.archlinux.org/index.php/Trayfreq) for more info about this software. +This is a fork of trayfreq which is intended to work on modern Archlinux systems (it'll probably work on other systems too). diff --git a/lang/trayfreq_fr.po b/lang/fr.po index 9bd6ade..9bd6ade 100644 --- a/lang/trayfreq_fr.po +++ b/lang/fr.po diff --git a/lang/trayfreq_fr.mo b/lang/trayfreq_fr.mo Binary files differdeleted file mode 100644 index 754a8d3..0000000 --- a/lang/trayfreq_fr.mo +++ /dev/null diff --git a/strings.h b/strings.h deleted file mode 100644 index b7b556b..0000000 --- a/strings.h +++ /dev/null @@ -1,49 +0,0 @@ - - -/* -#ifndef STRINGS_H -#define STRINGS_H - #ifdef LANG_FR - //////////////////////////////////////////////////////////////// - // FRANCAIS - #define S_TRAYFREQ_SET_C_FILE_OPEN_ERROR "ERREUR: Pouvais pas ecrit à %s\n" - #define S_TRAYFREQ_SET_C_NO_ARGS "Utiliser -g pour activer les profils or -f pour activer les fréquences\n" - #define S_TRAYFREQ_SET_C_SET_FREQUENCY_ARG "Indiquer la fréquence avec un -f\n" - #define S_TRAYFREQ_SET_C_SET_GOVERNOR_ARG "Indiquer le profil avec un -g\n" - #define S_TRAYFREQ_SET_C_SET_CORE_ARG "Indiquer le core avec un -c\n" - - #define S_TRAY_C_GOVERNOR "Profil: %s\n" - #define S_TRAY_C_CPU "CPU%i: %s%s" - - #define S_TRAYFREQ_C_GTK_ERROR "Erreur gtk: gtk_init_check est FALSE.\nJe partes." - #define S_TRAYFREQ_C_CONFIG_FILE_ERROR "[Translate me] Failed to open config files!\n" - - #define S_BAT_TRAY_C_BATTERY_FULL "Complètement chargée" - #define S_BAT_TRAY_C_BATTERY_CHARGING "Charging (%i%%)" - #define S_BAT_TRAY_C_BATTERY_DISCHARGING "Discharging (%i%%)" - #define S_BAT_TRAY_C_BATTERY_UNKNOWN "?" - //////////////////////////////////////////////////////////////// - - #else - //////////////////////////////////////////////////////////////// - // ENGLISH - #define S_TRAYFREQ_SET_C_FILE_OPEN_ERROR "FAILED: Couldn't open %s for writing\n" - #define S_TRAYFREQ_SET_C_NO_ARGS "Use -g to set the governor or -f to set the frequency\n" - #define S_TRAYFREQ_SET_C_SET_FREQUENCY_ARG "Pass the frequency with -f\n" - #define S_TRAYFREQ_SET_C_SET_GOVERNOR_ARG "Pass the governor with -g\n" - #define S_TRAYFREQ_SET_C_SET_CORE_ARG "Pass the core with -c\n" - - #define S_TRAY_C_GOVERNOR - #define S_TRAY_C_CPU - - #define S_TRAYFREQ_C_GTK_ERROR - #define S_TRAYFREQ_C_CONFIG_FILE_ERROR - - #define S_BAT_TRAY_C_BATTERY_FULL "Fully charged" - #define S_BAT_TRAY_C_BATTERY_CHARGING - #define S_BAT_TRAY_C_BATTERY_DISCHARGING - #define S_BAT_TRAY_C_BATTERY_UNKNOWN "Unknown status" - //////////////////////////////////////////////////////////////// - #endif -#endif -*/
\ No newline at end of file @@ -32,6 +32,7 @@ #include <stdlib.h> #include <stdio.h> #include <libintl.h> +#include <locale.h> static gboolean SHOW_BATTERY = TRUE; @@ -102,7 +103,9 @@ void config_init() int main(int argc, char** argv) { - //gboolean gtk_init_success = gtk_init_check(&argc, &argv); + setlocale(LC_ALL, ""); + bindtextdomain("trayfreq","/usr/share/locale"); + textdomain("trayfreq"); if(!gtk_init_check(&argc, &argv)) { @@ -126,4 +129,4 @@ int main(int argc, char** argv) gtk_main(); return 0; -}
\ No newline at end of file +} diff --git a/trayfreq_set/trayfreq_set.c b/trayfreq_set/trayfreq_set.c index ac22a8b..a9de8c1 100644 --- a/trayfreq_set/trayfreq_set.c +++ b/trayfreq_set/trayfreq_set.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <string.h> #include <libintl.h> +#include <locale.h> #include "../strings.h" #include "../freq_tray/getfreq.h" @@ -105,6 +106,10 @@ void set_freq(char* freq, char* core) int main(int argc, char *argv[]) { + setlocale(LC_ALL,""); + bindtextdomain("trayfreq","/usr/share/locale"); + textdomain("trayfreq"); + gc_init(); gf_init(); @@ -149,4 +154,4 @@ int main(int argc, char *argv[]) printf( _("Use -g to set the governor or -f to set the frequency\n") ); } return 0; -}
\ No newline at end of file +} |