babelish 0.6.0 → 0.6.3
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.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/babelish.rb +1 -0
- data/lib/babelish/google_doc.rb +5 -2
- data/lib/babelish/keys.rb +6 -0
- data/lib/babelish/version.rb +1 -1
- metadata +5 -59
- data/.babelish.sample +0 -35
- data/.gitignore +0 -31
- data/.hound.yml +0 -4
- data/.travis.yml +0 -15
- data/CONTRIBUTING.md +0 -12
- data/Dockerfile +0 -6
- data/Gemfile +0 -8
- data/Rakefile +0 -17
- data/babelish.gemspec +0 -42
- data/test/babelish/commands/test_command_android2csv.rb +0 -60
- data/test/babelish/commands/test_command_csv2android.rb +0 -50
- data/test/babelish/commands/test_command_csv2strings.rb +0 -139
- data/test/babelish/commands/test_command_strings2csv.rb +0 -110
- data/test/babelish/test_android2csv.rb +0 -53
- data/test/babelish/test_base2csv.rb +0 -43
- data/test/babelish/test_bins.rb +0 -32
- data/test/babelish/test_commandline.rb +0 -127
- data/test/babelish/test_csv2android.rb +0 -72
- data/test/babelish/test_csv2base.rb +0 -44
- data/test/babelish/test_csv2json.rb +0 -27
- data/test/babelish/test_csv2php.rb +0 -27
- data/test/babelish/test_csv2strings.rb +0 -154
- data/test/babelish/test_fastlane.rb +0 -19
- data/test/babelish/test_json2csv.rb +0 -34
- data/test/babelish/test_php2csv.rb +0 -73
- data/test/babelish/test_strings2csv.rb +0 -147
- data/test/babelish/test_xcode_macros.rb +0 -112
- data/test/data/android-en.xml +0 -9
- data/test/data/android-fr.xml +0 -9
- data/test/data/android.xml +0 -9
- data/test/data/android_special_chars.csv +0 -8
- data/test/data/android_special_chars.xml +0 -12
- data/test/data/android_special_chars_test_result.xml +0 -10
- data/test/data/genstrings.strings +0 -0
- data/test/data/json.json +0 -6
- data/test/data/php_lang.php +0 -8
- data/test/data/test_comments.strings +0 -2
- data/test/data/test_data.csv +0 -3
- data/test/data/test_data.strings +0 -2
- data/test/data/test_data_fr_with_comments.strings +0 -6
- data/test/data/test_data_fr_with_comments.xml +0 -9
- data/test/data/test_data_multiple_langs.csv +0 -3
- data/test/data/test_data_with_comments.csv +0 -3
- data/test/data/test_data_with_percent.csv +0 -3
- data/test/data/test_data_with_percent_space.csv +0 -4
- data/test/data/test_data_with_semicolon.csv +0 -3
- data/test/data/test_data_with_spaces.csv +0 -3
- data/test/data/test_en.strings +0 -2
- data/test/data/test_fr.strings +0 -2
- data/test/data/test_space.strings +0 -10
- data/test/data/test_utf16.strings +0 -0
- data/test/data/test_with_nil.csv +0 -3
- data/test/data/test_with_nil.strings +0 -4
- data/test/data/xcode_empty.strings +0 -7
- data/test/test_helper.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 860bb202fa9b40c71a14e8182471b4b5eba33f7c38cfea1840e25781c22119dd
|
4
|
+
data.tar.gz: 7603ad25960a827f2689d9dc2c284b4fa1dd08cdaa8d777b7bd32b694f3df5f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47bc840b613d58cd1720e29841ecccbda9d7bc7ae7ad4c56167322a4a7b2c03019ee73ffdca3bbdbfca4f15f534924c8ec2ce29dc6201d38046402580acc7ab4
|
7
|
+
data.tar.gz: 5d747bde970418a27a5b1abc3259843b96d916d57d7cafbcc15e3ed48b46072e161ce69e93aa2da96e24502077b3ac1c1f091b9b837fcd3b6c9ace5dd80f9968
|
data/README.md
CHANGED
data/lib/babelish.rb
CHANGED
data/lib/babelish/google_doc.rb
CHANGED
@@ -43,14 +43,17 @@ module Babelish
|
|
43
43
|
|
44
44
|
def authenticate
|
45
45
|
# will try to get token and store in file below
|
46
|
-
@session = GoogleDrive.saved_session
|
46
|
+
@session = GoogleDrive.saved_session(".babelish.token",
|
47
|
+
nil,
|
48
|
+
Babelish::Keys::GOOGLE_DRIVE_CLIENT_ID,
|
49
|
+
Babelish::Keys::GOOGLE_DRIVE_CLIENT_SECRET)
|
47
50
|
end
|
48
51
|
|
49
52
|
def file_with_name(name)
|
50
53
|
unless @session
|
51
54
|
authenticate
|
52
55
|
end
|
53
|
-
@session.
|
56
|
+
@session.file_by_title(name)
|
54
57
|
end
|
55
58
|
end
|
56
59
|
end
|
data/lib/babelish/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babelish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- François Benaiteau
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 3.0.3
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 3.0.3
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: nokogiri
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,17 +165,8 @@ executables:
|
|
165
165
|
extensions: []
|
166
166
|
extra_rdoc_files: []
|
167
167
|
files:
|
168
|
-
- ".babelish.sample"
|
169
|
-
- ".gitignore"
|
170
|
-
- ".hound.yml"
|
171
|
-
- ".travis.yml"
|
172
|
-
- CONTRIBUTING.md
|
173
|
-
- Dockerfile
|
174
|
-
- Gemfile
|
175
168
|
- LICENSE.txt
|
176
169
|
- README.md
|
177
|
-
- Rakefile
|
178
|
-
- babelish.gemspec
|
179
170
|
- bin/babelish
|
180
171
|
- lib/babelish.rb
|
181
172
|
- lib/babelish/android2csv.rb
|
@@ -188,57 +179,12 @@ files:
|
|
188
179
|
- lib/babelish/csv2strings.rb
|
189
180
|
- lib/babelish/google_doc.rb
|
190
181
|
- lib/babelish/json2csv.rb
|
182
|
+
- lib/babelish/keys.rb
|
191
183
|
- lib/babelish/language.rb
|
192
184
|
- lib/babelish/php2csv.rb
|
193
185
|
- lib/babelish/strings2csv.rb
|
194
186
|
- lib/babelish/version.rb
|
195
187
|
- lib/babelish/xcode_macros.rb
|
196
|
-
- test/babelish/commands/test_command_android2csv.rb
|
197
|
-
- test/babelish/commands/test_command_csv2android.rb
|
198
|
-
- test/babelish/commands/test_command_csv2strings.rb
|
199
|
-
- test/babelish/commands/test_command_strings2csv.rb
|
200
|
-
- test/babelish/test_android2csv.rb
|
201
|
-
- test/babelish/test_base2csv.rb
|
202
|
-
- test/babelish/test_bins.rb
|
203
|
-
- test/babelish/test_commandline.rb
|
204
|
-
- test/babelish/test_csv2android.rb
|
205
|
-
- test/babelish/test_csv2base.rb
|
206
|
-
- test/babelish/test_csv2json.rb
|
207
|
-
- test/babelish/test_csv2php.rb
|
208
|
-
- test/babelish/test_csv2strings.rb
|
209
|
-
- test/babelish/test_fastlane.rb
|
210
|
-
- test/babelish/test_json2csv.rb
|
211
|
-
- test/babelish/test_php2csv.rb
|
212
|
-
- test/babelish/test_strings2csv.rb
|
213
|
-
- test/babelish/test_xcode_macros.rb
|
214
|
-
- test/data/android-en.xml
|
215
|
-
- test/data/android-fr.xml
|
216
|
-
- test/data/android.xml
|
217
|
-
- test/data/android_special_chars.csv
|
218
|
-
- test/data/android_special_chars.xml
|
219
|
-
- test/data/android_special_chars_test_result.xml
|
220
|
-
- test/data/genstrings.strings
|
221
|
-
- test/data/json.json
|
222
|
-
- test/data/php_lang.php
|
223
|
-
- test/data/test_comments.strings
|
224
|
-
- test/data/test_data.csv
|
225
|
-
- test/data/test_data.strings
|
226
|
-
- test/data/test_data_fr_with_comments.strings
|
227
|
-
- test/data/test_data_fr_with_comments.xml
|
228
|
-
- test/data/test_data_multiple_langs.csv
|
229
|
-
- test/data/test_data_with_comments.csv
|
230
|
-
- test/data/test_data_with_percent.csv
|
231
|
-
- test/data/test_data_with_percent_space.csv
|
232
|
-
- test/data/test_data_with_semicolon.csv
|
233
|
-
- test/data/test_data_with_spaces.csv
|
234
|
-
- test/data/test_en.strings
|
235
|
-
- test/data/test_fr.strings
|
236
|
-
- test/data/test_space.strings
|
237
|
-
- test/data/test_utf16.strings
|
238
|
-
- test/data/test_with_nil.csv
|
239
|
-
- test/data/test_with_nil.strings
|
240
|
-
- test/data/xcode_empty.strings
|
241
|
-
- test/test_helper.rb
|
242
188
|
homepage: http://netbe.github.io/Babelish/
|
243
189
|
licenses:
|
244
190
|
- MIT
|
data/.babelish.sample
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# This is a sample configuration file
|
2
|
-
|
3
|
-
###################################### Base2CSV ######################################
|
4
|
-
|
5
|
-
## required, location of strings files (FILENAMES)
|
6
|
-
filenames: ["test/data/test_en.strings", "test/data/test_fr.strings"]
|
7
|
-
|
8
|
-
## optional
|
9
|
-
# headers: ["Constants", "English", "French"] # override headers of columns, default is name of input files and 'Variables' for reference
|
10
|
-
# csv_filename: "testconfig.csv" # location of output file
|
11
|
-
# dryrun: true # prints out content of hash without writing file
|
12
|
-
|
13
|
-
###################################### CSV2Base ######################################
|
14
|
-
|
15
|
-
## required
|
16
|
-
filename: test/data/test_data.csv # CSV file (CSV_FILENAME) to convert from or name of file in Google Drive
|
17
|
-
langs: # Languages to convert. i.e. English:en
|
18
|
-
English: "en"
|
19
|
-
|
20
|
-
## optional
|
21
|
-
# fetch: true # set to true to get file(filename) from google drive
|
22
|
-
# excluded_states: ["Images", "Xib"] # Exclude rows with given state
|
23
|
-
# comments_column: 4 # Position of column for comments if any
|
24
|
-
# state_column: 3 # Position of column for state if any
|
25
|
-
# keys_column: 0 # Position of column for keys
|
26
|
-
# default_lang: "English" # Header name of column containing fallback value if value is empty
|
27
|
-
# output_dir: "resources/" # Path of output files
|
28
|
-
# output_basenames: # Basename of output files
|
29
|
-
# - Localizable
|
30
|
-
# - info
|
31
|
-
# ignore_lang_path: true # does not care about lang component path. i.e: en.lproj/
|
32
|
-
# sheet: 0 # Index of worksheet to download. First index is 0.
|
33
|
-
# macros_filename: Babelish.h # File to output the defines of localized strings
|
34
|
-
# stripping: false # Strips values inside the spreadsheet
|
35
|
-
# csv_separator: ',' # CSV column separator character, uses ',' by default
|
data/.gitignore
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# Generated files
|
2
|
-
/*.csv
|
3
|
-
/*.strings
|
4
|
-
*.lproj
|
5
|
-
*.gem
|
6
|
-
*~
|
7
|
-
*#
|
8
|
-
#*#
|
9
|
-
|
10
|
-
# Config file
|
11
|
-
.babelish
|
12
|
-
.babelish.token
|
13
|
-
|
14
|
-
# SimpleCov
|
15
|
-
coverage
|
16
|
-
|
17
|
-
# ignore Gemfile.lock as http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
|
18
|
-
# this should solve the fastercsv issue
|
19
|
-
Gemfile.lock
|
20
|
-
|
21
|
-
# Ruby package manager files
|
22
|
-
.ruby-version
|
23
|
-
.rbenv-version
|
24
|
-
.rvmrc
|
25
|
-
|
26
|
-
# Sublime Text
|
27
|
-
*.sublime-workspace
|
28
|
-
*.sublime-project
|
29
|
-
|
30
|
-
doc
|
31
|
-
.yardoc
|
data/.hound.yml
DELETED
data/.travis.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
rvm:
|
4
|
-
- 2.1.0
|
5
|
-
- 2.2
|
6
|
-
- 2.3.1
|
7
|
-
deploy:
|
8
|
-
provider: rubygems
|
9
|
-
api_key:
|
10
|
-
secure: Xjq+v+jEU6wK4BtyfnV1elegNcxK6Ah/O99Sn9c2IlkCmJ1wxLBouqzEiSorSJ4IOMa5H2y3gwo5GXOr6Y7d8huyGrPuBeCSGqAmH77wNCIv7G+jnLiYb1sRZbtKcPW2QaN6JF81qDIelwyspMfo6/ug1qN1x323UaxZl7f7nUE=
|
11
|
-
gem: babelish
|
12
|
-
on:
|
13
|
-
tags: true
|
14
|
-
repo: netbe/Babelish
|
15
|
-
all_branches: true
|
data/CONTRIBUTING.md
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
Want to add another support for a new format or/and usage? Add a new feature? Fix a bug?
|
4
|
-
|
5
|
-
1. Create a pull request with a branch like `feature/<nameofbranch>` or `hotfix/<nameofbranch>`.
|
6
|
-
2. Don't forget to explain the issue or the benefits of the feature you want to be merged.
|
7
|
-
3. Write unit tests covering the feature and/or fix the ones the feature/issue breaks.
|
8
|
-
|
9
|
-
And in any case feel free to ask for help in any of those steps.
|
10
|
-
|
11
|
-
|
12
|
-
|
data/Dockerfile
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'yard'
|
4
|
-
|
5
|
-
Rake::TestTask.new do |t|
|
6
|
-
t.libs << "test"
|
7
|
-
t.test_files = FileList['test/babelish/**/test_*.rb']
|
8
|
-
# t.warning = true
|
9
|
-
t.verbose = true
|
10
|
-
end
|
11
|
-
|
12
|
-
YARD::Rake::YardocTask.new do |t|
|
13
|
-
t.files = ['lib/**/*.rb']
|
14
|
-
# t.options = ['--any', '--extra', '--opts']
|
15
|
-
end
|
16
|
-
|
17
|
-
task :default => :test
|
data/babelish.gemspec
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'babelish/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = 'babelish'
|
8
|
-
s.version = Babelish::VERSION
|
9
|
-
s.date = Time.now.strftime("%Y-%m-%d")
|
10
|
-
s.summary = "CSV converter for localization files"
|
11
|
-
s.description = "This set of commands converts a CSV file to the following formats:
|
12
|
-
- .strings (iOS)
|
13
|
-
- .xml (Android)
|
14
|
-
- .json
|
15
|
-
- .php"
|
16
|
-
s.authors = ["François Benaiteau", "Markus Paeschke"]
|
17
|
-
s.email = ['francois.benaiteau@gmail.com', 'markus.paeschke@gmail.com']
|
18
|
-
s.homepage = 'http://netbe.github.io/Babelish/'
|
19
|
-
s.license = 'MIT'
|
20
|
-
|
21
|
-
s.add_dependency "thor"
|
22
|
-
|
23
|
-
s.add_dependency "google_drive", "~> 3.0"
|
24
|
-
s.add_dependency "nokogiri"
|
25
|
-
# google_drive dependency to ask for mail and password
|
26
|
-
s.add_dependency "highline"
|
27
|
-
|
28
|
-
# specify version of rack so works on ruby <2.2.2
|
29
|
-
s.add_dependency "rack", ">= 1.6.11"
|
30
|
-
# json support
|
31
|
-
s.add_dependency "json"
|
32
|
-
|
33
|
-
s.add_development_dependency "rake"
|
34
|
-
s.add_development_dependency "test-unit"
|
35
|
-
s.add_development_dependency "simplecov"
|
36
|
-
s.add_development_dependency "yard"
|
37
|
-
|
38
|
-
s.files = `git ls-files`.split("\n")
|
39
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
40
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
41
|
-
s.require_path = 'lib'
|
42
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
class TestAndroid2CSVCommand < Test::Unit::TestCase
|
3
|
-
def test_android2csv
|
4
|
-
options = {:filenames => ["test/data/android.xml"]}
|
5
|
-
Commandline.new([], options).android2csv
|
6
|
-
|
7
|
-
assert File.exist?("translations.csv")
|
8
|
-
|
9
|
-
# clean up
|
10
|
-
system("rm -f translations.csv")
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_android2csv_with_dryrun_option
|
14
|
-
options = {:filenames => ["test/data/android.xml"], :dryrun => true}
|
15
|
-
Commandline.new([], options).android2csv
|
16
|
-
|
17
|
-
assert !File.exist?("translations.csv")
|
18
|
-
|
19
|
-
# clean up
|
20
|
-
system("rm -f translations.csv")
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_android2csv_with_output_file
|
24
|
-
options = {:filenames => ["test/data/android.xml"], :csv_filename => "myfile.csv"}
|
25
|
-
# -i, -o
|
26
|
-
Commandline.new([], options).android2csv
|
27
|
-
|
28
|
-
assert File.exist?("myfile.csv")
|
29
|
-
|
30
|
-
# clean up
|
31
|
-
system("rm -f myfile.csv")
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_android2csv_with_headers
|
35
|
-
options = {:filenames => ["test/data/android.xml"], :headers => ["constants", "english"]}
|
36
|
-
# -i, -h
|
37
|
-
Commandline.new([], options).android2csv
|
38
|
-
|
39
|
-
#TODO assertion or move test on at lib level
|
40
|
-
|
41
|
-
# clean up
|
42
|
-
system("rm -f translations.csv")
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_android2csv_with_two_files
|
46
|
-
options = {
|
47
|
-
:filenames => ["test/data/android-en.xml", "test/data/android-fr.xml"],
|
48
|
-
:headers => %w{Constants English French},
|
49
|
-
:csv_filename => "enfr.csv"
|
50
|
-
}
|
51
|
-
# --filenames, --headers, -o
|
52
|
-
Commandline.new([], options).android2csv
|
53
|
-
|
54
|
-
#TODO assertion
|
55
|
-
|
56
|
-
# clean up
|
57
|
-
system("rm -f enfr.csv")
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
class TestCSV2AndroidCommand < Test::Unit::TestCase
|
3
|
-
|
4
|
-
def test_csv2android_with_multiple_2_languages
|
5
|
-
options = {
|
6
|
-
:filename => "test/data/test_data_multiple_langs.csv",
|
7
|
-
:langs => {"English" => "en", "French" => "fr"}
|
8
|
-
}
|
9
|
-
Commandline.new([], options).csv2android
|
10
|
-
|
11
|
-
assert File.exist?("./values-en/strings.xml")
|
12
|
-
assert File.exist?("./values-fr/strings.xml")
|
13
|
-
|
14
|
-
# clean up
|
15
|
-
system("rm -rf ./values-en/")
|
16
|
-
system("rm -rf ./values-fr/")
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_csv2android_with_multiple_2_languages_with_region
|
20
|
-
options = {
|
21
|
-
:filename => "test/data/test_data_multiple_langs.csv",
|
22
|
-
:langs => {"English" => "en-US", "French" => "fr"}
|
23
|
-
}
|
24
|
-
Commandline.new([], options).csv2android
|
25
|
-
|
26
|
-
assert File.exist?("./values-en-rUS/strings.xml")
|
27
|
-
assert File.exist?("./values-fr/strings.xml")
|
28
|
-
|
29
|
-
# clean up
|
30
|
-
system("rm -rf ./values-en-rUS/")
|
31
|
-
system("rm -rf ./values-fr/")
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_csv2android_with_output_dir
|
35
|
-
options = {
|
36
|
-
:filename => "test/data/test_data_multiple_langs.csv",
|
37
|
-
:langs => {"English" => "en", "French" => "fr"},
|
38
|
-
:output_dir => "mynewlocation"
|
39
|
-
}
|
40
|
-
|
41
|
-
Commandline.new([], options).csv2android
|
42
|
-
# testing
|
43
|
-
assert File.exist?("./mynewlocation/values-en/strings.xml"), "can't find output file for English"
|
44
|
-
assert File.exist?("./mynewlocation/values-fr/strings.xml"), "can't find output file for French"
|
45
|
-
|
46
|
-
# clean up
|
47
|
-
system("rm -rf ./mynewlocation")
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|