translations 0.1.0 → 0.2.0
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.
- data/Gemfile.lock +1 -1
- data/README.md +5 -1
- data/lib/translations/cli.rb +11 -0
- data/lib/translations/version.rb +1 -1
- data/translations.gemspec +2 -2
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ The default master is `en`, but you may alter it using the `-m <locale>` switch.
|
|
|
17
17
|
Usage
|
|
18
18
|
-----
|
|
19
19
|
|
|
20
|
-
Currently there are
|
|
20
|
+
Currently there are some commands to alter your translation files:
|
|
21
21
|
|
|
22
22
|
- `add`: Add a new key to all your files
|
|
23
23
|
- `update`: Update a key in a single file
|
|
@@ -26,6 +26,10 @@ Currently there are 6 commands to alter your translation files:
|
|
|
26
26
|
- `remove`: Remove a key from all files
|
|
27
27
|
- `translate`: Translate all keys that are missing from a given file
|
|
28
28
|
|
|
29
|
+
And there are commands to view your translations:
|
|
30
|
+
|
|
31
|
+
- `view`: View all translations for a given key
|
|
32
|
+
|
|
29
33
|
For more info just run `translations help <command>`.
|
|
30
34
|
|
|
31
35
|
|
data/lib/translations/cli.rb
CHANGED
|
@@ -138,6 +138,17 @@ module Translations
|
|
|
138
138
|
serializer.save translations
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
+
desc "view KEY", "View all translations for a given key"
|
|
142
|
+
def view key
|
|
143
|
+
serializer.translations.each do |translation|
|
|
144
|
+
if translation.has_key? key
|
|
145
|
+
say "#{translation.locale}: #{translation[key]}"
|
|
146
|
+
else
|
|
147
|
+
say "#{translation.locale} does not have key #{key}"
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
141
152
|
no_tasks do
|
|
142
153
|
def serializer
|
|
143
154
|
@serializer ||= Serializer.new options.directory, options.master
|
data/lib/translations/version.rb
CHANGED
data/translations.gemspec
CHANGED
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
|
8
8
|
gem.version = Translations::VERSION
|
|
9
9
|
gem.authors = ["Marten Lienen"]
|
|
10
10
|
gem.email = ["marten.lienen@gmail.com"]
|
|
11
|
-
gem.description =
|
|
12
|
-
gem.summary =
|
|
11
|
+
gem.description = "Manage YAML translations"
|
|
12
|
+
gem.summary = "Stop wasting time altering the structure of your i18n files"
|
|
13
13
|
gem.homepage = "https://github.com/CQQL/translations"
|
|
14
14
|
|
|
15
15
|
gem.add_dependency "thor", "~> 0.17.0"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: translations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-02-
|
|
12
|
+
date: 2013-02-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|
|
@@ -114,7 +114,7 @@ rubyforge_project:
|
|
|
114
114
|
rubygems_version: 1.8.25
|
|
115
115
|
signing_key:
|
|
116
116
|
specification_version: 3
|
|
117
|
-
summary:
|
|
117
|
+
summary: Stop wasting time altering the structure of your i18n files
|
|
118
118
|
test_files:
|
|
119
119
|
- spec/fixtures/missing_keys/de.yml
|
|
120
120
|
- spec/fixtures/missing_keys/en.yml
|