i18n-tasks 0.7.5 → 0.7.6

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
  SHA1:
3
- metadata.gz: 850032b9cd081295834563c079f301118c4adc93
4
- data.tar.gz: bb430460401ab69f396b53e29337b7d12894c49a
3
+ metadata.gz: 34457139e93868f537a6258613716aefc75094a6
4
+ data.tar.gz: 1208e54c90f1504f021e05a7bc13904d38f10c61
5
5
  SHA512:
6
- metadata.gz: 2f28025277307b4c42facd0f94691100f73680a27eaf135945484e5711e66db865a094269f895c3f6e7cdb767c021a50df51fb50d77377eccbfa7e8955359e18
7
- data.tar.gz: 6abfa104439e6592d7a40934fa8e7c70707094be19faad49ce5ca4fbb9a04774613662f0076ff2fa436cd62001a242ad0dea35dcddbcdab7b3e0c49b11f17304
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
- ## What?
5
+ ## How?
6
6
 
7
- i18n-tasks scans calls such as `I18n.t('some.key')` and provides reports on key usage, missing, and unused keys.
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
- ## Why?
9
+ * Report keys that are missing or unused.
10
+ * Pre-fill missing keys, optionally from Google Translate.
11
+ * Remove unused keys.
11
12
 
12
- The default approach to locale data management with gems such as [i18n][i18n-gem] is flawed.
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
- i18n-tasks improves this by analysing code statically, without running it. It scans calls such as `I18n.t('some.key')` and provides reports on key usage, missing, and unused keys.
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
- i18n-tasks can be used with any project using [i18n][i18n-gem] (default in Rails), or similar, even if it isn't ruby.
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
- Add to Gemfile:
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.5'
29
+ gem 'i18n-tasks', '~> 0.7.6'
29
30
  ```
30
31
 
31
32
  Copy default [configuration file](#configuration) (optional):
@@ -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
@@ -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 = %q{
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!(full_key) { |m| underline m }
128
+ result[range] = result[range].sub(full_key) { |m| underline m }
129
129
  result
130
130
  end
131
131
 
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
  module I18n
3
3
  module Tasks
4
- VERSION = '0.7.5'
4
+ VERSION = '0.7.6'
5
5
  end
6
6
  end
@@ -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.5
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-03 00:00:00.000000000 Z
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: |2
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