i18n-sync 0.8.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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +75 -0
  3. data/Rakefile +9 -0
  4. data/bin/i18s +61 -0
  5. data/lib/i18n/sync.rb +115 -0
  6. data/lib/i18n/sync/hash.rb +12 -0
  7. data/lib/i18n/sync/version.rb +5 -0
  8. data/spec/fixtures/children.en.yml +14 -0
  9. data/spec/fixtures/children.pt.yml +8 -0
  10. data/spec/fixtures/en.yml +5 -0
  11. data/spec/fixtures/extra.en.yml +4 -0
  12. data/spec/fixtures/extra.pt.yml +3 -0
  13. data/spec/fixtures/named.en.yml +4 -0
  14. data/spec/fixtures/named.pt.yml +3 -0
  15. data/spec/fixtures/order.en.yml +3 -0
  16. data/spec/fixtures/order.pt.yml +4 -0
  17. data/spec/fixtures/pt.yml +5 -0
  18. data/spec/i18n_sync_spec.rb +149 -0
  19. data/spec/results/children.pt.yml +16 -0
  20. data/spec/results/extra.pt.yml +6 -0
  21. data/spec/results/named.pt.yml +5 -0
  22. data/spec/results/order.en.yml +6 -0
  23. data/spec/spec_helper.rb +13 -0
  24. data/spec/work/children.en.yml +14 -0
  25. data/spec/work/children.pt.yml +8 -0
  26. data/spec/work/en.yml +6 -0
  27. data/spec/work/extra.en.yml +4 -0
  28. data/spec/work/extra.pt.yml +3 -0
  29. data/spec/work/named.en.yml +4 -0
  30. data/spec/work/named.pt.yml +3 -0
  31. data/spec/work/order.en.yml +3 -0
  32. data/spec/work/order.pt.yml +4 -0
  33. data/spec/work/pt.yml +6 -0
  34. data/spec/workmulti/children.en.yml +16 -0
  35. data/spec/workmulti/children.pt.yml +16 -0
  36. data/spec/workmulti/en.yml +5 -0
  37. data/spec/workmulti/extra.en.yml +6 -0
  38. data/spec/workmulti/extra.pt.yml +6 -0
  39. data/spec/workmulti/named.en.yml +5 -0
  40. data/spec/workmulti/named.pt.yml +5 -0
  41. data/spec/workmulti/order.en.yml +5 -0
  42. data/spec/workmulti/order.pt.yml +5 -0
  43. data/spec/workmulti/pt.yml +5 -0
  44. metadata +130 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8ba2f7697046b2a5dbdecad7359da56c280d48e3
