effective_resources 2.8.7 → 2.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b20557b39c6a58e12d87157ccc21b3ce99ac38e2a57e1c3c45b0a07333d45e05
4
- data.tar.gz: 2bfc034398f369c999e26f8907c6790d127102d9416b5914e63066b16003d452
3
+ metadata.gz: a583a70685ae3faf4811c49e750ae55c05aec5af0ed3f061662c80723575a2c9
4
+ data.tar.gz: acb81962352988b990db0d8b95ba4430d02bfad1bf04946d5724753bf10454ad
5
5
  SHA512:
6
- metadata.gz: d2e218f0580ab6d3a5f7a2f7bfaf5d2d27967f1670628dbb8580d6e4d44717c80904ac4bbb33c15f1da079420e5a3518cfb0a1dc8ce00bd5c58d49396941bf43
7
- data.tar.gz: d2e2f6fd1cd3ca5a6de6b6c6e3ed306d10a1615b1b9abdc534d4510fa91612a79eb947ff08cc4746b57162ebc1e5d586adf4dc385a8f773b63878b6d59442235
6
+ metadata.gz: 60bb0ff5c80356b24770eb98d9787a9a975368edf7fa3be6c5cd700c7937e3fce7a6ad1a5d8cf8670184c0b5feeaf0dd98577989948b5292a7f3f4fe09c3ed97
7
+ data.tar.gz: 1aa740c85b5a07a900e9cc68f97f38dfe0c57b1ca1fbfecf43f34a2b9be2aba8571e84d989a99957c319d33b437da061e56744999d49213d4a9dddf3795f30f4
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2019 Code and Effect Inc.
1
+ Copyright 2024 Code and Effect Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -5,8 +5,10 @@ module Effective
5
5
  module I18n
6
6
  def human_action_name(action)
7
7
  if klass.respond_to?(:model_name)
8
- value = ::I18n.t("activerecord.actions.#{klass.model_name.i18n_key}.#{action}")
9
- return value unless value.start_with?('translation missing:')
8
+ key = "activerecord.actions.#{klass.model_name.i18n_key}.#{action}"
9
+
10
+ value = ::I18n.t(key)
11
+ return value unless value.include?(key) # missing translation
10
12
  end
11
13
 
12
14
  if crud_actions.include?(action)
@@ -19,8 +21,10 @@ module Effective
19
21
 
20
22
  def human_action_confirm(action)
21
23
  if klass.respond_to?(:model_name)
22
- value = ::I18n.t("activerecord.actions.#{klass.model_name.i18n_key}.#{action}_confirm")
23
- return value unless value.start_with?('translation missing:')
24
+ key = "activerecord.actions.#{klass.model_name.i18n_key}.#{action}_confirm"
25
+
26
+ value = ::I18n.t(key)
27
+ return value unless value.include?(key) # missing translation
24
28
  end
25
29
 
26
30
  "Really #{human_action_name(action)} @resource?"
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.8.7'.freeze
2
+ VERSION = '2.8.8'.freeze
3
3
  end
@@ -180,12 +180,13 @@ module EffectiveResources
180
180
  end
181
181
  end
182
182
 
183
+ # effective_translate
183
184
  def self.et(resource, attribute = nil)
184
185
  if resource.respond_to?(:datatable_name)
185
186
  resource.datatable_name
186
- elsif resource.respond_to?(:model_name) == false
187
+ elsif resource.respond_to?(:model_name) == false # Just a string. Fees will do this
187
188
  value = I18n.t(resource)
188
- raise("Missing translation: #{resource}") if value.start_with?('translation missing:')
189
+ raise StandardError.new("Missing translation: #{resource}") if value.include?(resource)
189
190
  value
190
191
  elsif attribute.blank?
191
192
  resource.model_name.human
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.7
4
+ version: 2.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2023-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails