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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bed28be32f24a03d0e812b3ad88980911bd4d13a
4
- data.tar.gz: 13f1165c2bf416965c75e24553f5f2672a91f1ec
3
+ metadata.gz: c20a1701ab5eb80ac795d51e1b1366b5ef2a69ba
4
+ data.tar.gz: 77b52f74cfff624fb03af1ff444220ef77b65c62
5
5
  SHA512:
6
- metadata.gz: 2e4ebf64ac0b36be4fa1f058347a7029a676986289a216120bc22f680c9bbcdca545660017f2da39a2a6a05f822c3cf110820ce579d8c20f149fb16257e3adc3
7
- data.tar.gz: fb3ce272578ae914ca44b785a456dec185c87435a0abba11c1debb328e2dec1909bdf2d2648b40dda9b0030d63283b28120d16ac22db95f3b2347c84e3da181f
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
@@ -5,6 +5,9 @@ gem 'safe_yaml', '~> 1.0'
5
5
  gem 'colorize', '~> 0.7'
6
6
  gem 'xml-simple', '~> 1.1'
7
7
 
8
- gem 'webmock', '~> 1.20'
9
- gem 'rspec'
10
- gem 'rspec-its'
8
+ group :test do
9
+ gem 'rake'
10
+ gem 'webmock', '~> 1.20'
11
+ gem 'rspec'
12
+ gem 'rspec-its'
13
+ end
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.14.3
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
- Configuration
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
- type: google_sheet
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
- Also available generic URL source:
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
- Also available [OneSky](https://www.oneskyapp.com) integration:
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
- 1. Create a \*.translatable version for your **iOS** localization files:
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
- 1. Create a \*.translatable version for your **Android** localization files:
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
- 1. Create a \*.translatable version for your **RoR** localization files:
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 'rake/testtask'
1
+ require "rake"
2
+ require "rspec/core/rake_task"
2
3
 
3
- Rake::TestTask.new do |t|
4
- t.libs << 'test'
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
- desc "Run tests"
8
- task :default => :test
9
+ task default: :spec
@@ -62,6 +62,8 @@ module Bisu
62
62
  end
63
63
 
64
64
  def process(text)
65
+ text = text.gsub("\n", "\\n")
66
+
65
67
  if @type.eql?(:android)
66
68
  text = text.gsub(/[']/, "\\\\\\\\'")
67
69
  text = text.gsub("...", "…")
data/lib/bisu/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bisu
2
- VERSION = '1.7.0'
3
- VERSION_UPDATED_AT = '2019-02-18'
2
+ VERSION = '1.7.1'
3
+ VERSION_UPDATED_AT = '2019-03-04'
4
4
  end
@@ -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" => "This is the first line\\nthis is the second line"
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.0
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-02-18 00:00:00.000000000 Z
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