parliament-grom-decorators 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e860f1e6fc16912229ea7d63e2d5ba81bfae8fc
4
- data.tar.gz: ff70e5e6e30483aac559146677930509e61353d7
3
+ metadata.gz: 1f8709189d173f05f7262e0c936f80fc95bed47b
4
+ data.tar.gz: 5f7b9ef6a119ebe626494e982d97929ceb069a03
5
5
  SHA512:
6
- metadata.gz: 2c7208e840ab9926e192bc34c75473d79f48389fb0dcaced447d4bda23b5d5d9e816583e9b767cd7ff349f4ef19865ffa3acd46d887790912d22c7242ab7e2ce
7
- data.tar.gz: 4b2aed63bf20e08f1fd18941251b659a9c68d4efba10e44fd782f48103d69ba6bdf8f818ec62fec628af631d2b6f1852eb907e0ff6d666849ed66ef34117cebd
6
+ metadata.gz: 23cb14e9a1d4ae565cce7a7f3930936fdb5d3f38f03eee594dec3ed14c39ea919d2bec91ac5124b8225c68f3671d7e412712ef1d7b33582f3656ae31101dde6e
7
+ data.tar.gz: bee983980f773fc552d6366e4626ff9cb337626226f89cb382a0eb83768c05ad4051a55215288b70f36bcaebb3b78a77eeee735e1c6e674053793fe496c4552b
@@ -0,0 +1,31 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ person:
24
+ current:
25
+ mp: 'Current MP'
26
+ member_of_the_house_of_lords: 'Member of the House of Lords'
27
+ member: 'Current Member'
28
+ former:
29
+ mp: 'Former MP'
30
+ member_of_the_house_of_lords: 'Former Member of the House of Lords'
31
+ member: 'Former Member'
@@ -22,6 +22,8 @@ module Parliament
22
22
  #
23
23
  # @since 0.1.0
24
24
  module Decorator
25
+ I18n.load_path += Dir[File.join((File.expand_path 'config'), 'locales', '*.yml')]
26
+
25
27
  # Decorates objects with alias methods extended from its decorator module.
26
28
  #
27
29
  # @param [Grom::Node] object the object to be decorated.
@@ -170,18 +170,18 @@ module Parliament
170
170
  # TODO: Convert hard-coded strings to language file values
171
171
  def build_house_membership_status(no_current_seat_incumbency, no_current_house_incumbency, former_lord, former_mp)
172
172
  statuses = []
173
- statuses << 'Current MP' unless no_current_seat_incumbency
174
- statuses << 'Member of the House of Lords' unless no_current_house_incumbency
175
- statuses << 'Former Member of the House of Lords' if former_lord
176
- statuses << 'Former MP' if former_mp
173
+ statuses << I18n.t('person.current.mp') unless no_current_seat_incumbency
174
+ statuses << I18n.t('person.current.member_of_the_house_of_lords') unless no_current_house_incumbency
175
+ statuses << I18n.t('person.former.member_of_the_house_of_lords') if former_lord
176
+ statuses << I18n.t('person.former.mp') if former_mp
177
177
 
178
178
  statuses
179
179
  end
180
180
 
181
181
  def general_membership_status
182
182
  statuses = []
183
- statuses << 'Current Member' unless incumbencies.select(&:current?).empty?
184
- statuses << 'Former Member' if !incumbencies.empty? && incumbencies.select(&:current?).empty?
183
+ statuses << I18n.t('person.current.member') unless incumbencies.select(&:current?).empty?
184
+ statuses << I18n.t('person.former.member') if !incumbencies.empty? && incumbencies.select(&:current?).empty?
185
185
  statuses
186
186
  end
187
187
  end
@@ -1,7 +1,7 @@
1
1
  module Parliament
2
2
  module Grom
3
3
  module Decorator
4
- VERSION = '0.1.2'.freeze
4
+ VERSION = '0.1.3'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -27,5 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'simplecov', '~> 0.12'
28
28
  spec.add_development_dependency 'vcr', '~> 3.0'
29
29
  spec.add_development_dependency 'webmock', '~> 2.3'
30
+ spec.add_development_dependency 'parliament-ruby'
30
31
  spec.add_development_dependency 'parliament-ntriple', '~> 0.1'
31
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliament-grom-decorators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-27 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: parliament-ruby
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: parliament-ntriple
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -141,6 +155,7 @@ files:
141
155
  - Rakefile
142
156
  - bin/console
143
157
  - bin/setup
158
+ - config/locales/en.yml
144
159
  - lib/parliament/grom/decorator.rb
145
160
  - lib/parliament/grom/decorator/constituency_area.rb
146
161
  - lib/parliament/grom/decorator/constituency_group.rb