Running sarg -x -v display the version number but also the directory where
the message file is looked for, the package name and the currently
selected locale.
FileListObject AccessLog=NULL;
+//! Selected locale set through the environment variable.
+char *CurrentLocale=NULL;
+
static void getusers(const char *pwdfile, int debug);
int main(int argc,char *argv[])
#endif
#if defined(ENABLE_NLS) && defined(HAVE_LOCALE_H)
- if (!setlocale (LC_ALL, "")) {
+ CurrentLocale=setlocale (LC_ALL, "");
+ if (!CurrentLocale) {
fprintf(stderr,"SARG: Cannot set the locale LC_ALL to the environment variable\n");
exit(EXIT_FAILURE);
}
//! The list of the HTTP codes to exclude from the report.
static char *excludecode=NULL;
+extern char *CurrentLocale;
+
#if USE_GETWORD_BACKTRACE
static void getword_backtrace(void)
{
void version(void)
{
printf(_("SARG Version: %s\n"),VERSION);
+#if defined(ENABLE_NLS) && defined(HAVE_LOCALE_H)
+ if (debug) {
+ printf(_("Translation file should be somewhere under \"%s\" and be named \"%s.mo\"\n"),LOCALEDIR,PACKAGE_NAME);
+ if (CurrentLocale) printf(_("The currently selected locale is \"%s\"\n"),CurrentLocale);
+ }
+#endif
exit(EXIT_SUCCESS);
}