diff --git a/boot.config b/boot.config index 8a3782e..b6ca244 100644 --- a/boot.config +++ b/boot.config @@ -22,6 +22,7 @@ %% include dia_access.inc %% include panel.inc %% include keytables.inc +%% include timezones.inc %% include langnames.inc %% include locale.inc %% include splash.inc diff --git a/common.inc b/common.inc index 42495a2..22e692a 100644 --- a/common.inc +++ b/common.inc @@ -359,13 +359,19 @@ config.lang { config.lang "en" ne { config.lang lang.getlocale - "calculate=lang:%s," + "calculate=lang:%s" bc.cmd dup length add sprintf } if } if config.lang "en" ne config.keymap .km.name get "us" ne or { - config.keymap .km.name get "keymap:%s," bc.cmd dup length add sprintf + config.keymap .km.name get ",keymap:%s" bc.cmd dup length add sprintf + } if + + config.lang { + config.lang lang.gettimezone + ",timezone:%s" + bc.cmd dup length add sprintf } if modes.selected.append .undef ne { diff --git a/install.config b/install.config index bab169c..f3a6000 100644 --- a/install.config +++ b/install.config @@ -21,6 +21,7 @@ %% include dia_fulloptions.inc %% include dia_access.inc %% include panel.inc +%% include timezones.inc %% include keytables.inc %% include langnames.inc %% include locale.inc diff --git a/timezones.inc b/timezones.inc new file mode 100644 index 0000000..4c33a44 --- /dev/null +++ b/timezones.inc @@ -0,0 +1,31 @@ + +/.tz.language 0 def +/.tz.name 1 def + +/timezones [ + [ "en" "Canada/Pacific" ] + [ "pt_BR" "America/Sao_Paulo" ] + [ "bg" "Europe/Sofia" ] + [ "de" "Europe/Amsterdam" ] + [ "fr" "Europe/Brussels" ] + [ "it" "Europe/Amsterdam" ] + [ "pl" "Europe/Belgrade" ] + [ "pt_PT" "Europe/Lisbon" ] + [ "ru" "Europe/Moscow" ] + [ "ro" "Europe/Istanbul" ] + [ "es" "Europe/Brussels" ] + [ "uk" "Europe/Kiev" ] +] def + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% Get timezone (timezone). +% +% Returns timezone for lang +% +% ( locale ) ==> ( EEEE/MMMM ) +% +/lang.gettimezone { + timezones { + dup .tz.language get 2 index eq { .tz.name get exch pop exit } { pop } ifelse + } forall +} def