i18n_screwdriver 0.2.0 → 0.2.1
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/README.rdoc +8 -3
- data/VERSION +1 -1
- data/i18n_screwdriver.gemspec +1 -1
- data/lib/tasks/i18n.rake +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -8,7 +8,11 @@ stick to the rails standard libraries. Therefor I created this small toolbox.
|
|
8
8
|
|
9
9
|
== Installation
|
10
10
|
|
11
|
-
|
11
|
+
Just include the screwdriver gem in your Bundler Gemfile
|
12
|
+
|
13
|
+
gem 'i18n_screwdriver'
|
14
|
+
|
15
|
+
Then run the generator that copies the translation rake task to your application task dir.
|
12
16
|
|
13
17
|
rails g screwdriver
|
14
18
|
|
@@ -35,13 +39,14 @@ It gets recreated everytime you run the tasks - edit those translations in your
|
|
35
39
|
|
36
40
|
TRANSLATE=en rake i18n:translate
|
37
41
|
|
38
|
-
|
39
42
|
== Next steps
|
40
43
|
|
44
|
+
* fix drawback that multiple translations on the same name are currently not recognized, happens very well with options for select tags
|
45
|
+
* also recognize model validation error messages
|
41
46
|
* DRY the code
|
42
47
|
* test more
|
43
48
|
* use ruby_parser instead of regex
|
44
|
-
* support interpolation
|
49
|
+
* support interpolation like "my name is #{user.full_name} and I am living in #{user.location}"
|
45
50
|
|
46
51
|
== Contributing to i18n_screwdriver
|
47
52
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/i18n_screwdriver.gemspec
CHANGED
data/lib/tasks/i18n.rake
CHANGED
@@ -37,7 +37,7 @@ namespace :i18n do
|
|
37
37
|
|
38
38
|
# add new keys with empty translation to hash
|
39
39
|
translations.each_key do |key|
|
40
|
-
existing_translations[key] = "TRANSLATION_MISSING
|
40
|
+
existing_translations[key] = "TRANSLATION_MISSING" unless existing_translations.has_key?(key)
|
41
41
|
end
|
42
42
|
write_translation_file(language, existing_translations)
|
43
43
|
end
|
@@ -51,7 +51,7 @@ namespace :i18n do
|
|
51
51
|
existing_translations = existing_translations[language]
|
52
52
|
puts "Translating #{existing_translations.keys.size} entries to <#{language}> (enter :q to save and quit):"
|
53
53
|
existing_translations.keys.sort.each do |key|
|
54
|
-
if existing_translations[key]
|
54
|
+
if ["TRANSLATION_MISSING", ""].include?(existing_translations[key])
|
55
55
|
puts "> #{key}"
|
56
56
|
input = STDIN.gets.chomp
|
57
57
|
if input == ":q"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_screwdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Miesel
|