i18n-timezones 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ = I18nTimezones
2
+
3
+ I18n Timezones - The purpose of this gem is to simply provide timezone translations. The gem is intended to be easy to combine with other gems that require i18n timezone translations so we can have common i18n timezone translation gem.
4
+
5
+ If you're doing anything with timezones and translations, there's no need to reinvent the wheel and add your own translations. Just use this gem's timezone translations and skip the hassle of having to add and manage each timezone translation for each locale.
6
+
7
+ == Supported Locales
8
+ There are translations for all of the following locales: en, es
9
+
10
+ == Installation
11
+
12
+ Add to your Gemfile:
13
+
14
+ gem 'i18n-timezones'
15
+
16
+ == Usage
17
+
18
+ The timezones will automatically be translated into the current locale. Even the :default will get translated to the current locale.
19
+
20
+ time_zone_select :user, :time_zone, ActiveSupport::TimeZone.us_zones, :default => "Pacific Time (US & Canada)"
21
+
22
+ or just
23
+
24
+ time_zone_select :user, :time_zone
25
+
26
+
27
+ If you find an error in a translation, please let us know. Please help us fill in the rest of the timezones.
28
+
29
+ == Contributors
30
+ Brian McQuay - http://www.onomojo.com
31
+
32
+ == License
33
+ MIT or GPL
@@ -0,0 +1 @@
1
+ require 'i18n_timezones'
@@ -0,0 +1,2 @@
1
+ require 'i18n_timezones/timezone'
2
+ require 'i18n_timezones/railtie'
@@ -0,0 +1,25 @@
1
+ require 'rails'
2
+
3
+ module I18nTimezones
4
+ class Railtie < ::Rails::Railtie #:nodoc:
5
+ initializer 'i18n-timezones' do |app|
6
+ I18nTimezones::Railtie.instance_eval do
7
+ pattern = pattern_from app.config.i18n.available_locales
8
+
9
+ add("rails/locale/#{pattern}.yml")
10
+ end
11
+ end
12
+
13
+ protected
14
+
15
+ def self.add(pattern)
16
+ files = Dir[File.join(File.dirname(__FILE__), '../..', pattern)]
17
+ I18n.load_path.concat(files)
18
+ end
19
+
20
+ def self.pattern_from(args)
21
+ array = Array(args || [])
22
+ array.blank? ? '*' : "{#{array.join ','}}"
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module ActiveSupport
2
+ class TimeZone
3
+ def to_s
4
+ offset = "(GMT#{formatted_offset})"
5
+ translated_name = I18n.t(name, :scope => :timezones, :default => name)
6
+ %(#{offset} #{translated_name})
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module I18nTimezones
2
+ VERSION = "0.0.5"
3
+ end
@@ -0,0 +1,144 @@
1
+ es:
2
+ timezones:
3
+ "International Date Line West": "Línea de fecha internacional del oeste"
4
+ "Midway Island": "Isla de Midway"
5
+ "Samoa": "Samoa"
6
+ "Hawaii": "Hawai"
7
+ "Alaska": "Alaska"
8
+ "Pacific Time (US & Canada)": "Hora del Pacífico (EE.UU. y Canadá)"
9
+ "Tijuana": "Tijuana"
10
+ "Mountain Time (US & Canada)": "Hora de las Montañas (EE.UU. y Canadá)"
11
+ "Arizona": "Arizona"
12
+ "Chihuahua": "Chihuahua"
13
+ "Mazatlan": "Mazatlán"
14
+ "Central Time (US & Canada)": "Hora central (EE.UU. y Canadá)"
15
+ "Saskatchewan": "Saskatchewan"
16
+ "Guadalajara": "Guadalajara"
17
+ "Mexico City": "Ciudad de México"
18
+ "Monterrey": "Monterrey"
19
+ "Central America": "América Central"
20
+ "Eastern Time (US & Canada)": "Hora del Este (EE.UU. y Canadá)"
21
+ "Indiana (East)": "Indiana (Este)"
22
+ "Bogota": "Bogotá"
23
+ "Lima": "Lima"
24
+ "Quito": "Quito"
25
+ "Atlantic Time (Canada)": "Hora del Atlántico (Canadá)"
26
+ "Caracas": "Caracas"
27
+ "La Paz": "La Paz"
28
+ "Santiago": "Santiago"
29
+ "Newfoundland": "Terranova"
30
+ "Brasilia": "Brasilia"
31
+ "Buenos Aires": "Buenos Aires"
32
+ "Georgetown": "Georgetown"
33
+ "Greenland": "Groenlandia"
34
+ "Mid-Atlantic": "Atlántico medio"
35
+ "Azores": "Azores"
36
+ "Cape Verde Is.": "Isla Cabo Verde"
37
+ "Dublin": "Dublín"
38
+ "Edinburgh": "Edimburgo"
39
+ "Lisbon": "Lisboa"
40
+ "London": "Londres"
41
+ "Casablanca": "Casablanca"
42
+ "Monrovia": "Monrovia"
43
+ "UTC": "UTC"
44
+ "Belgrade": "Belgrado"
45
+ "Bratislava": "Bratislava"
46
+ "Budapest": "Budapest"
47
+ "Ljubljana": "Ljubljana"
48
+ "Prague": "Praga"
49
+ "Sarajevo": "Sarajevo"
50
+ "Skopje": "Skopje"
51
+ "Warsaw": "Varsovia"
52
+ "Zagreb": "Zagreb"
53
+ "Brussels": "Bruselas"
54
+ "Copenhagen": "Copenhague"
55
+ "Madrid": "Madrid"
56
+ "Paris": "París"
57
+ "Amsterdam": "Amsterdam"
58
+ "Berlin": "Berlín"
59
+ "Bern": "Berna"
60
+ "Rome": "Roma"
61
+ "Stockholm": "Estocolmo"
62
+ "Vienna": "Viena"
63
+ "West Central Africa": "Centro-Oeste de África"
64
+ "Bucharest": "Bucarest"
65
+ "Cairo": "El Cairo"
66
+ "Helsinki": "Helsinki"
67
+ "Kyev": "Kyev"
68
+ "Riga": "Riga"
69
+ "Sofia": "Sofía"
70
+ "Tallinn": "Tallin"
71
+ "Vilnius": "Vilnius"
72
+ "Athens": "Atenas"
73
+ "Istanbul": "Estambul"
74
+ "Minsk": "Minsk"
75
+ "Jerusalem": "Jerusalén"
76
+ "Harare": "Harare"
77
+ "Pretoria": "Pretoria"
78
+ "Moscow": "Moscú"
79
+ "St. Petersburg": "San Petersburgo"
80
+ "Volgograd": "Volgogrado"
81
+ "Kuwait": "Kuwait"
82
+ "Riyadh": "Riad"
83
+ "Nairobi": "Nairobi"
84
+ "Baghdad": "Bagdad"
85
+ "Tehran": "Teherán"
86
+ "Abu Dhabi": "Abu Dhabi"
87
+ "Muscat": "Moscatel"
88
+ "Baku": "Bakú"
89
+ "Tbilisi": "Tbilisi"
90
+ "Yerevan": "Ereván"
91
+ "Kabul": "Kabul"
92
+ "Ekaterinburg": "Ekaterinburg"
93
+ "Islamabad": "Islamabad"
94
+ "Karachi": "Karachi"
95
+ "Tashkent": "Tashkent"
96
+ "Chennai": "Chennai"
97
+ "Kolkata": "Kolkata"
98
+ "Mumbai": "Mumbai"
99
+ "New Delhi": "Nueva Delhi"
100
+ "Kathmandu": "Katmandú"
101
+ "Astana": "Astana"
102
+ "Dhaka": "Dhaka"
103
+ "Sri Jayawardenepura": "Sri Jayawardenepura"
104
+ "Almaty": "Almaty"
105
+ "Novosibirsk": "Novosibirsk"
106
+ "Rangoon": "Rangún"
107
+ "Bangkok": "Bangkok"
108
+ "Hanoi": "Hanoi"
109
+ "Jakarta": "Yakarta"
110
+ "Krasnoyarsk": "Krasnoyarsk"
111
+ "Beijing": "Beijing"
112
+ "Chongqing": "Chongqing"
113
+ "Hong Kong": "Hong Kong"
114
+ "Urumqi": "Urumqi"
115
+ "Kuala Lumpur": "Kuala Lumpur"
116
+ "Singapore": "Singapur"
117
+ "Taipei": "Taipei"
118
+ "Perth": "Perth"
119
+ "Irkutsk": "Irkutsk"
120
+ "Ulaan Bataar": "Ulán Bator"
121
+ "Seoul": "Seúl"
122
+ "Osaka": "Osaka"
123
+ "Sapporo": "Sapporo"
124
+ "Tokyo": "Tokio"
125
+ "Yakutsk": "Yakutsk"
126
+ "Darwin": "Darwin"
127
+ "Adelaide": "Adelaida"
128
+ "Canberra": "Canberra"
129
+ "Melbourne": "Melbourne"
130
+ "Sydney": "Sydney"
131
+ "Brisbane": "Brisbane"
132
+ "Hobart": "Hobart"
133
+ "Vladivostok": "Vladivostok"
134
+ "Guam": "Guam"
135
+ "Port Moresby": "Port Moresby"
136
+ "Magadan": "Magadan"
137
+ "Solomon Is.": "Islas Salomón"
138
+ "New Caledonia": "Nueva Caledonia"
139
+ "Fiji": "Fiji"
140
+ "Kamchatka": "Kamchatka"
141
+ "Marshall Is.": "Islas Marshall"
142
+ "Auckland": "Auckland"
143
+ "Wellington": "Wellington"
144
+ "Nuku'alofa": "Nuku'alofa"
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: i18n-timezones
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brian McQuay
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-03 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: i18n
16
+ requirement: &70151317618240 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '0.5'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70151317618240
25
+ - !ruby/object:Gem::Dependency
26
+ name: rails
27
+ requirement: &70151317617740 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70151317617740
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec-rails
38
+ requirement: &70151317617280 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 2.7.0
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70151317617280
47
+ - !ruby/object:Gem::Dependency
48
+ name: i18n-spec
49
+ requirement: &70151317616820 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.1
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70151317616820
58
+ - !ruby/object:Gem::Dependency
59
+ name: spork
60
+ requirement: &70151317616360 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: 1.0rc
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70151317616360
69
+ description: The purpose of this gem is to simply provide timezone translations. The
70
+ gem is intended to be easy to combine with other gems that require i18n timezone
71
+ translations so we can have common i18n timezone translation gem.
72
+ email:
73
+ - brian@onomojo.com
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - lib/i18n-timezones.rb
79
+ - lib/i18n_timezones/railtie.rb
80
+ - lib/i18n_timezones/timezone.rb
81
+ - lib/i18n_timezones/version.rb
82
+ - lib/i18n_timezones.rb
83
+ - rails/locale/es.yml
84
+ - README.rdoc
85
+ - MIT-LICENSE
86
+ homepage: https://github.com/onomojo/i18n-timezones
87
+ licenses: []
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ requirements: []
105
+ rubyforge_project:
106
+ rubygems_version: 1.8.10
107
+ signing_key:
108
+ specification_version: 3
109
+ summary: I18n Timezone Translations
110
+ test_files: []