er18ern 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,28 @@
1
1
  er18ern
2
2
  =======
3
3
 
4
- i18n extensions and utilities
4
+ i18n extensions and utilities
5
+
6
+ Put this in an initializer
7
+
8
+ Er18Ern::RailsApp.setup!
9
+
10
+ Put this in script/ermahgerd
11
+
12
+ require 'er18ern'
13
+
14
+ translator = Er18Ern::Translator.new
15
+ translator.locales_dir = File.expand_path('../../config/locales/', __FILE__)
16
+ translator.google_translator_hax_locale_dirs = File.expand_path('../../config/locale_hax/', __FILE__)
17
+
18
+ translator.generate_ermahgerd!
19
+ translator.resave_en!
20
+ translator.save_jp!
21
+ translator.save_engrish!
22
+ translator.generate_google_translations! #have to do this last because it could override the matching of the jp and engrish
23
+
24
+ Use copy/paste with google translate to:
25
+ locale_hax/GOOGLE_TRANSLATE_INPUT (en) --> locale_hax/GOOGLE_TRANSLATE_OUTPUT (jp)
26
+ locale_hax/GOOGLE_TRANSLATE_OUTPUT (jp) --> ?? --> ?? --> ?? --> locale_hax/GOOGLE_TRANSLATE_AGAIN (engrish)
27
+
28
+ TODO: write some tests!
data/lib/er18ern.rb CHANGED
@@ -191,8 +191,8 @@ module Er18Ern
191
191
  last_hash = hash
192
192
  last = Proc.new do |str|
193
193
  en_string = found_keys[k]
194
- en_string_parts = strip_string(en_string).split("***").reject{|x| x.strip.empty? }
195
- jp_string_parts = str.split("***").reject(&:empty?)
194
+ en_string_parts = strip_string(en_string).split("***")
195
+ jp_string_parts = str.split("***")
196
196
  en_string_parts.each_with_index do |part, index|
197
197
  jp_corresponding = jp_string_parts[index] || "" # "MISSING TRANSLATION"
198
198
  en_string = en_string.gsub(part.to_s, jp_corresponding)
@@ -1,3 +1,3 @@
1
1
  module Er18Ern
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: er18ern
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jacob & Others too ashamed to admit it
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-08-18 00:00:00 Z
18
+ date: 2012-08-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: ermahgerd