Created
May 22, 2011 09:28
-
-
Save choonkeat/985302 to your computer and use it in GitHub Desktop.
Translating Rails Timezones (for http://stackoverflow.com/questions/1396623/translating-rails-timezones )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
# append to bottom | |
require 'i18n_time_zone' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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": "努库阿洛法" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment