i18n-tasks 0.7.5 → 0.7.6
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 +6 -0
- data/README.md +13 -12
- data/config/i18n-tasks.yml +1 -1
- data/i18n-tasks.gemspec +8 -1
- data/lib/i18n/tasks/reports/terminal.rb +1 -1
- data/lib/i18n/tasks/version.rb +1 -1
- data/templates/config/i18n-tasks.yml +1 -1
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34457139e93868f537a6258613716aefc75094a6
|
4
|
+
data.tar.gz: 1208e54c90f1504f021e05a7bc13904d38f10c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02aded94bed5ff6e30a729c6352d987fa4f675e44a51e0fa784a79d430bcc951934f61c5a1ee2985832ac1353193da88062a556b6c85cc1faa57ac39bc7aa176
|
7
|
+
data.tar.gz: 4ec6497da3b91b0bf2612cb25cc9e743d11ed5354d51bbfbec75edfce26adb35b87f986d8c1f83ea54fb0c3c3b1074defbcbfcc0b923973b5eb1e90bcc0cd751
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.7.6
|
2
|
+
|
3
|
+
* Add a post-install notice with setup commands
|
4
|
+
* Fix a small typo in the config template [#91](https://github.com/glebm/i18n-tasks/pull/91).
|
5
|
+
* Fix `find` crashing on relative keys (regression)
|
6
|
+
|
1
7
|
## 0.7.5
|
2
8
|
|
3
9
|
Dynamic key usage inference fixes by [Mikko Koski](https://github.com/rap1ds):
|
data/README.md
CHANGED
@@ -2,30 +2,31 @@
|
|
2
2
|
|
3
3
|
i18n-tasks helps you find and manage missing and unused translations.
|
4
4
|
|
5
|
-
##
|
5
|
+
## How?
|
6
6
|
|
7
|
-
i18n-tasks
|
8
|
-
i18n-tasks can also can pre-fill missing keys, including from Google Translate, and it can remove unused keys as well.
|
7
|
+
i18n-tasks analyses the code statically for key usages, such as `I18n.t('some.key')`, in order to:
|
9
8
|
|
10
|
-
|
9
|
+
* Report keys that are missing or unused.
|
10
|
+
* Pre-fill missing keys, optionally from Google Translate.
|
11
|
+
* Remove unused keys.
|
11
12
|
|
12
|
-
|
13
|
-
If you use a key that does not exist, this will only blow up at runtime. Keys left over from removed code accumulate
|
14
|
-
in the resource files and introduce unnecessary overhead on the translators. Translation files can quickly turn to disarray.
|
13
|
+
## Why?
|
15
14
|
|
16
|
-
|
17
|
-
It can also pre-fill missing keys, including from Google Translate, and it can remove unused keys as well.
|
15
|
+
This gem addresses these drawbacks of [i18n gem][i18n-gem] design:
|
18
16
|
|
19
|
-
|
17
|
+
* Missing keys only blow up at runtime.
|
18
|
+
* Keys no longer in use may accumulate and introduce overhead, without you knowing it.
|
20
19
|
|
21
20
|
<img width="539" height="331" src="https://raw.github.com/glebm/i18n-tasks/master/doc/img/i18n-tasks.png">
|
22
21
|
|
23
22
|
## Installation
|
24
23
|
|
25
|
-
|
24
|
+
i18n-tasks can be used with any project using [i18n][i18n-gem] (default in Rails), or similar, even if it isn't ruby.
|
25
|
+
|
26
|
+
Add it to the Gemfile:
|
26
27
|
|
27
28
|
```ruby
|
28
|
-
gem 'i18n-tasks', '~> 0.7.
|
29
|
+
gem 'i18n-tasks', '~> 0.7.6'
|
29
30
|
```
|
30
31
|
|
31
32
|
Copy default [configuration file](#configuration) (optional):
|
data/config/i18n-tasks.yml
CHANGED
@@ -22,7 +22,7 @@ data:
|
|
22
22
|
# key => file routes, matched top to bottom
|
23
23
|
write:
|
24
24
|
## E.g., write devise and simple form keys to their respective files
|
25
|
-
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale.yml
|
25
|
+
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
|
26
26
|
# Catch-all
|
27
27
|
- config/locales/%{locale}.yml
|
28
28
|
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
data/i18n-tasks.gemspec
CHANGED
@@ -9,12 +9,19 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ['glebm']
|
10
10
|
s.email = ['glex.spb@gmail.com']
|
11
11
|
s.summary = %q{Manage localization and translation with the awesome power of static analysis}
|
12
|
-
s.description =
|
12
|
+
s.description = <<-TEXT
|
13
13
|
i18n-tasks helps you find and manage missing and unused translations.
|
14
14
|
|
15
15
|
It scans calls such as `I18n.t('some.key')` and provides reports on key usage, missing, and unused keys.
|
16
16
|
It can also can pre-fill missing keys, including from Google Translate, and it can remove unused keys as well.
|
17
|
+
TEXT
|
18
|
+
s.post_install_message = <<-TEXT
|
19
|
+
# Install default configuration:
|
20
|
+
cp $(i18n-tasks gem-path)/templates/config/i18n-tasks.yml config/
|
21
|
+
# Add an RSpec for missing and unused keys:
|
22
|
+
cp $(i18n-tasks gem-path)/templates/rspec/i18n_spec.rb spec/
|
17
23
|
}
|
24
|
+
TEXT
|
18
25
|
s.homepage = 'https://github.com/glebm/i18n-tasks'
|
19
26
|
if s.respond_to?(:metadata=)
|
20
27
|
s.metadata = { 'issue_tracker' => 'https://github.com/glebm/i18n-tasks' }
|
@@ -125,7 +125,7 @@ module I18n
|
|
125
125
|
|
126
126
|
def highlight_key(full_key, line, range = (0..-1))
|
127
127
|
result = line.dup
|
128
|
-
result[range] = result[range].sub
|
128
|
+
result[range] = result[range].sub(full_key) { |m| underline m }
|
129
129
|
result
|
130
130
|
end
|
131
131
|
|
data/lib/i18n/tasks/version.rb
CHANGED
@@ -22,7 +22,7 @@ data:
|
|
22
22
|
# key => file routes, matched top to bottom
|
23
23
|
write:
|
24
24
|
## E.g., write devise and simple form keys to their respective files
|
25
|
-
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale.yml
|
25
|
+
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
|
26
26
|
# Catch-all
|
27
27
|
- config/locales/%{locale}.yml
|
28
28
|
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|
@@ -192,8 +192,7 @@ dependencies:
|
|
192
192
|
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
|
-
description: |
|
196
|
-
|
195
|
+
description: |
|
197
196
|
i18n-tasks helps you find and manage missing and unused translations.
|
198
197
|
|
199
198
|
It scans calls such as `I18n.t('some.key')` and provides reports on key usage, missing, and unused keys.
|
@@ -315,7 +314,12 @@ licenses:
|
|
315
314
|
- MIT
|
316
315
|
metadata:
|
317
316
|
issue_tracker: https://github.com/glebm/i18n-tasks
|
318
|
-
post_install_message:
|
317
|
+
post_install_message: |
|
318
|
+
# Install default configuration:
|
319
|
+
cp $(i18n-tasks gem-path)/templates/config/i18n-tasks.yml config/
|
320
|
+
# Add an RSpec for missing and unused keys:
|
321
|
+
cp $(i18n-tasks gem-path)/templates/rspec/i18n_spec.rb spec/
|
322
|
+
}
|
319
323
|
rdoc_options: []
|
320
324
|
require_paths:
|
321
325
|
- lib
|