google_spreadsheet2yml 0.1.3 → 0.1.4
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.md +12 -4
- data/lib/google_spreadsheet2yml/version.rb +1 -1
- data/lib/tasks/google_spreadsheet2yml.rake +3 -1
- metadata +2 -2
data/README.md
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# GoogleSpreadsheet2yml
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is a little gem that allows for easy management of Google
|
|
4
|
+
Spreadsheets translations - it converts each column to corresponding
|
|
5
|
+
language taking the first row for each column as tha name of the
|
|
6
|
+
translation/locale. (i.e. en.gdoc.yml de.gdoc.yml pl.gdoc.yml)
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
7
10
|
Add this line to your application's Gemfile:
|
|
8
11
|
|
|
9
|
-
gem '
|
|
12
|
+
gem 'google_spreadsheet2yml'
|
|
10
13
|
|
|
11
14
|
And then execute:
|
|
12
15
|
|
|
@@ -14,11 +17,16 @@ And then execute:
|
|
|
14
17
|
|
|
15
18
|
Or install it yourself as:
|
|
16
19
|
|
|
17
|
-
$ gem install
|
|
20
|
+
$ gem install google_spreadsheet2yml
|
|
18
21
|
|
|
19
22
|
## Usage
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
Insert 'google_doc_translations_config.yml' file into 'config' directory
|
|
25
|
+
of your Rails application - below is a content it should have:
|
|
26
|
+
|
|
27
|
+
google_user_id: user
|
|
28
|
+
google_password: password
|
|
29
|
+
google_spreedsheet_to_process: 'xxxxxxxxxxxxxxxx'
|
|
22
30
|
|
|
23
31
|
## Contributing
|
|
24
32
|
|
|
@@ -47,7 +47,9 @@ namespace :gs2yml do
|
|
|
47
47
|
languages.keys.each do |lang|
|
|
48
48
|
hash = Hash.new
|
|
49
49
|
(2..ws.num_rows).each do |row|
|
|
50
|
-
|
|
50
|
+
unless ws[row, 1].blank? || ws[row, languages[lang]].blank?
|
|
51
|
+
hash.store([lang, ws[row, 1].strip.rstrip].join('.'), ws[row, languages[lang]].strip.rstrip)
|
|
52
|
+
end
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
File.open("./config/locales/#{lang}.gdocs.yml", 'w') {|f| f.write(GoogleSpreadsheet2yml.create_yaml(hash)) }
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google_spreadsheet2yml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
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: 2012-05-
|
|
12
|
+
date: 2012-05-21 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: google-spreadsheet-ruby
|