aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--README.md4
-rw-r--r--lang/fr.po (renamed from lang/trayfreq_fr.po)0
-rw-r--r--lang/trayfreq_fr.mobin1029 -> 0 bytes
-rw-r--r--strings.h49
-rw-r--r--trayfreq.c7
-rw-r--r--trayfreq_set/trayfreq_set.c7
7 files changed, 22 insertions, 57 deletions
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/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
deleted file mode 100644
index 754a8d3..0000000
--- a/lang/trayfreq_fr.mo
+++ /dev/null
Binary files differ
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 <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
+}