From 22aa61414ea6a66a304edf181907060b97321792 Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Thu, 19 Mar 2015 13:42:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=87=D0=B0=D1=81=D0=BE=D0=B2=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BF=D0=BE=D1=8F=D1=81=D0=B0=20=D0=BF=D0=BE=20=D1=8F?= =?UTF-8?q?=D0=B7=D1=8B=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boot.config | 1 + common.inc | 10 ++++++++-- install.config | 1 + timezones.inc | 31 +++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 timezones.inc 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