4
+ data.tar.gz: 61512ea612b992747de1a3d5116875b58423d366
5
+ SHA512:
6
+ metadata.gz: a5800d050a1557d9f92b9ef02fb3f0ca6145b84141d3786ea22f0d2b14178c83c6066da4bb7ef360921c8726d21ec1129001ae06463e33629c83e7203ffee5bf
7
+ data.tar.gz: 13a184526da23a2ff217afa675dd720849de365de818affe2ef6b4166cae0e6cd26d0469a49668157b38f3a7b5fa852019757be9499942a365eb4618a0b5520c
@@ -0,0 +1,75 @@
1
+ i18n Sync!
2
+ ==========
3
+
4
+ Syncs all locales/languages yml/rb files *keys* based on a "master" one.
5
+
6
+
7
+
8
+ Install
9
+ -------
10
+
11
+ gem install i18n_sync
12
+
13
+
14
+ Use
15
+ ===
16
+
17
+
18
+ i18s path/to/master/file.lang.yml
19
+
20
+
21
+ All other yml should be located on the same folder as the "master".
22
+
23
+ Example:
24
+
25
+
26
+ i18s config/locales/app.en.yml
27
+
28
+ This command syncs all config/locale/app.*.yml files keys
29
+ using 'app.en.yml' as the template.
30
+
31
+
32
+ Create New Files
33
+ ----------------
34
+
35
+ i18s config/locales/app.en.yml pt es it
36
+
37
+
38
+ This creates 'app.pt.yml', 'app.es.yml'....
39
+
40
+
41
+
42
+ Add Key
43
+ -------
44
+
45
+ i18s add some.very.nested.key Value path/to/file
46
+
47
+ Adds the new key on the file and every other translation.
48
+
49
+
50
+
51
+ Full Sync
52
+ ---------
53
+
54
+ i18s path/to/directory
55
+
56
+ Syncronizes the entire directory.
57
+
58
+
59
+
60
+ Note on Patches/Pull Requests
61
+ -----------------------------
62
+
63
+ * Fork the project.
64
+ * Make your feature addition or bug fix.
65
+ * Add tests for it. This is important so I don't break it in a
66
+ future version unintentionally.
67
+ * Commit, do not mess with rakefile, version, or history.
68
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
69
+ * Send me a pull request. Bonus points for topic branches.
70
+
71
+
72
+ Copyright
73
+ ---------
74
+
75
+ Copyright (c) 2010 Marcos Piccinini. See LICENSE for details.
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core/rake_task'
4
+ require 'rubocop/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new
7
+ RuboCop::RakeTask.new
8
+
9
+ task default: [:spec, :rubocop]
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # I18S
4
+ #
5
+ # Created on 2010-5-17.
6
+ # Copyleft nofxx (c) 2011.
7
+ #
8
+ begin
9
+ require 'rubygems'
10
+ rescue LoadError
11
+ # no rubygems to load, so we fail silently
12
+ end
13
+ require 'optparse'
14
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
+ require 'i18n/sync'
16
+
17
+ Options = {:lang => :en}
18
+
19
+ parser = OptionParser.new do |opts|
20
+ opts.banner = <<BANNER
21
+ ------------------------------------------------------
22
+ I18N Sync ->
23
+ <-
24
+ ------------------------------------------------------
25
+
26
+ Usage: #{File.basename($0)} <path/to/master.yml> [args]
27
+
28
+ Options are:
29
+
30
+ -l --lang LANG - Select a default language
31
+ -O --no-order - Don`t automatically order
32
+ -S --no-chomp - Don`t delete trailing spaces
33
+ -v --vernose - Be more verbose
34
+
35
+ Common usage:
36
+
37
+ i18s ./en-US.yml - Will sync all files with en-US
38
+ i18s ./en-US.yml pt - Creates a new translate file pt.yml
39
+
40
+ '''`'``'`
41
+ BANNER
42
+ opts.on("-l LANGUAGE", "--lang", "Default Language" ) { |l| Options[:lang] = l }
43
+ opts.on("-O", "--no-order", "Don`t order automatically" ) { Options[:order] = false }
44
+ opts.on("-S", "--no-chomp", "Don`t remove trailing spaces" ) { Options[:space] = false }
45
+ opts.on("-v", "--verbose") { Options[:debug] = true }
46
+ opts.parse!(ARGV)
47
+ end
48
+
49
+ if ARGV.empty?
50
+ # ipaths = %w{ config/locales lib/locales }.select { |ipath| File.exists?(ipath) }
51
+ # unless ipaths.empty?
52
+ # ipaths.each { |i| I18S.work_on(i) }
53
+ # else
54
+ puts parser.banner
55
+ exit
56
+ # end
57
+ elsif ARGV[0] == "add"
58
+ I18n::Sync.add_key *ARGV[1..-1]
59
+ else
60
+ I18n::Sync.work_on ARGV, Options # ARGF
61
+ end
@@ -0,0 +1,115 @@
1
+ #
2
+ # Inspired by translation rake task on spree (http://spreecommerce.com/)
3
+ #
4
+ require 'yaml'
5
+ # Changed to use YAML instead of text regex,
6
+ # but yaml has issues so we need to:
7
+ require 'ya2yaml'
8
+ # In order to work with utf8 encoded .yml files.
9
+ # TODO: Fixed in ruby 1.9.x ???
10
+ require 'i18n/sync/hash'
11
+
12
+
13
+ module I18n
14
+
15
+ class Sync
16
+
17
+ def initialize(argv, opts = {}, keys = {}, argf=[])
18
+ # argf.each { |file| p file }
19
+ @fullpath, *@new_ones = argv
20
+ @file, *path = @fullpath.split("/").reverse # hm.. hack,,, in 1.9
21
+ @path = path.reverse.join("/") || "." # can splat the first
22
+ _, @lang, @namespace = @file.split(".").reverse
23
+ @debug = opts[:debug]
24
+ @order = opts[:order]
25
+ @comments, @words = read_file(@fullpath, @lang)
26
+ @words.merge! keys unless keys.empty?
27
+ work
28
+ end
29
+
30
+ def work
31
+ out "Start work on #{@file} (#{@lang})"
32
+ @new_ones.empty? ? sync : create_new_files
33
+ end
34
+
35
+ def create_new_files
36
+ @new_ones.each do |name|
37
+ puts "Creating new file #{name}"
38
+ create name
39
+ end
40
+ end
41
+
42
+ def sync
43
+ Dir["#{@path}/*.{yml,rb}"].each do |filename|
44
+ lang, namespace = File.basename(filename, '.yml').split(".").reverse
45
+ if namespace
46
+ next unless @namespace && @namespace == namespace
47
+ else
48
+ next if @namespace
49
+ end
50
+
51
+ out "Writing #{filename}"
52
+ (_comments, old) = read_file(filename, lang)
53
+ # Initializing hash variable as empty if it does not exist
54
+ other = @words.dup.deep_merge! old
55
+ write_file(filename, lang, @comments, other)
56
+ end
57
+ end
58
+
59
+ def create newlang
60
+ # New name "app.en.yml" -> "app.pt.yml", "en.yml" -> "pt.yml"
61
+ newname = @file.gsub(/(^|\.)#{@lang}\./, "\\1#{newlang}.")
62
+ fullpath = "#{@path}/#{newname}"
63
+ return puts("File exists.") if File.exists?(fullpath)
64
+ write_file(fullpath, newlang, @comments, @words)
65
+ end
66
+
67
+ # Retrieve comments and translation data in hash form
68
+ def read_file(filename, basename)
69
+ comments = File.read(filename).each_line.select { |l| l =~ /^\w*#/}.join("\n")
70
+ [comments, YAML.load(File.open(filename, "r:utf-8"))[basename]]
71
+ end
72
+
73
+ # Writes to file the translation data hash structure
74
+ def write_file(filename, basename, comments, data)
75
+ File.delete filename if File.exists? filename
76
+ File.open(filename, "w:utf-8") do |y|
77
+ y.puts(comments) if comments
78
+ yaml = { basename => data }.ya2yaml
79
+
80
+ yaml.gsub!(/ +$/, '') # removing trailing spaces
81
+ y.puts(yaml)
82
+ end
83
+ end
84
+
85
+ def out(txt)
86
+ puts txt if @debug
87
+ end
88
+
89
+ class << self
90
+
91
+ # Just here cuz I'm lazy....TBF really ugly ! ! ! !
92
+ def work_on(argv, opts = {}, argf = [])
93
+ if File.directory? path = argv[0]
94
+ Dir["#{path}/**"].map do |file|
95
+ next unless file =~ /(^|\.)#{opts[:lang]}\./
96
+ new([file], opts, argf)
97
+ end.reject(&:nil?)
98
+ else
99
+ [new(argv, opts, argf)]
100
+ end
101
+ end
102
+
103
+ def add_key(key, val, file)
104
+ hsh = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
105
+ keys = key.split(".")
106
+ keys.reduce(hsh) do |a, k|
107
+ k == keys[-1] ? a[k] = val : a = a[k]
108
+ end
109
+ new(file, {}, hsh)
110
+ end
111
+
112
+ end
113
+
114
+ end
115
+ end
@@ -0,0 +1,12 @@
1
+ class Hash
2
+
3
+ # Ensures multilevel hash merging
4
+ def deep_merge!(other_hash)
5
+ other_hash.each do |k,v|
6
+ next unless tv = self[k]
7
+ self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.dup.deep_merge!(v) : v
8
+ end
9
+ self
10
+ end
11
+
12
+ end
@@ -0,0 +1,5 @@
1
+ module I18n
2
+ module Sync
3
+ VERSION = '0.8.0' # babel shark
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ en:
2
+ another: Another
3
+ newone: "New One!"
4
+ test: Test
5
+ very:
6
+ nasty:
7
+ nested:
8
+ bax: Bax
9
+ foo: Foo
10
+ bar: Bar
11
+ newvery:
12
+ nasty:
13
+ nested:
14
+ hi: Hi
@@ -0,0 +1,8 @@
1
+ pt:
2
+ test: Teste
3
+ old: Velho
4
+ very:
5
+ nasty:
6
+ nested:
7
+ foo: Fu
8
+ old: Velho
@@ -0,0 +1,5 @@
1
+ # Comment cool
2
+
3
+ en:
4
+ sync: To Sync It!
5
+ test: Test
@@ -0,0 +1,4 @@
1
+ en:
2
+ yup: Yes
3
+ with_colon: "Value: Rock"
4
+ normal: Normal
@@ -0,0 +1,3 @@
1
+ pt:
2
+ yup: Sim
3
+ nope: Não
@@ -0,0 +1,4 @@
1
+
2
+ en:
3
+ something: Something
4
+ another: Another
@@ -0,0 +1,3 @@
1
+
2
+ pt:
3
+ something: Algo
@@ -0,0 +1,3 @@
1
+ en:
2
+ blue: Blue
3
+ alpha: Alpha
@@ -0,0 +1,4 @@
1
+ pt:
2
+ zebra: Zebra
3
+ blue: Azul
4
+ alpha: Alfa
@@ -0,0 +1,5 @@
1
+
2
+ pt:
3
+ sync: To Sync It!
4
+ test: Teste
5
+ new: "Uau, isso é novo"
@@ -0,0 +1,149 @@
1
+ # -*- coding: utf-8 -*-
2
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
+
4
+ EN = "spec/work/en.yml"
5
+
6
+ def run(comm)
7
+ `bin/i18s #{comm}`
8
+ end
9
+
10
+ def result(name)
11
+ File.read("spec/results/#{name}.yml")
12
+ end
13
+
14
+ def files_should_match(name, extra = nil)
15
+ expect(File.read("spec/work#{extra}/#{name}.yml")).to eql(result(name))
16
+ end
17
+
18
+ describe "I18nSync" do
19
+ before do
20
+ `rm -rf spec/work`
21
+ `cp -rf spec/fixtures spec/work`
22
+ end
23
+
24
+ describe "Unit" do
25
+
26
+ let(:i) { I18S.new("spec/work/en.yml") }
27
+
28
+ it "should parse master file" do
29
+ expect(i.instance_variable_get("@path")).to eql("spec/work")
30
+ expect(i.instance_variable_get("@lang")).to eql("en")
31
+ expect(i.instance_variable_get("@file")).to eql("en.yml")
32
+ end
33
+
34
+ it "should read comments" do
35
+ expect(i.instance_variable_get("@comments")).to eql("# Comment cool\n")
36
+ end
37
+
38
+ it "should read the hash" do
39
+ expect(i.instance_variable_get("@words")).to eql({"sync"=>"To Sync It!", "test"=>"Test"})
40
+ end
41
+
42
+ it "should work fine with other files" do
43
+ i2 = I18S.new("spec/work/pt.yml")
44
+ expect(i2.instance_variable_get("@lang")).to eql("pt")
45
+ expect(i2.instance_variable_get("@comments")).to be_empty
46
+ end
47
+
48
+ end
49
+
50
+ describe "Namespaced" do
51
+
52
+ let(:i) { I18S.new("spec/work/named.en.yml") }
53
+
54
+ it "should parse master file" do
55
+ expect(i.instance_variable_get("@path")).to eql("spec/work")
56
+ expect(i.instance_variable_get("@lang")).to eql("en")
57
+ expect(i.instance_variable_get("@namespace")).to eql("named")
58
+ expect(i.instance_variable_get("@file")).to eql("named.en.yml")
59
+ end
60
+
61
+ it "should read the hash" do
62
+ expect(i.instance_variable_get("@words")).
63
+ to eql({"something"=>"Something", "another"=>"Another"})
64
+ end
65
+
66
+ end
67
+
68
+ describe "Acceptance" do
69
+
70
+ it "should sync files nicely" do
71
+ run("spec/work/pt.yml")
72
+ expect(File.read(EN)).to eql("\n--- \nen: \n new: \"Uau, isso é novo\"\n sync: \"To Sync It!\"\n test: Test\n")
73
+ end
74
+
75
+ it "should respect namespaces" do
76
+ run("spec/work/pt.yml")
77
+ expect(File.read("spec/work/named.pt.yml")).to eql("\npt:\n something: Algo\n")
78
+ end
79
+
80
+ it "should work with namespaces" do
81
+ run("spec/work/named.en.yml")
82
+ files_should_match("named.pt")
83
+ expect(File.read("spec/work/pt.yml")).to
84
+ eql("\npt:\n sync: To Sync It!\n test: Teste\n new: \"Uau, isso é novo\"\n")
85
+ end
86
+
87
+ it "should order alphabeticaly namespaces" do
88
+ run("spec/work/order.pt.yml")
89
+ files_should_match("order.en")
90
+ File.read("spec/work/named.pt.yml").to eql("\npt:\n something: Algo\n")
91
+ end
92
+
93
+ it "should work with extra chars" do
94
+ run("spec/work/extra.en.yml")
95
+ files_should_match("extra.pt")
96
+ end
97
+
98
+ it "should work with deep nestings" do
99
+ run("spec/work/children.en.yml")
100
+ files_should_match("children.pt")
101
+ end
102
+
103
+ end
104
+
105
+ describe "Creating files" do
106
+
107
+ it "should create a new one" do
108
+ newfile = "spec/work/fo.yml"; `rm #{newfile}` if File.exists?(newfile)
109
+ run("#{EN} fo")
110
+ expect(File.read(newfile)).to eql("# Comment cool\n--- \nfo: \n sync: \"To Sync It!\"\n test: Test\n")
111
+ end
112
+
113
+ it "should create a new with the right name" do
114
+ newfile = "spec/work/named.fo.yml"; `rm #{newfile}` if File.exists?(newfile)
115
+ run("spec/work/named.en.yml fo")
116
+ expect(File.read(newfile)).to eql("\n--- \nfo: \n another: Another\n something: Something\n")
117
+ end
118
+
119
+ end
120
+
121
+ describe "Multi Files" do
122
+
123
+ before do
124
+ `rm -rf spec/workmulti`
125
+ `cp -rf spec/fixtures spec/workmulti`
126
+ end
127
+
128
+ it "should sync a show directory" do
129
+ run("spec/workmulti")
130
+ files_should_match("extra.pt", :multi)
131
+ end
132
+
133
+ end
134
+
135
+ describe "Add keys to i18n!" do
136
+
137
+ it "should have a nice command to add stuff" do
138
+ run("add dynamic Dynamic spec/work/en.yml")
139
+ expect(File.read("spec/work/en.yml")).to eql("# Comment cool\n--- \nen: \n dynamic: Dynamic\n sync: \"To Sync It!\"\n test: Test\n")
140
+ end
141
+
142
+ it "should work on a complex scenario" do
143
+ run("add dynamic.nested.very.nasty Nasty spec/work/extra.en.yml")
144
+ expect(File.read("spec/work/extra.en.yml")).to eql("\n--- \nen: \n dynamic: \n nested: \n very: \n nasty: Nasty\n normal: Normal\n with_colon: \"Value: Rock\"\n yup: true\n")
145
+
146
+ end
147
+ end
148
+
149
+ end
@@ -0,0 +1,16 @@
1
+
2
+ ---
3
+ pt:
4
+ another: Another
5
+ newone: "New One!"
6
+ newvery:
7
+ nasty:
8
+ nested:
9
+ hi: Hi
10
+ test: Teste
11
+ very:
12
+ nasty:
13
+ nested:
14
+ bar: Bar
15
+ bax: Bax
16
+ foo: Fu
@@ -0,0 +1,6 @@
1
+
2
+ ---
3
+ pt:
4
+ normal: Normal
5
+ with_colon: "Value: Rock"
6
+ yup: Sim
@@ -0,0 +1,5 @@
1
+
2
+ ---
3
+ pt:
4
+ another: Another
5
+ something: Algo
@@ -0,0 +1,6 @@
1
+
2
+ ---
3
+ en:
4
+ alpha: Alpha
5
+ blue: Blue
6
+ zebra: Zebra
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'i18n_sync'
4
+ begin
5
+ require 'spec'
6
+ require 'spec/autorun'
7
+ rescue LoadError
8
+ require 'rspec'
9
+ end
10
+
11
+ # Spec::Runner.configure do |config|
12
+
13
+ # end
@@ -0,0 +1,14 @@
1
+ en:
2
+ another: Another
3
+ newone: "New One!"
4
+ test: Test
5
+ very:
6
+ nasty:
7
+ nested:
8
+ bax: Bax
9
+ foo: Foo
10
+ bar: Bar
11
+ newvery:
12
+ nasty:
13
+ nested:
14
+ hi: Hi
@@ -0,0 +1,8 @@
1
+ pt:
2
+ test: Teste
3
+ old: Velho
4
+ very:
5
+ nasty:
6
+ nested:
7
+ foo: Fu
8
+ old: Velho
@@ -0,0 +1,6 @@
1
+
2
+ ---
3
+ en:
4
+ new: "Uau, isso é novo"
5
+ sync: "To Sync It!"
6
+ test: Test
@@ -0,0 +1,4 @@
1
+ en:
2
+ yup: Yes
3
+ with_colon: "Value: Rock"
4
+ normal: Normal
@@ -0,0 +1,3 @@
1
+ pt:
2
+ yup: Sim
3
+ nope: Não
@@ -0,0 +1,4 @@
1
+
2
+ en:
3
+ something: Something
4
+ another: Another
@@ -0,0 +1,3 @@
1
+
2
+ pt:
3
+ something: Algo
@@ -0,0 +1,3 @@
1
+ en:
2
+ blue: Blue
3
+ alpha: Alpha
@@ -0,0 +1,4 @@
1
+ pt:
2
+ zebra: Zebra
3
+ blue: Azul
4
+ alpha: Alfa
@@ -0,0 +1,6 @@
1
+
2
+ ---
3
+ pt:
4
+ new: "Uau, isso é novo"
5
+ sync: "To Sync It!"
6
+ test: Teste
@@ -0,0 +1,16 @@
1
+
2
+ ---
3
+ en:
4
+ another: Another
5
+ newone: "New One!"
6
+ newvery:
7
+ nasty:
8
+ nested:
9
+ hi: Hi
10
+ test: Test
11
+ very:
12
+ nasty:
13
+ nested:
14
+ bar: Bar
15
+ bax: Bax
16
+ foo: Foo
@@ -0,0 +1,16 @@
1
+
2
+ ---
3
+ pt:
4
+ another: Another
5
+ newone: "New One!"
6
+ newvery:
7
+ nasty:
8
+ nested:
9
+ hi: Hi
10
+ test: Teste
11
+ very:
12
+ nasty:
13
+ nested:
14
+ bar: Bar
15
+ bax: Bax
16
+ foo: Fu
@@ -0,0 +1,5 @@
1
+ # Comment cool
2
+
3
+ en:
4
+ sync: To Sync It!
5
+ test: Test
@@ -0,0 +1,6 @@
1
+
2
+ ---
3
+ en:
4
+ normal: Normal
5
+ with_colon: "Value: Rock"
6
+ yup: true
@@ -0,0 +1,6 @@
1
+
2
+ ---
3
+ pt:
4
+ normal: Normal
5
+ with_colon: "Value: Rock"
6
+ yup: Sim
@@ -0,0 +1,5 @@
1
+
2
+ ---
3
+ en:
4
+ another: Another
5
+ something: Something
@@ -0,0 +1,5 @@
1
+
2
+ ---
3
+ pt:
4
+ another: Another
5
+ something: Algo
@@ -0,0 +1,5 @@
1
+
2
+ ---
3
+ en:
4
+ alpha: Alpha
5
+ blue: Blue
@@ -0,0 +1,5 @@
1
+
2
+ ---
3
+ pt:
4
+ alpha: Alfa
5
+ blue: Azul
@@ -0,0 +1,5 @@
1
+
2
+ pt:
3
+ sync: To Sync It!
4
+ test: Teste
5
+ new: "Uau, isso é novo"
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: i18n-sync
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcos Piccinini
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ya2yaml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.8.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.8.0
41
+ description: Gem to sync all locale yml/rb files based on a "master" one.
42
+ email: x@nofxx.com
43
+ executables:
44
+ - i18s
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - README.md
49
+ - Rakefile
50
+ - bin/i18s
51
+ - lib/i18n/sync.rb
52
+ - lib/i18n/sync/hash.rb
53
+ - lib/i18n/sync/version.rb
54
+ - spec/fixtures/children.en.yml
55
+ - spec/fixtures/children.pt.yml
56
+ - spec/fixtures/en.yml
57
+ - spec/fixtures/extra.en.yml
58
+ - spec/fixtures/extra.pt.yml
59
+ - spec/fixtures/named.en.yml
60
+ - spec/fixtures/named.pt.yml
61
+ - spec/fixtures/order.en.yml
62
+ - spec/fixtures/order.pt.yml
63
+ - spec/fixtures/pt.yml
64
+ - spec/i18n_sync_spec.rb
65
+ - spec/results/children.pt.yml
66
+ - spec/results/extra.pt.yml
67
+ - spec/results/named.pt.yml
68
+ - spec/results/order.en.yml
69
+ - spec/spec_helper.rb
70
+ - spec/work/children.en.yml
71
+ - spec/work/children.pt.yml
72
+ - spec/work/en.yml
73
+ - spec/work/extra.en.yml
74
+ - spec/work/extra.pt.yml
75
+ - spec/work/named.en.yml
76
+ - spec/work/named.pt.yml
77
+ - spec/work/order.en.yml
78
+ - spec/work/order.pt.yml
79
+ - spec/work/pt.yml
80
+ - spec/workmulti/children.en.yml
81
+ - spec/workmulti/children.pt.yml
82
+ - spec/workmulti/en.yml
83
+ - spec/workmulti/extra.en.yml
84
+ - spec/workmulti/extra.pt.yml
85
+ - spec/workmulti/named.en.yml
86
+ - spec/workmulti/named.pt.yml
87
+ - spec/workmulti/order.en.yml
88
+ - spec/workmulti/order.pt.yml
89
+ - spec/workmulti/pt.yml
90
+ homepage: http://github.com/nofxx/i18n_sync
91
+ licenses: []
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.4.3
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Syncs all locale yml/rb files based on a "master" one.
113
+ test_files:
114
+ - spec/fixtures/children.en.yml
115
+ - spec/fixtures/children.pt.yml
116
+ - spec/fixtures/en.yml
117
+ - spec/fixtures/extra.en.yml
118
+ - spec/fixtures/extra.pt.yml
119
+ - spec/fixtures/named.en.yml
120
+ - spec/fixtures/named.pt.yml
121
+ - spec/fixtures/order.en.yml
122
+ - spec/fixtures/order.pt.yml
123
+ - spec/fixtures/pt.yml
124
+ - spec/i18n_sync_spec.rb
125
+ - spec/results/children.pt.yml
126
+ - spec/results/extra.pt.yml
127
+ - spec/results/named.pt.yml
128
+ - spec/results/order.en.yml
129
+ - spec/spec_helper.rb
130
+ has_rdoc: