commands { return TYPE_CMDQUEUE; }
postcommands { return TYPE_POSTCMDQUEUE; }
encoding { return TYPE_ENCODING; }
+locale { return TYPE_LOCALE; }
yes { yylval.i = 1; return TYPE_BOOL; }
no { yylval.i = 0; return TYPE_BOOL; }
dglstart { yylval.i = DGLTIME_DGLSTART; return TYPE_CMDQUEUENAME; }
%token TYPE_CMDQUEUE TYPE_DEFINE_MENU TYPE_BANNER_FILE TYPE_CURSOR
%token TYPE_POSTCMDQUEUE
%token TYPE_MAX_IDLE_TIME TYPE_MENU_MAX_IDLE_TIME TYPE_EXTRA_INFO_FILE
-%token TYPE_ENCODING
+%token TYPE_ENCODING TYPE_LOCALE
%token <s> TYPE_VALUE
%token <i> TYPE_NUMBER TYPE_CMDQUEUENAME
%type <kt> KeyType
globalconfig.passwd = strdup($3);
break;
+ case TYPE_LOCALE:
+ if (globalconfig.locale) free(globalconfig.locale);
+ globalconfig.locale = strdup($3);
+ break;
+
default:
fprintf(stderr, "%s:%d: token %s does not take a string, bailing out\n",
config, line, lookup_token($1));
| TYPE_PATH_LOCKFILE { $$ = TYPE_PATH_LOCKFILE; }
| TYPE_PATH_INPROGRESS { $$ = TYPE_PATH_INPROGRESS; }
| TYPE_ENCODING { $$ = TYPE_ENCODING; }
+ | TYPE_LOCALE { $$ = TYPE_LOCALE; }
| TYPE_RC_FMT { $$ = TYPE_RC_FMT; }
| TYPE_WATCH_SORTMODE { $$ = TYPE_WATCH_SORTMODE; }
| TYPE_SERVER_ID { $$ = TYPE_SERVER_ID; }
case TYPE_WATCH_SORTMODE: return "sortmode";
case TYPE_WATCH_COLUMNS: return "watch_columns";
case TYPE_SERVER_ID: return "server_id";
+ case TYPE_LOCALE: return "locale";
default: abort();
}
}
}
}
- setlocale(LC_CTYPE, "en_US.UTF-8");
+ if (globalconfig.locale) {
+ setlocale(LC_CTYPE, globalconfig.locale);
+ }
if (showplayers) {
inprogressdisplay(-1);
int allow_registration; /* allow registering new nicks */
int sortmode; /* default watching-screen sortmode */
char *server_id; /* string for the server name or whatever */
+ char *locale;
struct dg_cmdpart *cmdqueue[NUM_DGLTIMES];
if (!globalconfig.allow_registration) globalconfig.allow_registration = 1;
globalconfig.menulist = NULL;
globalconfig.server_id = NULL;
+ globalconfig.locale = NULL;
globalconfig.shed_uid = (uid_t)-1;
globalconfig.shed_gid = (gid_t)-1;
shed_uid = 5
shed_gid = 60
+# Locale. Leaving this out, dgamelaunch will not explicitly set locale.
+locale = "en_US.UTF-8"
+
# Maximum time in seconds user can idle in the dgamelaunch menus
# before dgl exits. Default value is 0, which disables the idling timer.
# Does not apply to external programs or config editors.