locale_kit 1.0.1 → 1.1.0

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
  SHA256:
3
- metadata.gz: 40b6a82e6a2a0073cf9cedeb363abbb214ec3beea1b66bdf72e1961ebefdff46
4
- data.tar.gz: 730550c69d05b6dc9d4e3eb1df434303a2304a220f67adc1c98a0f59d5390e4d
3
+ metadata.gz: fc48ce76c06104b370b3a91836be834219120b0798af46421b8a5d23fba69305
4
+ data.tar.gz: 273591aea406bcc543534bf1b4c0a365b278178746ca219e222d1e66792e65b7
5
5
  SHA512:
6
- metadata.gz: d9ae5faf0ea0eaba4a1e86b275c011b9ca7a83f780c1ea15b7b3829e472045f2572c394d645130dd774e5c15d0cf1de74fca92f655b1cd87c0560222d0ea3df3
7
- data.tar.gz: 508ce58b87f6054b5f91d8e1b9666a5dd58ae3ac3a74919bba169c463cd3b11b200d3872718b1f8588905628293aa840d92c36f7f4da4441a74f0e7eed15a2a0
6
+ metadata.gz: '057665899331a13d67df5649675b85ff89caa492071cf1dcd8db0af639869e95b4a27044277026fc0ce6860d35aba1a934e11c184dc789cacd5bef8e2d71ea2f'
7
+ data.tar.gz: 61e066a5d2fd81466abf3c0ac2896d35375ad2a96c69e5567ec0124b68e47dd94575ec368b5b2c122e2bcb30c408a469f3c6dbfceb0911a73f15c6b6129b8d0e
@@ -16,6 +16,10 @@ class LocaleKit::Generators::ModelGenerator < LocaleKit::Generators::Base
16
16
 
17
17
  attr_accessor :current_locale
18
18
 
19
+ def i18n_scope
20
+ defined?(ApplicationRecord) ? ApplicationRecord.i18n_scope : model_type
21
+ end
22
+
19
23
  def model_type
20
24
  defined?(ActiveRecord) ? :activerecord : :activemodel
21
25
  end
@@ -1,10 +1,9 @@
1
1
  <%= current_locale %>:
2
- <%= model_type %>:
2
+ <%= i18n_scope %>:
3
3
  models:
4
4
  <%= model_name %>: "<%= file_name.classify %>"
5
5
  attributes:
6
6
  <%= model_name %>:
7
- id: "ID"
8
7
  <% attribute_names.each do |attr_name| -%>
9
8
  <%= attr_name %>: "<%= attr_name.classify %>"
10
9
  <% end -%>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LocaleKit
4
- VERSION = '1.0.1'.freeze
4
+ VERSION = '1.1.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locale_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-13 00:00:00.000000000 Z
11
+ date: 2020-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: sqlite3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 1.3.6
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.3.6
97
97
  description: Improve locales convention of Rails
98
98
  email:
99
99
  - sho-kusano@space-pirates.jp
@@ -147,8 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.7.6
150
+ rubygems_version: 3.1.2
152
151
  signing_key:
153
152
  specification_version: 4
154
153
  summary: Improve locales convention of Rails