translations 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +22 -16
- data/README.md +1 -0
- data/lib/translations/cli.rb +18 -0
- data/lib/translations/version.rb +1 -1
- data/translations.gemspec +2 -1
- metadata +19 -6
- data/.bundle/config +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54777423ede4e043e6d0045c688ccfa4da176cfe
|
4
|
+
data.tar.gz: 3f2e352105786cb13371989f52cc6abbfd71b2e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a6e2a9e75107c6534f9fb2ccd2e47fbe58dd3caec25c04027d86f205c973f766687f72f04619e83b433bc8bb1670e80ec59ccd4fb3d4d303aba3b209fdf3ac8
|
7
|
+
data.tar.gz: 1c07599efb79696a90b9a98818628134180d10de451855fa38910feb34f2efb74c05e24fecfe7e52e18eb1a0d76db36baedc44104dd83afb110a019e36fff409
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,31 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
translations (0.
|
4
|
+
translations (0.3.0)
|
5
5
|
thor (~> 0.18.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
diff-lcs (1.
|
10
|
+
diff-lcs (1.2.5)
|
11
11
|
predicated (0.2.6)
|
12
|
-
|
13
|
-
|
14
|
-
rspec-
|
15
|
-
rspec-
|
16
|
-
|
17
|
-
rspec-
|
18
|
-
|
19
|
-
rspec-
|
20
|
-
|
12
|
+
rake (10.3.2)
|
13
|
+
rspec (3.0.0)
|
14
|
+
rspec-core (~> 3.0.0)
|
15
|
+
rspec-expectations (~> 3.0.0)
|
16
|
+
rspec-mocks (~> 3.0.0)
|
17
|
+
rspec-core (3.0.4)
|
18
|
+
rspec-support (~> 3.0.0)
|
19
|
+
rspec-expectations (3.0.4)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.0.0)
|
22
|
+
rspec-mocks (3.0.4)
|
23
|
+
rspec-support (~> 3.0.0)
|
24
|
+
rspec-support (3.0.4)
|
25
|
+
ruby2ruby (2.1.2)
|
21
26
|
ruby_parser (~> 3.1)
|
22
27
|
sexp_processor (~> 4.0)
|
23
|
-
ruby_parser (3.
|
28
|
+
ruby_parser (3.6.2)
|
24
29
|
sexp_processor (~> 4.1)
|
25
|
-
sexp_processor (4.
|
30
|
+
sexp_processor (4.4.4)
|
26
31
|
thor (0.18.1)
|
27
|
-
wrong (0.7.
|
28
|
-
diff-lcs (~> 1.
|
32
|
+
wrong (0.7.1)
|
33
|
+
diff-lcs (~> 1.2.5)
|
29
34
|
predicated (~> 0.2.6)
|
30
35
|
ruby2ruby (>= 2.0.1)
|
31
36
|
ruby_parser (>= 3.0.1)
|
@@ -35,6 +40,7 @@ PLATFORMS
|
|
35
40
|
ruby
|
36
41
|
|
37
42
|
DEPENDENCIES
|
38
|
-
|
43
|
+
rake (~> 10.3)
|
44
|
+
rspec (~> 3.0)
|
39
45
|
translations!
|
40
46
|
wrong (~> 0.7)
|
data/README.md
CHANGED
@@ -29,6 +29,7 @@ Currently there are some commands to alter your translation files:
|
|
29
29
|
And there are commands to view your translations:
|
30
30
|
|
31
31
|
- `view`: View all translations for a given key
|
32
|
+
- `validate`: Validate that a translations has all keys, that are in the master
|
32
33
|
|
33
34
|
For more info just run `translations help <command>`.
|
34
35
|
|
data/lib/translations/cli.rb
CHANGED
@@ -41,6 +41,24 @@ module Translations
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
desc "validate LOCALE", "Validate that LOCALE contains all keys from master"
|
45
|
+
def validate locale
|
46
|
+
translations = serializer.translations
|
47
|
+
translation = translations.for_locale(locale)
|
48
|
+
keys = translation.missing_keys_from_translation(translations.master)
|
49
|
+
|
50
|
+
if keys.length > 0
|
51
|
+
say "Missing keys in #{locale}"
|
52
|
+
say
|
53
|
+
|
54
|
+
keys.each do |key|
|
55
|
+
say "- #{key}"
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 1
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
44
62
|
desc "remove KEYS", "Remove KEYS from all locales"
|
45
63
|
def remove *keys
|
46
64
|
translations = serializer.translations
|
data/lib/translations/version.rb
CHANGED
data/translations.gemspec
CHANGED
@@ -14,7 +14,8 @@ Gem::Specification.new do |gem|
|
|
14
14
|
|
15
15
|
gem.add_dependency "thor", "~> 0.18.1"
|
16
16
|
|
17
|
-
gem.add_development_dependency "
|
17
|
+
gem.add_development_dependency "rake", "~> 10.3"
|
18
|
+
gem.add_development_dependency "rspec", "~> 3.0"
|
18
19
|
gem.add_development_dependency "wrong", "~> 0.7"
|
19
20
|
|
20
21
|
gem.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Lienen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.18.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.3'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - ~>
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
47
|
+
version: '3.0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ~>
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
54
|
+
version: '3.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: wrong
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,7 +74,6 @@ executables:
|
|
60
74
|
extensions: []
|
61
75
|
extra_rdoc_files: []
|
62
76
|
files:
|
63
|
-
- .bundle/config
|
64
77
|
- .gitignore
|
65
78
|
- .rspec
|
66
79
|
- .ruby-version
|
@@ -104,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
117
|
version: '0'
|
105
118
|
requirements: []
|
106
119
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.2.2
|
108
121
|
signing_key:
|
109
122
|
specification_version: 4
|
110
123
|
summary: Stop wasting time altering the structure of your i18n files
|
data/.bundle/config
DELETED