Browse Source

Добавлено определение часового пояса по языку

master
Mike Khiretskiy 7 years ago
parent
commit
22aa61414e
  1. 1
      boot.config
  2. 10
      common.inc
  3. 1
      install.config
  4. 31
      timezones.inc

1
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

10
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 {

1
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

31
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
Loading…
Cancel
Save