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 +4 -4
- data/CHANGES.md +16 -15
- data/README.md +1 -1
- data/lib/i18n/tasks/reports/terminal.rb +2 -2
- data/lib/i18n/tasks/untranslated_keys.rb +3 -2
- data/lib/i18n/tasks/version.rb +1 -1
- data/lib/tasks/i18n-tasks.rake +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31d5d1e5e40da90b8bc3407929c85d75b3430393
|
4
|
+
data.tar.gz: 314256137e73147c52c7ad9148d66a56c0e1428c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 537569c4b406b6d0683af42b5a4e8053e83e665f0bb82db5c38c8f5de2f458c7e570fbd904c41981f2eba0579762e408bc1fde7c8035d100891860b12da3c0e1
|
7
|
+
data.tar.gz: 9de404b284a0b438472923d72180b10e9aa85f077e270cb69b6b5a8f5d3709448f39c44fda448f4d71a69280f1a72ad068130258ea7e83d5dee0a8bbd43e879f
|
data/CHANGES.md
CHANGED
@@ -1,28 +1,29 @@
|
|
1
|
-
## v0.2.5..0.2.
|
1
|
+
## v0.2.5..0.2.8
|
2
2
|
|
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
|
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
|
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
|
14
|
+
* spreadsheet report, tests run on rbx
|
14
15
|
|
15
16
|
## v0.2.2
|
16
17
|
|
17
|
-
* improved output with terminal-table
|
18
|
+
* improved output with terminal-table
|
18
19
|
|
19
20
|
## v0.2.1
|
20
21
|
|
21
|
-
* fill tasks renamed, fix symbol key search
|
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
|
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
|
35
|
-
* multiple configuration variables renamed (still understands old syntax with deprecation warnings)
|
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
|
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
|
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
|
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
|
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.
|
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
|
-
|
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
|
}
|
data/lib/i18n/tasks/version.rb
CHANGED
data/lib/tasks/i18n-tasks.rake
CHANGED
@@ -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'
|