From 47bddae4ea0d46f705909d4e9c87fdc76f6646d5 Mon Sep 17 00:00:00 2001 From: Craig Voisin Date: Fri, 17 Jul 2020 14:16:15 -0700 Subject: [PATCH] Include prepopulated standard time zones Loads standard_timezones.json from a metadata file in addition to including any time zones that are installed on the server. PiperOrigin-RevId: 321852363 Change-Id: Id85ee369a1d7cb0002d295d2d37f09ad70dd99f9 --- deploy/metadata/standard_timezones.json | 609 ++++++++++++++++++++++++ lib/timeutil/timeutil.go | 18 +- 2 files changed, 623 insertions(+), 4 deletions(-) create mode 100644 deploy/metadata/standard_timezones.json diff --git a/deploy/metadata/standard_timezones.json b/deploy/metadata/standard_timezones.json new file mode 100644 index 00000000..f402abdf --- /dev/null +++ b/deploy/metadata/standard_timezones.json @@ -0,0 +1,609 @@ +{ + "Africa/Abidjan":"Africa", + "Africa/Accra":"Africa", + "Africa/Addis_Ababa":"Africa", + "Africa/Algiers":"Africa", + "Africa/Asmara":"Africa", + "Africa/Asmera":"Africa", + "Africa/Bamako":"Africa", + "Africa/Bangui":"Africa", + "Africa/Banjul":"Africa", + "Africa/Bissau":"Africa", + "Africa/Blantyre":"Africa", + "Africa/Brazzaville":"Africa", + "Africa/Bujumbura":"Africa", + "Africa/Cairo":"Africa", + "Africa/Casablanca":"Africa", + "Africa/Ceuta":"Africa", + "Africa/Conakry":"Africa", + "Africa/Dakar":"Africa", + "Africa/Dar_es_Salaam":"Africa", + "Africa/Djibouti":"Africa", + "Africa/Douala":"Africa", + "Africa/El_Aaiun":"Africa", + "Africa/Freetown":"Africa", + "Africa/Gaborone":"Africa", + "Africa/Harare":"Africa", + "Africa/Johannesburg":"Africa", + "Africa/Juba":"Africa", + "Africa/Kampala":"Africa", + "Africa/Khartoum":"Africa", + "Africa/Kigali":"Africa", + "Africa/Kinshasa":"Africa", + "Africa/Lagos":"Africa", + "Africa/Libreville":"Africa", + "Africa/Lome":"Africa", + "Africa/Luanda":"Africa", + "Africa/Lubumbashi":"Africa", + "Africa/Lusaka":"Africa", + "Africa/Malabo":"Africa", + "Africa/Maputo":"Africa", + "Africa/Maseru":"Africa", + "Africa/Mbabane":"Africa", + "Africa/Mogadishu":"Africa", + "Africa/Monrovia":"Africa", + "Africa/Nairobi":"Africa", + "Africa/Ndjamena":"Africa", + "Africa/Niamey":"Africa", + "Africa/Nouakchott":"Africa", + "Africa/Ouagadougou":"Africa", + "Africa/Porto-Novo":"Africa", + "Africa/Sao_Tome":"Africa", + "Africa/Timbuktu":"Africa", + "Africa/Tripoli":"Africa", + "Africa/Tunis":"Africa", + "Africa/Windhoek":"Africa", + "America/Adak":"America", + "America/Anchorage":"America", + "America/Anguilla":"America", + "America/Antigua":"America", + "America/Araguaina":"America", + "America/Argentina/Buenos_Aires":"America/Argentina", + "America/Argentina/Catamarca":"America/Argentina", + "America/Argentina/ComodRivadavia":"America/Argentina", + "America/Argentina/Cordoba":"America/Argentina", + "America/Argentina/Jujuy":"America/Argentina", + "America/Argentina/La_Rioja":"America/Argentina", + "America/Argentina/Mendoza":"America/Argentina", + "America/Argentina/Rio_Gallegos":"America/Argentina", + "America/Argentina/Salta":"America/Argentina", + "America/Argentina/San_Juan":"America/Argentina", + "America/Argentina/San_Luis":"America/Argentina", + "America/Argentina/Tucuman":"America/Argentina", + "America/Argentina/Ushuaia":"America/Argentina", + "America/Aruba":"America", + "America/Asuncion":"America", + "America/Atikokan":"America", + "America/Atka":"America", + "America/Bahia":"America", + "America/Bahia_Banderas":"America", + "America/Barbados":"America", + "America/Belem":"America", + "America/Belize":"America", + "America/Blanc-Sablon":"America", + "America/Boa_Vista":"America", + "America/Bogota":"America", + "America/Boise":"America", + "America/Buenos_Aires":"America", + "America/Cambridge_Bay":"America", + "America/Campo_Grande":"America", + "America/Cancun":"America", + "America/Caracas":"America", + "America/Catamarca":"America", + "America/Cayenne":"America", + "America/Cayman":"America", + "America/Chicago":"America", + "America/Chihuahua":"America", + "America/Coral_Harbour":"America", + "America/Cordoba":"America", + "America/Costa_Rica":"America", + "America/Creston":"America", + "America/Cuiaba":"America", + "America/Curacao":"America", + "America/Danmarkshavn":"America", + "America/Dawson":"America", + "America/Dawson_Creek":"America", + "America/Denver":"America", + "America/Detroit":"America", + "America/Dominica":"America", + "America/Edmonton":"America", + "America/Eirunepe":"America", + "America/El_Salvador":"America", + "America/Ensenada":"America", + "America/Fort_Nelson":"America", + "America/Fort_Wayne":"America", + "America/Fortaleza":"America", + "America/Glace_Bay":"America", + "America/Godthab":"America", + "America/Goose_Bay":"America", + "America/Grand_Turk":"America", + "America/Grenada":"America", + "America/Guadeloupe":"America", + "America/Guatemala":"America", + "America/Guayaquil":"America", + "America/Guyana":"America", + "America/Halifax":"America", + "America/Havana":"America", + "America/Hermosillo":"America", + "America/Indiana/Indianapolis":"America/Indiana", + "America/Indiana/Knox":"America/Indiana", + "America/Indiana/Marengo":"America/Indiana", + "America/Indiana/Petersburg":"America/Indiana", + "America/Indiana/Tell_City":"America/Indiana", + "America/Indiana/Vevay":"America/Indiana", + "America/Indiana/Vincennes":"America/Indiana", + "America/Indiana/Winamac":"America/Indiana", + "America/Indianapolis":"America", + "America/Inuvik":"America", + "America/Iqaluit":"America", + "America/Jamaica":"America", + "America/Jujuy":"America", + "America/Juneau":"America", + "America/Kentucky/Louisville":"America/Kentucky", + "America/Kentucky/Monticello":"America/Kentucky", + "America/Knox_IN":"America", + "America/Kralendijk":"America", + "America/La_Paz":"America", + "America/Lima":"America", + "America/Los_Angeles":"America", + "America/Louisville":"America", + "America/Lower_Princes":"America", + "America/Maceio":"America", + "America/Managua":"America", + "America/Manaus":"America", + "America/Marigot":"America", + "America/Martinique":"America", + "America/Matamoros":"America", + "America/Mazatlan":"America", + "America/Mendoza":"America", + "America/Menominee":"America", + "America/Merida":"America", + "America/Metlakatla":"America", + "America/Mexico_City":"America", + "America/Miquelon":"America", + "America/Moncton":"America", + "America/Monterrey":"America", + "America/Montevideo":"America", + "America/Montreal":"America", + "America/Montserrat":"America", + "America/Nassau":"America", + "America/New_York":"America", + "America/Nipigon":"America", + "America/Nome":"America", + "America/Noronha":"America", + "America/North_Dakota/Beulah":"America/North_Dakota", + "America/North_Dakota/Center":"America/North_Dakota", + "America/North_Dakota/New_Salem":"America/North_Dakota", + "America/Ojinaga":"America", + "America/Panama":"America", + "America/Pangnirtung":"America", + "America/Paramaribo":"America", + "America/Phoenix":"America", + "America/Port-au-Prince":"America", + "America/Port_of_Spain":"America", + "America/Porto_Acre":"America", + "America/Porto_Velho":"America", + "America/Puerto_Rico":"America", + "America/Punta_Arenas":"America", + "America/Rainy_River":"America", + "America/Rankin_Inlet":"America", + "America/Recife":"America", + "America/Regina":"America", + "America/Resolute":"America", + "America/Rio_Branco":"America", + "America/Rosario":"America", + "America/Santa_Isabel":"America", + "America/Santarem":"America", + "America/Santiago":"America", + "America/Santo_Domingo":"America", + "America/Sao_Paulo":"America", + "America/Scoresbysund":"America", + "America/Shiprock":"America", + "America/Sitka":"America", + "America/St_Barthelemy":"America", + "America/St_Johns":"America", + "America/St_Kitts":"America", + "America/St_Lucia":"America", + "America/St_Thomas":"America", + "America/St_Vincent":"America", + "America/Swift_Current":"America", + "America/Tegucigalpa":"America", + "America/Thule":"America", + "America/Thunder_Bay":"America", + "America/Tijuana":"America", + "America/Toronto":"America", + "America/Tortola":"America", + "America/Vancouver":"America", + "America/Virgin":"America", + "America/Whitehorse":"America", + "America/Winnipeg":"America", + "America/Yakutat":"America", + "America/Yellowknife":"America", + "Antarctica/Casey":"Antarctica", + "Antarctica/Davis":"Antarctica", + "Antarctica/DumontDUrville":"Antarctica", + "Antarctica/Macquarie":"Antarctica", + "Antarctica/Mawson":"Antarctica", + "Antarctica/McMurdo":"Antarctica", + "Antarctica/Palmer":"Antarctica", + "Antarctica/Rothera":"Antarctica", + "Antarctica/South_Pole":"Antarctica", + "Antarctica/Syowa":"Antarctica", + "Antarctica/Troll":"Antarctica", + "Antarctica/Vostok":"Antarctica", + "Arctic/Longyearbyen":"Arctic", + "Asia/Aden":"Asia", + "Asia/Almaty":"Asia", + "Asia/Amman":"Asia", + "Asia/Anadyr":"Asia", + "Asia/Aqtau":"Asia", + "Asia/Aqtobe":"Asia", + "Asia/Ashgabat":"Asia", + "Asia/Ashkhabad":"Asia", + "Asia/Atyrau":"Asia", + "Asia/Baghdad":"Asia", + "Asia/Bahrain":"Asia", + "Asia/Baku":"Asia", + "Asia/Bangkok":"Asia", + "Asia/Barnaul":"Asia", + "Asia/Beirut":"Asia", + "Asia/Bishkek":"Asia", + "Asia/Brunei":"Asia", + "Asia/Calcutta":"Asia", + "Asia/Chita":"Asia", + "Asia/Choibalsan":"Asia", + "Asia/Chongqing":"Asia", + "Asia/Chungking":"Asia", + "Asia/Colombo":"Asia", + "Asia/Dacca":"Asia", + "Asia/Damascus":"Asia", + "Asia/Dhaka":"Asia", + "Asia/Dili":"Asia", + "Asia/Dubai":"Asia", + "Asia/Dushanbe":"Asia", + "Asia/Famagusta":"Asia", + "Asia/Gaza":"Asia", + "Asia/Harbin":"Asia", + "Asia/Hebron":"Asia", + "Asia/Ho_Chi_Minh":"Asia", + "Asia/Hong_Kong":"Asia", + "Asia/Hovd":"Asia", + "Asia/Irkutsk":"Asia", + "Asia/Istanbul":"Asia", + "Asia/Jakarta":"Asia", + "Asia/Jayapura":"Asia", + "Asia/Jerusalem":"Asia", + "Asia/Kabul":"Asia", + "Asia/Kamchatka":"Asia", + "Asia/Karachi":"Asia", + "Asia/Kashgar":"Asia", + "Asia/Kathmandu":"Asia", + "Asia/Katmandu":"Asia", + "Asia/Khandyga":"Asia", + "Asia/Kolkata":"Asia", + "Asia/Krasnoyarsk":"Asia", + "Asia/Kuala_Lumpur":"Asia", + "Asia/Kuching":"Asia", + "Asia/Kuwait":"Asia", + "Asia/Macao":"Asia", + "Asia/Macau":"Asia", + "Asia/Magadan":"Asia", + "Asia/Makassar":"Asia", + "Asia/Manila":"Asia", + "Asia/Muscat":"Asia", + "Asia/Nicosia":"Asia", + "Asia/Novokuznetsk":"Asia", + "Asia/Novosibirsk":"Asia", + "Asia/Omsk":"Asia", + "Asia/Oral":"Asia", + "Asia/Phnom_Penh":"Asia", + "Asia/Pontianak":"Asia", + "Asia/Pyongyang":"Asia", + "Asia/Qatar":"Asia", + "Asia/Qostanay":"Asia", + "Asia/Qyzylorda":"Asia", + "Asia/Rangoon":"Asia", + "Asia/Riyadh":"Asia", + "Asia/Saigon":"Asia", + "Asia/Sakhalin":"Asia", + "Asia/Samarkand":"Asia", + "Asia/Seoul":"Asia", + "Asia/Shanghai":"Asia", + "Asia/Singapore":"Asia", + "Asia/Srednekolymsk":"Asia", + "Asia/Taipei":"Asia", + "Asia/Tashkent":"Asia", + "Asia/Tbilisi":"Asia", + "Asia/Tehran":"Asia", + "Asia/Tel_Aviv":"Asia", + "Asia/Thimbu":"Asia", + "Asia/Thimphu":"Asia", + "Asia/Tokyo":"Asia", + "Asia/Tomsk":"Asia", + "Asia/Ujung_Pandang":"Asia", + "Asia/Ulaanbaatar":"Asia", + "Asia/Ulan_Bator":"Asia", + "Asia/Urumqi":"Asia", + "Asia/Ust-Nera":"Asia", + "Asia/Vientiane":"Asia", + "Asia/Vladivostok":"Asia", + "Asia/Yakutsk":"Asia", + "Asia/Yangon":"Asia", + "Asia/Yekaterinburg":"Asia", + "Asia/Yerevan":"Asia", + "Atlantic/Azores":"Atlantic", + "Atlantic/Bermuda":"Atlantic", + "Atlantic/Canary":"Atlantic", + "Atlantic/Cape_Verde":"Atlantic", + "Atlantic/Faeroe":"Atlantic", + "Atlantic/Faroe":"Atlantic", + "Atlantic/Jan_Mayen":"Atlantic", + "Atlantic/Madeira":"Atlantic", + "Atlantic/Reykjavik":"Atlantic", + "Atlantic/South_Georgia":"Atlantic", + "Atlantic/St_Helena":"Atlantic", + "Atlantic/Stanley":"Atlantic", + "Australia/ACT":"Australia", + "Australia/Adelaide":"Australia", + "Australia/Brisbane":"Australia", + "Australia/Broken_Hill":"Australia", + "Australia/Canberra":"Australia", + "Australia/Currie":"Australia", + "Australia/Darwin":"Australia", + "Australia/Eucla":"Australia", + "Australia/Hobart":"Australia", + "Australia/LHI":"Australia", + "Australia/Lindeman":"Australia", + "Australia/Lord_Howe":"Australia", + "Australia/Melbourne":"Australia", + "Australia/NSW":"Australia", + "Australia/North":"Australia", + "Australia/Perth":"Australia", + "Australia/Queensland":"Australia", + "Australia/South":"Australia", + "Australia/Sydney":"Australia", + "Australia/Tasmania":"Australia", + "Australia/Victoria":"Australia", + "Australia/West":"Australia", + "Australia/Yancowinna":"Australia", + "Brazil/Acre":"Brazil", + "Brazil/DeNoronha":"Brazil", + "Brazil/East":"Brazil", + "Brazil/West":"Brazil", + "CET":"", + "CST6CDT":"", + "Canada/Atlantic":"Canada", + "Canada/Central":"Canada", + "Canada/Eastern":"Canada", + "Canada/Mountain":"Canada", + "Canada/Newfoundland":"Canada", + "Canada/Pacific":"Canada", + "Canada/Saskatchewan":"Canada", + "Canada/Yukon":"Canada", + "Chile/Continental":"Chile", + "Chile/EasterIsland":"Chile", + "Cuba":"", + "EET":"", + "EST":"", + "EST5EDT":"", + "Egypt":"", + "Eire":"", + "Etc/GMT":"Etc", + "Etc/GMT+0":"Etc", + "Etc/GMT+1":"Etc", + "Etc/GMT+10":"Etc", + "Etc/GMT+11":"Etc", + "Etc/GMT+12":"Etc", + "Etc/GMT+2":"Etc", + "Etc/GMT+3":"Etc", + "Etc/GMT+4":"Etc", + "Etc/GMT+5":"Etc", + "Etc/GMT+6":"Etc", + "Etc/GMT+7":"Etc", + "Etc/GMT+8":"Etc", + "Etc/GMT+9":"Etc", + "Etc/GMT-0":"Etc", + "Etc/GMT-1":"Etc", + "Etc/GMT-10":"Etc", + "Etc/GMT-11":"Etc", + "Etc/GMT-12":"Etc", + "Etc/GMT-13":"Etc", + "Etc/GMT-14":"Etc", + "Etc/GMT-2":"Etc", + "Etc/GMT-3":"Etc", + "Etc/GMT-4":"Etc", + "Etc/GMT-5":"Etc", + "Etc/GMT-6":"Etc", + "Etc/GMT-7":"Etc", + "Etc/GMT-8":"Etc", + "Etc/GMT-9":"Etc", + "Etc/GMT0":"Etc", + "Etc/Greenwich":"Etc", + "Etc/UCT":"Etc", + "Etc/UTC":"Etc", + "Etc/Universal":"Etc", + "Etc/Zulu":"Etc", + "Europe/Amsterdam":"Europe", + "Europe/Andorra":"Europe", + "Europe/Astrakhan":"Europe", + "Europe/Athens":"Europe", + "Europe/Belfast":"Europe", + "Europe/Belgrade":"Europe", + "Europe/Berlin":"Europe", + "Europe/Bratislava":"Europe", + "Europe/Brussels":"Europe", + "Europe/Bucharest":"Europe", + "Europe/Budapest":"Europe", + "Europe/Busingen":"Europe", + "Europe/Chisinau":"Europe", + "Europe/Copenhagen":"Europe", + "Europe/Dublin":"Europe", + "Europe/Gibraltar":"Europe", + "Europe/Guernsey":"Europe", + "Europe/Helsinki":"Europe", + "Europe/Isle_of_Man":"Europe", + "Europe/Istanbul":"Europe", + "Europe/Jersey":"Europe", + "Europe/Kaliningrad":"Europe", + "Europe/Kiev":"Europe", + "Europe/Kirov":"Europe", + "Europe/Lisbon":"Europe", + "Europe/Ljubljana":"Europe", + "Europe/London":"Europe", + "Europe/Luxembourg":"Europe", + "Europe/Madrid":"Europe", + "Europe/Malta":"Europe", + "Europe/Mariehamn":"Europe", + "Europe/Minsk":"Europe", + "Europe/Monaco":"Europe", + "Europe/Moscow":"Europe", + "Europe/Nicosia":"Europe", + "Europe/Oslo":"Europe", + "Europe/Paris":"Europe", + "Europe/Podgorica":"Europe", + "Europe/Prague":"Europe", + "Europe/Riga":"Europe", + "Europe/Rome":"Europe", + "Europe/Samara":"Europe", + "Europe/San_Marino":"Europe", + "Europe/Sarajevo":"Europe", + "Europe/Saratov":"Europe", + "Europe/Simferopol":"Europe", + "Europe/Skopje":"Europe", + "Europe/Sofia":"Europe", + "Europe/Stockholm":"Europe", + "Europe/Tallinn":"Europe", + "Europe/Tirane":"Europe", + "Europe/Tiraspol":"Europe", + "Europe/Ulyanovsk":"Europe", + "Europe/Uzhgorod":"Europe", + "Europe/Vaduz":"Europe", + "Europe/Vatican":"Europe", + "Europe/Vienna":"Europe", + "Europe/Vilnius":"Europe", + "Europe/Volgograd":"Europe", + "Europe/Warsaw":"Europe", + "Europe/Zagreb":"Europe", + "Europe/Zaporozhye":"Europe", + "Europe/Zurich":"Europe", + "Factory":"", + "GB":"", + "GB-Eire":"", + "GMT":"", + "GMT+0":"", + "GMT-0":"", + "GMT0":"", + "Greenwich":"", + "HST":"", + "Hongkong":"", + "Iceland":"", + "Indian/Antananarivo":"Indian", + "Indian/Chagos":"Indian", + "Indian/Christmas":"Indian", + "Indian/Cocos":"Indian", + "Indian/Comoro":"Indian", + "Indian/Kerguelen":"Indian", + "Indian/Mahe":"Indian", + "Indian/Maldives":"Indian", + "Indian/Mauritius":"Indian", + "Indian/Mayotte":"Indian", + "Indian/Reunion":"Indian", + "Iran":"", + "Israel":"", + "Jamaica":"", + "Japan":"", + "Kwajalein":"", + "Libya":"", + "MET":"", + "MST":"", + "MST7MDT":"", + "Mexico/BajaNorte":"Mexico", + "Mexico/BajaSur":"Mexico", + "Mexico/General":"Mexico", + "NZ":"", + "NZ-CHAT":"", + "Navajo":"", + "PRC":"", + "PST8PDT":"", + "Pacific/Apia":"Pacific", + "Pacific/Auckland":"Pacific", + "Pacific/Bougainville":"Pacific", + "Pacific/Chatham":"Pacific", + "Pacific/Chuuk":"Pacific", + "Pacific/Easter":"Pacific", + "Pacific/Efate":"Pacific", + "Pacific/Enderbury":"Pacific", + "Pacific/Fakaofo":"Pacific", + "Pacific/Fiji":"Pacific", + "Pacific/Funafuti":"Pacific", + "Pacific/Galapagos":"Pacific", + "Pacific/Gambier":"Pacific", + "Pacific/Guadalcanal":"Pacific", + "Pacific/Guam":"Pacific", + "Pacific/Honolulu":"Pacific", + "Pacific/Johnston":"Pacific", + "Pacific/Kiritimati":"Pacific", + "Pacific/Kosrae":"Pacific", + "Pacific/Kwajalein":"Pacific", + "Pacific/Majuro":"Pacific", + "Pacific/Marquesas":"Pacific", + "Pacific/Midway":"Pacific", + "Pacific/Nauru":"Pacific", + "Pacific/Niue":"Pacific", + "Pacific/Norfolk":"Pacific", + "Pacific/Noumea":"Pacific", + "Pacific/Pago_Pago":"Pacific", + "Pacific/Palau":"Pacific", + "Pacific/Pitcairn":"Pacific", + "Pacific/Pohnpei":"Pacific", + "Pacific/Ponape":"Pacific", + "Pacific/Port_Moresby":"Pacific", + "Pacific/Rarotonga":"Pacific", + "Pacific/Saipan":"Pacific", + "Pacific/Samoa":"Pacific", + "Pacific/Tahiti":"Pacific", + "Pacific/Tarawa":"Pacific", + "Pacific/Tongatapu":"Pacific", + "Pacific/Truk":"Pacific", + "Pacific/Wake":"Pacific", + "Pacific/Wallis":"Pacific", + "Pacific/Yap":"Pacific", + "Poland":"", + "Portugal":"", + "ROC":"", + "ROK":"", + "Singapore":"", + "SystemV/AST4":"SystemV", + "SystemV/AST4ADT":"SystemV", + "SystemV/CST6":"SystemV", + "SystemV/CST6CDT":"SystemV", + "SystemV/EST5":"SystemV", + "SystemV/EST5EDT":"SystemV", + "SystemV/HST10":"SystemV", + "SystemV/MST7":"SystemV", + "SystemV/MST7MDT":"SystemV", + "SystemV/PST8":"SystemV", + "SystemV/PST8PDT":"SystemV", + "SystemV/YST9":"SystemV", + "SystemV/YST9YDT":"SystemV", + "Turkey":"", + "UCT":"", + "US/Alaska":"US", + "US/Aleutian":"US", + "US/Arizona":"US", + "US/Central":"US", + "US/East-Indiana":"US", + "US/Eastern":"US", + "US/Hawaii":"US", + "US/Indiana-Starke":"US", + "US/Michigan":"US", + "US/Mountain":"US", + "US/Pacific":"US", + "US/Pacific-New":"US", + "US/Samoa":"US", + "UTC":"", + "Universal":"", + "W-SU":"", + "WET":"", + "Zulu":"" +} diff --git a/lib/timeutil/timeutil.go b/lib/timeutil/timeutil.go index 1e47d3ee..b1847921 100644 --- a/lib/timeutil/timeutil.go +++ b/lib/timeutil/timeutil.go @@ -164,8 +164,18 @@ func generateTimeZones() map[string]string { genZones(dir, "", out) } - if len(out) == 0 { - glog.Warningf("failed to load time zones: check that the OS is unix-based") + data, err := srcutil.LoadFile("deploy/metadata/standard_timezones.json") + if err != nil { + glog.Errorf("failed to load time zones: %v", err) + return out + } + loaded := make(map[string]string) + if err := json.Unmarshal([]byte(data), &loaded); err != nil { + glog.Errorf("failed to unmarshal time zone data: %v", err) + return out + } + for k, v := range loaded { + out[k] = v } return out @@ -215,11 +225,11 @@ func generateLocales() map[string]string { out := make(map[string]string) data, err := srcutil.LoadFile("deploy/metadata/standard_locales.json") if err != nil { - glog.Errorf("failed to load time zones (check that the OS is unix-based): %v", err) + glog.Errorf("failed to load locales: %v", err) return out } if err := json.Unmarshal([]byte(data), &out); err != nil { - glog.Errorf("failed to unmarshal time zone data: %v", err) + glog.Errorf("failed to unmarshal locale data: %v", err) return out } return out