bisu 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/bisu.gemspec +8 -7
- data/lib/bisu/translator.rb +13 -15
- metadata +19 -6
- data/bisu.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779b8f363ffac6207680dc2b864af0390cfbb4b4
|
4
|
+
data.tar.gz: daf6c6d72e098f49b00bc5f444fad687a5231e0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78d3e5537d243ae91c1228b69580cfae4d9048f5a03bfd9939de1218bff2bb31b848d980731f1bf83541ca84eb9ee442dbb75c791fd07cd9bb19eea6e7c821bb
|
7
|
+
data.tar.gz: cfd985d6a7c96e1bf6cb6568e42b60d2bfe0ebbd19b8f15288d9e214739cee5d0a1c03e0b8e5007aa9fb76ba1aeb4e364a0c0dfa4516b08544487ed19cd10ede
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
H19-Bisu
|
1
|
+
H19-Bisu 홀
|
2
2
|
========
|
3
3
|
|
4
4
|
Bisu manages your app iOS and Android localization files for you. No more copy+paste induced errors!
|
@@ -7,9 +7,11 @@ Bisu manages your app iOS and Android localization files for you. No more copy+p
|
|
7
7
|
|
8
8
|
Instalation
|
9
9
|
-----
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
|
11
|
+
```
|
12
|
+
curl -o bisu.gem 'https://github.com/hole19/h19-bisu/blob/master/bisu.gem?raw=true'
|
13
|
+
gem install bisu.gem
|
14
|
+
```
|
13
15
|
|
14
16
|
Usage
|
15
17
|
-----
|
@@ -42,7 +44,7 @@ Configuration
|
|
42
44
|
folder: path/to/ko.lproj/
|
43
45
|
```
|
44
46
|
|
45
|
-
1.
|
47
|
+
1. Create a \*.translatable version for your **iOS** localization files:
|
46
48
|
|
47
49
|
```
|
48
50
|
// $specialKComment1$
|
@@ -59,7 +61,7 @@ Configuration
|
|
59
61
|
"klGeneral_Close" = "$kClose$";
|
60
62
|
```
|
61
63
|
|
62
|
-
1.
|
64
|
+
1. Create a \*.translatable version for your **Android** localization files:
|
63
65
|
|
64
66
|
```
|
65
67
|
<?xml version="1.0" encoding="utf-8"?>
|
data/bisu.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'bisu'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.1'
|
4
4
|
s.date = '2015-01-28'
|
5
|
-
s.summary = '
|
6
|
-
s.description = 'Bisu
|
5
|
+
s.summary = 'A localization automation service'
|
6
|
+
s.description = 'Bisu manages your app iOS and Android localization files for you. No more copy+paste induced errors!'
|
7
7
|
s.authors = ['joaoffcosta']
|
8
|
-
s.email = '
|
8
|
+
s.email = 'joaostacosta@gmail.com'
|
9
9
|
s.license = 'MIT'
|
10
10
|
s.homepage = 'https://github.com/hole19/h19-bisu'
|
11
11
|
|
@@ -14,8 +14,9 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.executables << 'bisu'
|
16
16
|
|
17
|
-
s.add_runtime_dependency 'safe_yaml',
|
18
|
-
s.add_runtime_dependency 'colorize',
|
19
|
-
|
17
|
+
s.add_runtime_dependency 'safe_yaml', '~> 1.0'
|
18
|
+
s.add_runtime_dependency 'colorize', '~> 0.7'
|
19
|
+
s.add_runtime_dependency 'xml-simple', '~> 1.1'
|
20
|
+
|
20
21
|
s.add_development_dependency 'webmock', '~> 1.20'
|
21
22
|
end
|
data/lib/bisu/translator.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
module Bisu
|
2
4
|
class Translator
|
3
5
|
def initialize(knowledge_base, type)
|
@@ -26,7 +28,7 @@ module Bisu
|
|
26
28
|
end
|
27
29
|
|
28
30
|
return false unless in_file = open_file(in_path, "r", true)
|
29
|
-
return false unless out_file = open_file(out_path, "w", false
|
31
|
+
return false unless out_file = open_file(out_path, "w", false)
|
30
32
|
|
31
33
|
Logger.info("Translating #{in_path} to #{language} > #{out_path}...")
|
32
34
|
|
@@ -43,21 +45,17 @@ module Bisu
|
|
43
45
|
|
44
46
|
private
|
45
47
|
|
46
|
-
def open_file(file_name, method,
|
47
|
-
if
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
elsif can_overwrite
|
55
|
-
File.open(File.expand_path(file_name), method)
|
56
|
-
|
57
|
-
elsif !should_exist
|
58
|
-
Logger.error("File #{file_name} already exists!")
|
59
|
-
nil
|
48
|
+
def open_file(file_name, method, must_exist)
|
49
|
+
if !File.file?(File.expand_path(file_name))
|
50
|
+
if must_exist
|
51
|
+
Logger.error("File #{file_name} not found!")
|
52
|
+
return nil
|
53
|
+
else
|
54
|
+
FileUtils.mkdir_p(File.dirname(file_name))
|
55
|
+
end
|
60
56
|
end
|
57
|
+
|
58
|
+
File.open(File.expand_path(file_name), method)
|
61
59
|
end
|
62
60
|
|
63
61
|
def localize(text, language)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bisu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joaoffcosta
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: xml-simple
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: webmock
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,9 +66,9 @@ dependencies:
|
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '1.20'
|
55
|
-
description: Bisu
|
56
|
-
|
57
|
-
email:
|
69
|
+
description: Bisu manages your app iOS and Android localization files for you. No
|
70
|
+
more copy+paste induced errors!
|
71
|
+
email: joaostacosta@gmail.com
|
58
72
|
executables:
|
59
73
|
- bisu
|
60
74
|
extensions: []
|
@@ -63,7 +77,6 @@ files:
|
|
63
77
|
- README.md
|
64
78
|
- Rakefile
|
65
79
|
- bin/bisu
|
66
|
-
- bisu.gem
|
67
80
|
- bisu.gemspec
|
68
81
|
- lib/bisu.rb
|
69
82
|
- lib/bisu/config.rb
|
@@ -101,5 +114,5 @@ rubyforge_project:
|
|
101
114
|
rubygems_version: 2.2.2
|
102
115
|
signing_key:
|
103
116
|
specification_version: 4
|
104
|
-
summary:
|
117
|
+
summary: A localization automation service
|
105
118
|
test_files: []
|
data/bisu.gem
DELETED
Binary file
|