+2012-04-12: v1.6:
++ Add option to force LANG for changing weekdays order
+
2012-03-26: v1.5:
- Fix compilation on BSD
- Fix current executable path on BSD
AC_PREREQ([2.65])
AC_INIT([gsimplecal],
- [1.5],
+ [1.6],
[https://github.com/dmedvinsky/gsimplecal/issues],
[gsimplecal],
[https://github.com/dmedvinsky/gsimplecal])
.br
clock_format = %a %d %b %H:%M
.br
+force_lang = en_US.utf8
+.br
mainwindow_decorated = 0
.br
mainwindow_keep_above = 1
\fBclock_format\fP: string
Sets the clocks format. Look \fIman strftime\fP for the possible formats.
+.TP 5
+\fBforce_lang\fP: string
+Overrides the \fILANG\fP environment variable, thus making it possible to
+change the first day of week, i.e. choose if Monday or Sunday goes first.
+Basically it's the same as running gsimplecal as
+
+ LANG=en_GB.utf8 gsimplecal
+
+Must be one of \fIlocale -a\fP output.
+
.TP 5
\fBmainwindow_decorated\fP: 1 or 0, defaults to 0.
Tells your window manager to decorate or not to decorate the main window.
mainwindow_position = GTK_WIN_POS_NONE;
}
} else if (var == "mainwindow_xoffset") {
- stringstream convert(val);
- if (!(convert >> mainwindow_xoffset)) {
- mainwindow_xoffset = 0;
- }
+ stringstream convert(val);
+ if (!(convert >> mainwindow_xoffset)) {
+ mainwindow_xoffset = 0;
+ }
} else if (var == "mainwindow_yoffset") {
stringstream convert(val);
if (!(convert >> mainwindow_yoffset)) {
- mainwindow_yoffset = 0;
- }
+ mainwindow_yoffset = 0;
+ }
} else if (var == "mainwindow_resizable") {
if (!fromString<bool>(mainwindow_resizable, val)) {
mainwindow_resizable = true;
if (!fromString<bool>(close_on_unfocus, val)) {
close_on_unfocus = false;
}
+ } else if (var == "force_lang") {
+ force_lang = val;
}
}
string external_viewer;
bool show_week_numbers;
bool close_on_unfocus;
+ string force_lang;
bool mainwindow_decorated;
bool mainwindow_keep_above;
#include <iostream>
#include <string.h>
+#include <stdlib.h>
#include <signal.h>
#include <gtk/gtk.h>
signal(SIGUSR2, &signal_handler);
signal(SIGCHLD, SIG_IGN);
+ Config* config = Config::getInstance();
+ if (config->force_lang.length()) {
+ // Must be done before gtk_init call.
+ setenv("LANG", config->force_lang.c_str(), 1);
+ }
+
gtk_init(&argc, &argv);
main_window = new MainWindow();
gtk_signal_connect(GTK_OBJECT(main_window->getWindow()), "destroy",
GTK_SIGNAL_FUNC(destroy), NULL);
- Config* config = Config::getInstance();
if (config->show_timezones) {
g_timeout_add(30000, (GSourceFunc)time_handler, NULL);
}