i18n-tasks 0.2.7 → 0.2.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
  SHA1:
3
- metadata.gz: 35d4f7d34c81cc84e6123e4c63cb27bee56f7877
4
- data.tar.gz: a2faf5f22e2caba3fab9e08707e1dd3a98c14fc9
3
+ metadata.gz: 31d5d1e5e40da90b8bc3407929c85d75b3430393
4
+ data.tar.gz: 314256137e73147c52c7ad9148d66a56c0e1428c
5
5
  SHA512:
6
- metadata.gz: 82f76ca5ab2e84949f760dfe043a449e19d7761e9d29391ed5269e665d79caf0e61d3908ce23a1e9336b34998af0d22a3a03fb6a6612c7fcad5407f61d0a3be5
7
- data.tar.gz: d70a3d3db66c89d9d042039ebdf78322fb0cdf22bed4df99d56e7a0b6192cf7f6d82b2cb222cc76b4310b3d47b25ed03218aaac137d63562dff62059a4e05ff0
6
+ metadata.gz: 537569c4b406b6d0683af42b5a4e8053e83e665f0bb82db5c38c8f5de2f458c7e570fbd904c41981f2eba0579762e408bc1fde7c8035d100891860b12da3c0e1
7
+ data.tar.gz: 9de404b284a0b438472923d72180b10e9aa85f077e270cb69b6b5a8f5d3709448f39c44fda448f4d71a69280f1a72ad068130258ea7e83d5dee0a8bbd43e879f
data/CHANGES.md CHANGED
@@ -1,28 +1,29 @@
1
- ## v0.2.5..0.2.7
1
+ ## v0.2.5..0.2.8
2
2
 
3
- * config/i18n-tasks.yml now processed with ERB (@glebm)
4
- * can now be used with any ruby apps, not just Rails (@glebm)
5
- * more locale formats are considered valid (@glebm)
3
+ * config/i18n-tasks.yml now processed with ERB
4
+ * can now be used with any ruby apps, not just Rails
5
+ * more locale formats are considered valid
6
+ * i18n:missing accepts locales
6
7
 
7
8
  ## v0.2.4
8
9
 
9
- * more powerful key pattern matching with sets and backtracking (@glebm)
10
+ * more powerful key pattern matching with sets and backtracking
10
11
 
11
12
  ## v0.2.3
12
13
 
13
- * spreadsheet report, tests run on rbx (@glebm)
14
+ * spreadsheet report, tests run on rbx
14
15
 
15
16
  ## v0.2.2
16
17
 
17
- * improved output with terminal-table (@glebm)
18
+ * improved output with terminal-table
18
19
 
19
20
  ## v0.2.1
20
21
 
21
- * fill tasks renamed, fix symbol key search (@glebm)
22
+ * fill tasks renamed, fix symbol key search
22
23
 
23
24
  ## v0.2.0
24
25
 
25
- * 3 more prefill tasks, including Google Translate (@glebm)
26
+ * 3 more prefill tasks, including Google Translate
26
27
  * tasks renamed
27
28
 
28
29
  ## v0.1.8
@@ -31,16 +32,16 @@
31
32
 
32
33
  ## v0.1.7
33
34
 
34
- * ability to route prefill output via data.write config (@glebm)
35
- * multiple configuration variables renamed (still understands old syntax with deprecation warnings) (@glebm)
35
+ * ability to route prefill output via data.write config
36
+ * multiple configuration variables renamed (still understands old syntax with deprecation warnings)
36
37
 
37
38
  ## v0.1.6
38
39
 
39
- * New key pattern syntax for i18n-tasks.yml a la globbing (@glebm)
40
+ * New key pattern syntax for i18n-tasks.yml a la globbing
40
41
 
41
42
  ## v0.1.5
42
43
 
43
- * Removed get_locale_data, added data configuration options (@glebm)
44
+ * Removed get_locale_data, added data configuration options
44
45
 
45
46
  ## v0.1.4
46
47
 
@@ -49,10 +50,10 @@
49
50
 
50
51
  ## v0.1.3
51
52
 
52
- * detect countable keys as used for unused task (@glebm)
53
+ * detect countable keys as used for unused task
53
54
  * account for non-string keys coming from yaml (thanks @lichtamberg)
54
55
 
55
56
  ## v0.1.2
56
57
 
57
58
  * added grep config options (thanks @dmke)
58
- * improved terminal output (@glebm)
59
+ * improved terminal output
data/README.md CHANGED
@@ -73,7 +73,7 @@ For more examples see [the tests](/spec/i18n_tasks_spec.rb).
73
73
  Simply add to Gemfile:
74
74
 
75
75
  ```ruby
76
- gem 'i18n-tasks', '~> 0.2.7'
76
+ gem 'i18n-tasks', '~> 0.2.8'
77
77
  ```
78
78
 
79
79
  If you do not use Rails, you will also need to require the tasks in your Rakefile:
@@ -7,8 +7,8 @@ module I18n
7
7
  class Terminal < Base
8
8
  include Term::ANSIColor
9
9
 
10
- def missing_translations
11
- recs = task.untranslated_keys
10
+ def missing_translations(locales = nil)
11
+ recs = task.untranslated_keys(locales)
12
12
  print_title missing_title(recs)
13
13
  if recs.present?
14
14
 
@@ -5,9 +5,10 @@ module I18n::Tasks::UntranslatedKeys
5
5
  # :type — :blank, :missing, or :eq_base
6
6
  # :base_value — translation value in base locale if one is present
7
7
  # @return [Array<Hash{Symbol => String,Symbol,nil}>]
8
- def untranslated_keys
8
+ def untranslated_keys(locales = nil)
9
+ locales = self.non_base_locales if !locales || locales.empty?
9
10
  keys = keys_missing_from_base.map { |key| {locale: base_locale, key: key, type: :none} } +
10
- non_base_locales.map { |locale|
11
+ locales.map { |locale|
11
12
  keys_missing_value(locale).map { |key| {locale: locale, key: key, type: :blank, base_value: t(base_locale, key)}} + keys_where_value_eq_base(locale).map { |key|
12
13
  {locale: locale, key: key, type: :eq_base, base_value: t(base_locale, key)}
13
14
  }
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Tasks
3
- VERSION = '0.2.7'
3
+ VERSION = '0.2.8'
4
4
  end
5
5
  end
@@ -10,8 +10,8 @@ namespace :i18n do
10
10
  end
11
11
 
12
12
  desc 'show missing translations'
13
- task :missing => 'i18n:setup' do
14
- i18n_report.missing_translations
13
+ task :missing, [:locales] => 'i18n:setup' do |t, args|
14
+ i18n_report.missing_translations i18n_parse_locales args[:locales]
15
15
  end
16
16
 
17
17
  desc 'show unused translations'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebm