public
Last active

  • Download Gist
application.rb
Ruby
1 2 3 4
# config/application.rb
 
# append to bottom
require 'i18n_time_zone'
i18n_time_zone.rb
Ruby
1 2 3 4 5 6 7
# lib/i18n_time_zone.rb
class I18nTimeZone < ActiveSupport::TimeZone
def to_s
translated_name = I18n.t(name, :scope => :timezones, :default => name)
"(GMT#{formatted_offset}) #{translated_name}"
end
end
zh-CN.yml
YAML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
# config/locales/zh-CN.yml
"zh-CN":
timezones:
"International Date Line West": "国际日期变更线以西"
"Midway Island": "中途岛"
"Samoa": "萨摩亚"
"Hawaii": "夏威夷"
"Alaska": "阿拉斯加州"
"Pacific Time (US & Canada)": "太平洋时间(美国和加拿大)"
"Tijuana": "蒂华纳"
"Arizona": "亚利桑那"
"Chihuahua": "奇瓦瓦"
"Mazatlan": "马萨特兰"
"Mountain Time (US & Canada)": "山地时间(美国和加拿大)"
"Central America": "中美洲"
"Central Time (US & Canada)": "中部时间(美国和加拿大)"
"Guadalajara": "瓜达拉哈拉"
"Mexico City": "墨西哥城"
"Monterrey": "蒙特雷"
"Saskatchewan": "萨斯喀彻温省"
"Bogota": "波哥大"
"Eastern Time (US & Canada)": "东部时间(美国和加拿大)"
"Indiana (East)": "印第安那州(东部)"
"Lima": "利马"
"Quito": "基多"
"Caracas": "加拉加斯"
"Atlantic Time (Canada)": "大西洋时间(加拿大)"
"Georgetown": "乔治敦"
"La Paz": "拉巴斯"
"Santiago": "圣地亚哥"
"Newfoundland": "纽芬兰"
"Brasilia": "巴西利亚"
"Buenos Aires": "布宜诺斯艾利斯"
"Greenland": "格陵兰"
"Mid-Atlantic": "中大西洋"
"Azores": "亚速尔群岛"
"Cape Verde Is.": "佛得角的。"
"Casablanca": "卡萨布兰卡"
"Dublin": "都柏林"
"Edinburgh": "爱丁堡"
"Lisbon": "里斯本"
"London": "伦敦"
"Monrovia": "蒙罗维亚"
"UTC": "联合技术"
"Amsterdam": "阿姆斯特丹"
"Belgrade": "贝尔格莱德"
"Berlin": "柏林"
"Bern": "伯尔尼"
"Bratislava": "布拉迪斯拉发"
"Brussels": "布鲁塞尔"
"Budapest": "布达佩斯"
"Copenhagen": "哥本哈根"
"Ljubljana": "卢布尔雅那"
"Madrid": "马德里"
"Paris": "巴黎"
"Prague": "布拉格"
"Rome": "罗马"
"Sarajevo": "萨拉热窝"
"Skopje": "斯科普里"
"Stockholm": "斯德哥尔摩"
"Vienna": "维也纳"
"Warsaw": "华沙"
"West Central Africa": "西中非"
"Zagreb": "萨格勒布"
"Athens": "雅典"
"Bucharest": "布加勒斯特"
"Cairo": "开罗"
"Harare": "哈拉雷"
"Helsinki": "赫尔辛基"
"Istanbul": "伊斯坦布尔"
"Jerusalem": "耶路撒冷"
"Kyiv": "基辅"
"Minsk": "明斯克"
"Pretoria": "比勒陀利亚"
"Riga": "里加"
"Sofia": "索非亚"
"Tallinn": "塔林"
"Vilnius": "维尔纽斯"
"Baghdad": "巴格达"
"Kuwait": "科威特"
"Moscow": "莫斯科"
"Nairobi": "内罗毕"
"Riyadh": "利雅得"
"St. Petersburg": "圣圣彼得堡"
"Volgograd": "伏尔加格勒"
"Tehran": "德黑兰"
"Abu Dhabi": "阿布扎比"
"Baku": "巴库"
"Muscat": "马斯喀特"
"Tbilisi": "第比利斯"
"Yerevan": "埃里温"
"Kabul": "喀布尔"
"Ekaterinburg": "叶卡捷琳堡"
"Islamabad": "伊斯兰堡"
"Karachi": "卡拉奇"
"Tashkent": "塔什干"
"Chennai": "奈"
"Kolkata": "加尔各答"
"Mumbai": "孟买"
"New Delhi": "新德里"
"Sri Jayawardenepura": "斯里兰卡Jayawardenepura"
"Kathmandu": "加德满都"
"Almaty": "阿拉木图"
"Astana": "阿斯塔纳"
"Dhaka": "达卡"
"Novosibirsk": "新西伯利亚"
"Rangoon": "仰光"
"Bangkok": "曼谷"
"Hanoi": "河内"
"Jakarta": "雅加达"
"Krasnoyarsk": "克拉斯诺亚尔斯克"
"Beijing": "北京"
"Chongqing": "重庆"
"Hong Kong": "香港"
"Irkutsk": "伊尔库茨克"
"Kuala Lumpur": "吉隆坡"
"Perth": "珀斯"
"Singapore": "新加坡"
"Taipei": "台北"
"Ulaan Bataar": "乌兰急红了眼"
"Urumqi": "乌鲁木齐"
"Osaka": "大阪"
"Sapporo": "札幌"
"Seoul": "汉城"
"Tokyo": "东京"
"Yakutsk": "雅库茨克"
"Adelaide": "阿德莱德"
"Darwin": "达尔文"
"Brisbane": "布里斯班"
"Canberra": "堪培拉"
"Guam": "关岛"
"Hobart": "霍巴特"
"Melbourne": "墨尔本"
"Port Moresby": "莫尔兹比港"
"Sydney": "悉尼"
"Vladivostok": "海参崴"
"Kamchatka": "堪察加"
"Magadan": "马加丹"
"New Caledonia": "新喀里多尼亚"
"Solomon Is.": "所罗门群岛。"
"Auckland": "奥克兰"
"Fiji": "斐济"
"Marshall Is.": "马绍尔群岛。"
"Wellington": "惠灵顿"
"Nuku'alofa": "努库阿洛法"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.