From 60b23749238831c3c6105cb082bb6bc921e3cc12 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 27 Apr 2014 13:15:34 +1200 Subject: Moved lang files --- Makefile | 12 +++++-- README.md | 4 +-- lang/fr.po | 86 ++++++++++++++++++++++++++++++++++++++++++++ lang/trayfreq_fr.mo | Bin 1029 -> 0 bytes lang/trayfreq_fr.po | 86 -------------------------------------------- strings.h | 49 ------------------------- trayfreq.c | 7 ++-- trayfreq_set/trayfreq_set.c | 7 +++- 8 files changed, 108 insertions(+), 143 deletions(-) create mode 100644 lang/fr.po delete mode 100644 lang/trayfreq_fr.mo delete mode 100644 lang/trayfreq_fr.po delete mode 100644 strings.h diff --git a/Makefile b/Makefile index 7051038..a383166 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 49e3fe3..c2800b9 100644 --- a/README.md +++ b/README.md @@ -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/fr.po b/lang/fr.po new file mode 100644 index 0000000..9bd6ade --- /dev/null +++ b/lang/fr.po @@ -0,0 +1,86 @@ +# French translations for PACKAGE package +# Traductions françaises du paquet PACKAGE. +# Copyright (C) 2014 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: trayfreq 4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-04-27 12:49+1200\n" +"PO-Revision-Date: 2014-04-27 12:49+1200\n" +"Last-Translator: \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: tray.c:183 +#, c-format +msgid "Governor: %s\n" +msgstr "Profil: %s\n" + +#: tray.c:189 +#, c-format +msgid "CPU%i: %s%s" +msgstr "CPU%i: %s%s" + +#: trayfreq.c:67 +msgid "Failed to open config files!\n" +msgstr "" + +#: trayfreq.c:112 +msgid "" +"GTK Error: gtk_init_check returned FALSE.\n" +"Bailing." +msgstr "" + +#: bat_tray/bat_tray.c:56 +#, c-format +msgid "Discharging (%i%%)" +msgstr "" + +#: bat_tray/bat_tray.c:60 +#, c-format +msgid "Charging (%i%%)" +msgstr "" + +#: bat_tray/bat_tray.c:63 +#, c-format +msgid "Fully charged" +msgstr "Complétment chargée" + +#: bat_tray/bat_tray.c:67 +#, c-format +msgid "Unknown status" +msgstr "" + +#: trayfreq_set/trayfreq_set.c:42 +#, c-format +msgid "FAILED: Couldn't open %s for writing\n" +msgstr "ERREUR: Pouvais pas ecrit à %s\n" + +#: trayfreq_set/trayfreq_set.c:118 trayfreq_set/trayfreq_set.c:154 +#, c-format +msgid "Use -g to set the governor or -f to set the frequency\n" +msgstr "Utiliser -g pour activer les profils ou -f pour activer les fréquences\n" + +#: trayfreq_set/trayfreq_set.c:121 +#, c-format +msgid "Pass the governor with -g\n" +msgstr "Indiquer le profil avec un -c\n" + +#: trayfreq_set/trayfreq_set.c:125 trayfreq_set/trayfreq_set.c:129 +#: trayfreq_set/trayfreq_set.c:133 trayfreq_set/trayfreq_set.c:142 +#: trayfreq_set/trayfreq_set.c:146 trayfreq_set/trayfreq_set.c:150 +#, c-format +msgid "Pass the core with -c\n" +msgstr "Indiquer le core avec un -c\n" + +#: trayfreq_set/trayfreq_set.c:138 +#, c-format +msgid "Pass the frequency with -f\n" +msgstr "Indiquer la fréquence avec un -f\n" diff --git a/lang/trayfreq_fr.mo b/lang/trayfreq_fr.mo deleted file mode 100644 index 754a8d3..0000000 Binary files a/lang/trayfreq_fr.mo and /dev/null differ diff --git a/lang/trayfreq_fr.po b/lang/trayfreq_fr.po deleted file mode 100644 index 9bd6ade..0000000 --- a/lang/trayfreq_fr.po +++ /dev/null @@ -1,86 +0,0 @@ -# French translations for PACKAGE package -# Traductions françaises du paquet PACKAGE. -# Copyright (C) 2014 THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: trayfreq 4\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-27 12:49+1200\n" -"PO-Revision-Date: 2014-04-27 12:49+1200\n" -"Last-Translator: \n" -"Language-Team: French\n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: tray.c:183 -#, c-format -msgid "Governor: %s\n" -msgstr "Profil: %s\n" - -#: tray.c:189 -#, c-format -msgid "CPU%i: %s%s" -msgstr "CPU%i: %s%s" - -#: trayfreq.c:67 -msgid "Failed to open config files!\n" -msgstr "" - -#: trayfreq.c:112 -msgid "" -"GTK Error: gtk_init_check returned FALSE.\n" -"Bailing." -msgstr "" - -#: bat_tray/bat_tray.c:56 -#, c-format -msgid "Discharging (%i%%)" -msgstr "" - -#: bat_tray/bat_tray.c:60 -#, c-format -msgid "Charging (%i%%)" -msgstr "" - -#: bat_tray/bat_tray.c:63 -#, c-format -msgid "Fully charged" -msgstr "Complétment chargée" - -#: bat_tray/bat_tray.c:67 -#, c-format -msgid "Unknown status" -msgstr "" - -#: trayfreq_set/trayfreq_set.c:42 -#, c-format -msgid "FAILED: Couldn't open %s for writing\n" -msgstr "ERREUR: Pouvais pas ecrit à %s\n" - -#: trayfreq_set/trayfreq_set.c:118 trayfreq_set/trayfreq_set.c:154 -#, c-format -msgid "Use -g to set the governor or -f to set the frequency\n" -msgstr "Utiliser -g pour activer les profils ou -f pour activer les fréquences\n" - -#: trayfreq_set/trayfreq_set.c:121 -#, c-format -msgid "Pass the governor with -g\n" -msgstr "Indiquer le profil avec un -c\n" - -#: trayfreq_set/trayfreq_set.c:125 trayfreq_set/trayfreq_set.c:129 -#: trayfreq_set/trayfreq_set.c:133 trayfreq_set/trayfreq_set.c:142 -#: trayfreq_set/trayfreq_set.c:146 trayfreq_set/trayfreq_set.c:150 -#, c-format -msgid "Pass the core with -c\n" -msgstr "Indiquer le core avec un -c\n" - -#: trayfreq_set/trayfreq_set.c:138 -#, c-format -msgid "Pass the frequency with -f\n" -msgstr "Indiquer la fréquence avec un -f\n" 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 diff --git a/trayfreq.c b/trayfreq.c index 5d28add..4b15360 100644 --- a/trayfreq.c +++ b/trayfreq.c @@ -32,6 +32,7 @@ #include #include #include +#include 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 #include #include +#include #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 +} -- cgit v1.1