bisu 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -3
- data/Gemfile.lock +3 -1
- data/README.md +37 -10
- data/README_explanation.png +0 -0
- data/Rakefile +6 -5
- data/lib/bisu/localizer.rb +2 -0
- data/lib/bisu/version.rb +2 -2
- data/spec/lib/bisu/localizer_spec.rb +5 -0
- data/spec/lib/bisu/source/one_sky_spec.rb +1 -1
- metadata +5 -3
- data/.gitignore +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20a1701ab5eb80ac795d51e1b1366b5ef2a69ba
|
4
|
+
data.tar.gz: 77b52f74cfff624fb03af1ff444220ef77b65c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f5959e04a70095f5307a23e0ea61819394c8cdad2f499698acb9285719eb71fc6d80d65bc92e5f62ee9170c4584b45f5733cb49cc21360504403247953e9a9b
|
7
|
+
data.tar.gz: c9d64bdd4c29f2facd4ca30c95dafd42a45142839116c9b591682d43c02829e4a676939bc8dd8cf4fa298fd2874ab245dfecc2165aa576e7ae1b0c76cf0a671b
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
language: ruby
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
`Bisu` adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [1.7.1](https://github.com/hole19/bisu/releases/tag/v1.7.1)
|
6
|
+
Released on 2019/03/04
|
7
|
+
|
8
|
+
#### Added
|
9
|
+
- Applies the same new line behaviour in every platform
|
10
|
+
|
5
11
|
## [1.7.0](https://github.com/hole19/bisu/releases/tag/v1.7.0)
|
6
12
|
Released on 2019/02/18
|
7
13
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,6 +7,7 @@ GEM
|
|
7
7
|
safe_yaml (~> 1.0.0)
|
8
8
|
diff-lcs (1.2.5)
|
9
9
|
hashdiff (0.3.0)
|
10
|
+
rake (12.3.2)
|
10
11
|
rspec (3.5.0)
|
11
12
|
rspec-core (~> 3.5.0)
|
12
13
|
rspec-expectations (~> 3.5.0)
|
@@ -35,6 +36,7 @@ PLATFORMS
|
|
35
36
|
|
36
37
|
DEPENDENCIES
|
37
38
|
colorize (~> 0.7)
|
39
|
+
rake
|
38
40
|
rspec
|
39
41
|
rspec-its
|
40
42
|
safe_yaml (~> 1.0)
|
@@ -45,4 +47,4 @@ RUBY VERSION
|
|
45
47
|
ruby 2.3.1p112
|
46
48
|
|
47
49
|
BUNDLED WITH
|
48
|
-
1.
|
50
|
+
1.17.2
|
data/README.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
Bisu 홀
|
2
2
|
========
|
3
3
|
|
4
|
+
[![Status](https://travis-ci.org/hole19/bisu.svg?branch=master)](https://travis-ci.org/hole19/bisu?branch=master)
|
5
|
+
[![Gem](https://img.shields.io/gem/v/bisu.svg?style=flat)](http://rubygems.org/gems/bisu "View this project in Rubygems")
|
6
|
+
|
4
7
|
Bisu manages your app iOS, Android and RoR localization files for you. No more copy+paste induced errors!
|
5
8
|
|
6
|
-
|
9
|
+
<p align="center">
|
10
|
+
<img src="https://raw.githubusercontent.com/hole19/bisu/master/README_explanation.png" width="500">
|
11
|
+
</p>
|
7
12
|
|
8
13
|
Instalation
|
9
14
|
-----
|
@@ -21,7 +26,7 @@ Usage
|
|
21
26
|
|
22
27
|
*given that someone already configured Bisu
|
23
28
|
|
24
|
-
|
29
|
+
Setup your configuration file
|
25
30
|
-----
|
26
31
|
|
27
32
|
1. Create in your project base folder a translatable.yml:
|
@@ -30,9 +35,7 @@ Configuration
|
|
30
35
|
type: <iOS|Android|RoR>
|
31
36
|
|
32
37
|
dictionary:
|
33
|
-
|
34
|
-
sheet_id: <GOOGLE-DRIVE-SHEET-ID>
|
35
|
-
keys_column: <GOOGLE-DRIVE-KEY-COLUMN-TITLE>
|
38
|
+
(see options below)
|
36
39
|
|
37
40
|
translate:
|
38
41
|
- in: path/to/1st/file.translatable
|
@@ -50,14 +53,30 @@ Configuration
|
|
50
53
|
language: pt
|
51
54
|
```
|
52
55
|
|
53
|
-
|
56
|
+
##### Dictionary from a URL source:
|
57
|
+
|
54
58
|
```
|
55
59
|
dictionary:
|
56
60
|
type: url
|
57
61
|
url: <A-GET-URL>
|
58
62
|
```
|
59
63
|
|
60
|
-
|
64
|
+
##### Google Sheets Dictionary:
|
65
|
+
|
66
|
+
1. First ["Publish to the web"](https://www.google.com/search?q=google+sheets+publish+to+web) your Google Sheet
|
67
|
+
1. Share only the sheet that contains the translations
|
68
|
+
1. First column should contain the translation keys
|
69
|
+
1. First row should contain the locale for each language
|
70
|
+
|
71
|
+
```
|
72
|
+
dictionary:
|
73
|
+
type: google_sheet
|
74
|
+
sheet_id: <GOOGLE-DRIVE-SHEET-ID>
|
75
|
+
keys_column: <GOOGLE-DRIVE-KEY-COLUMN-TITLE>
|
76
|
+
```
|
77
|
+
|
78
|
+
##### OneSky integration:
|
79
|
+
|
61
80
|
```
|
62
81
|
dictionary:
|
63
82
|
type: one_sky
|
@@ -67,7 +86,13 @@ Configuration
|
|
67
86
|
file_name: <ONE-SKY-FILE-NAME>
|
68
87
|
```
|
69
88
|
|
70
|
-
|
89
|
+
Create translation templates
|
90
|
+
-----
|
91
|
+
|
92
|
+
Create a \*.translatable version for your platform specific localization files:
|
93
|
+
|
94
|
+
##### iOS
|
95
|
+
*example: Localizable.strings.translatable*
|
71
96
|
|
72
97
|
```
|
73
98
|
// $specialKComment1$
|
@@ -85,7 +110,8 @@ Configuration
|
|
85
110
|
"klRequestName" = "$kRequestName%{user_name: %@}$";
|
86
111
|
```
|
87
112
|
|
88
|
-
|
113
|
+
##### Android
|
114
|
+
*example: strings.xml.translatable*
|
89
115
|
|
90
116
|
```
|
91
117
|
<?xml version="1.0" encoding="utf-8"?>
|
@@ -102,7 +128,8 @@ Configuration
|
|
102
128
|
</resources>
|
103
129
|
```
|
104
130
|
|
105
|
-
|
131
|
+
##### Ruby on Rails
|
132
|
+
*example: config/locales/yml.translatable*
|
106
133
|
|
107
134
|
```
|
108
135
|
$specialKLocale$:
|
Binary file
|
data/Rakefile
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require "rake"
|
2
|
+
require "rspec/core/rake_task"
|
2
3
|
|
3
|
-
|
4
|
-
t.
|
4
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
5
|
+
t.pattern = Dir.glob("spec/**/*_spec.rb")
|
6
|
+
t.rspec_opts = "--format documentation"
|
5
7
|
end
|
6
8
|
|
7
|
-
|
8
|
-
task :default => :test
|
9
|
+
task default: :spec
|
data/lib/bisu/localizer.rb
CHANGED
data/lib/bisu/version.rb
CHANGED
@@ -8,6 +8,8 @@ describe Bisu::Localizer do
|
|
8
8
|
"kTranslationKey2" => "Naaada!",
|
9
9
|
"k1ParameterKey" => "Não sabes nada %{name}",
|
10
10
|
"k2ParametersKey" => "Sabes %{perc} por cento %{name}",
|
11
|
+
"kNewLineSingle" => "Não sabes nada\nJoão das Neves",
|
12
|
+
"kNewLineMultiple" => "Não sabes nada\\nJoão das Neves",
|
11
13
|
|
12
14
|
# type dependent translations
|
13
15
|
"kDoubleQuoted" => "Não sabes nada \"João das Neves\"",
|
@@ -52,6 +54,9 @@ describe Bisu::Localizer do
|
|
52
54
|
it { translates("2 parameters: $k2ParametersKey{perc:%2$d, name:%1$s}$", to: "2 parameters: Sabes %2$d por cento %1$s") }
|
53
55
|
it { translates("2 parameters: $k2ParametersKey{name:%1$s, perc:%2$d}$", to: "2 parameters: Sabes %2$d por cento %1$s") }
|
54
56
|
|
57
|
+
it { translates("$kNewLineSingle$", to: "Não sabes nada\\nJoão das Neves") }
|
58
|
+
it { translates("$kNewLineMultiple$", to: "Não sabes nada\\nJoão das Neves") }
|
59
|
+
|
55
60
|
# type dependent translations
|
56
61
|
|
57
62
|
it { translates("$kDoubleQuoted$", to: expected[:double_quoted]) }
|
@@ -45,7 +45,7 @@ describe Bisu::Source::OneSky do
|
|
45
45
|
expect(to_i18).to eq({
|
46
46
|
"en" => {
|
47
47
|
"kRegularNewLine" => "This is the first line\\nthis is the second line",
|
48
|
-
"kErrorNewLine"
|
48
|
+
"kErrorNewLine" => "This is the first line\\nthis is the second line"
|
49
49
|
}
|
50
50
|
})
|
51
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bisu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joaoffcosta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -74,12 +74,14 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- ".gitignore"
|
78
77
|
- ".rspec"
|
78
|
+
- ".ruby-version"
|
79
|
+
- ".travis.yml"
|
79
80
|
- CHANGELOG.md
|
80
81
|
- Gemfile
|
81
82
|
- Gemfile.lock
|
82
83
|
- README.md
|
84
|
+
- README_explanation.png
|
83
85
|
- Rakefile
|
84
86
|
- bin/bisu
|
85
87
|
- bisu.gemspec
|
data/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
.ruby-version
|