phrasing 4.0.0rc16 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/CHANGELOG.md +37 -0
- data/Gemfile +1 -0
- data/MIT-LICENSE +0 -0
- data/README.md +2 -8
- data/Rakefile +0 -0
- data/app/assets/fonts/icomoon.dev.svg +0 -0
- data/app/assets/fonts/icomoon.eot +0 -0
- data/app/assets/fonts/icomoon.svg +0 -0
- data/app/assets/fonts/icomoon.ttf +0 -0
- data/app/assets/fonts/icomoon.woff +0 -0
- data/app/assets/images/phrasing_icon_edit_all.png +0 -0
- data/app/assets/javascripts/phrasing_engine.js +0 -0
- data/app/assets/stylesheets/phrasing_engine.css +0 -0
- data/app/controllers/phrasing_phrases_controller.rb +6 -2
- data/app/models/phrasing_phrase_version.rb +0 -0
- data/app/views/layouts/phrasing.html.haml +0 -0
- data/app/views/phrasing/_initializer.html.haml +0 -0
- data/app/views/phrasing/_menu.html.haml +0 -0
- data/app/views/phrasing/_messages.html.haml +0 -0
- data/app/views/phrasing_phrases/edit.html.haml +0 -0
- data/app/views/phrasing_phrases/help.html.haml +0 -0
- data/app/views/phrasing_phrases/index.html.haml +2 -0
- data/lib/phrasing/serializer.rb +6 -6
- data/lib/phrasing/version.rb +1 -1
- data/spec/dummy/Rakefile +0 -0
- data/spec/dummy/app/controllers/application_controller.rb +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +0 -0
- data/spec/dummy/app/helpers/phrasing_helper.rb +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +0 -0
- data/spec/dummy/config.ru +0 -0
- data/spec/dummy/config/application.rb +0 -0
- data/spec/dummy/config/boot.rb +0 -0
- data/spec/dummy/config/database.yml +0 -0
- data/spec/dummy/config/environment.rb +0 -0
- data/spec/dummy/config/environments/development.rb +0 -0
- data/spec/dummy/config/environments/production.rb +0 -0
- data/spec/dummy/config/environments/test.rb +0 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/dummy/config/initializers/inflections.rb +0 -0
- data/spec/dummy/config/initializers/mime_types.rb +1 -0
- data/spec/dummy/config/initializers/phrasing.rb +0 -0
- data/spec/dummy/config/initializers/secret_token.rb +0 -0
- data/spec/dummy/config/initializers/session_store.rb +0 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -0
- data/spec/dummy/config/locales/en.yml +0 -0
- data/spec/dummy/db/.gitkeep +0 -0
- data/spec/dummy/db/migrate/20131120000855_create_phrasing_phrases.phrasing_rails_engine.rb +0 -0
- data/spec/dummy/db/migrate/20131120000856_create_phrasing_phrase_versions.phrasing_rails_engine.rb +0 -0
- data/spec/dummy/public/404.html +0 -0
- data/spec/dummy/public/422.html +0 -0
- data/spec/dummy/public/500.html +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/phrasing_phrases.rb +0 -0
- data/spec/lib/phrasing_serializer_spec.rb +3 -3
- data/spec/models/phrasing_phrase_spec.rb +0 -0
- metadata +5 -6
- data/4.0.0_changes.md +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac71c985745a5d8d7ee591a4961f984c93c38e6e
|
4
|
+
data.tar.gz: c08b20fe85f8d0f79c065a686c4781ff4d18bfac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814529d02b1759ae377698ec1377c53bc503933d6c43bb5bc664482eb0ec36ac9566f5642eba588e6ee233d93934895bfac35cfe6dd115838a04c6667a8925e4
|
7
|
+
data.tar.gz: 94f4bec1be3674a20c13960805845c7b4cdc9e9d1f6f4199f8afedbde1b0807bb23510fd25d33f1292d11d0b0e5e612c4cdcf91928ab8adf4a2b2ef343ba5f7a
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,42 @@
|
|
1
1
|
# Phrasing Change Log
|
2
2
|
|
3
|
+
## 4.0.0 (February 27th, 2018)
|
4
|
+
|
5
|
+
### Separation of I18n and Phrasing:
|
6
|
+
|
7
|
+
Phrasing no longer does monkeypatching over the I18n gem, so the I18n and Phrasings behaviors are completely separate.
|
8
|
+
When using the I18n.t() method, Phrasing will no longer copy the data from the translations file and continue to use translations from the database.
|
9
|
+
|
10
|
+
However, when using the phrase(key) method, if the key doesn't currently exist in the PhrasingPhrase table, it will do a lookup in the translations file and copy the data from there to the database.
|
11
|
+
|
12
|
+
### Interpolation
|
13
|
+
|
14
|
+
The interpolation option has been kicked out.
|
15
|
+
|
16
|
+
The problem with the interpolation option is that most clients won't understand what's happening when they see something like "Hi, my name is %{name}" once they are editing data.
|
17
|
+
|
18
|
+
If they try to erase parts of it, the developer also might end up being confused and the UI might get broken or at least ugly for some time until the developer fixes the issue.
|
19
|
+
|
20
|
+
### Loading asset dependencies
|
21
|
+
|
22
|
+
From phrasing v4.0.0rc3, add your jquery files manually:
|
23
|
+
|
24
|
+
```javascript
|
25
|
+
//= require jquery
|
26
|
+
//= require jquery_ujs
|
27
|
+
//= require phrasing
|
28
|
+
```
|
29
|
+
|
30
|
+
### Switching rake tasks with Rails generators
|
31
|
+
|
32
|
+
Since Rails comes with outofbox generators that enable easy existing file detection and similar behaviors, Phrasing 4 will use Rails generators instead of the old rake tasks.
|
33
|
+
|
34
|
+
To run the initial setup generator, just do: `rails generate phrasing`
|
35
|
+
|
36
|
+
## 3.2.10 (October 2nd, 2015)
|
37
|
+
|
38
|
+
Change order parameters in PhrasingPhrases#index to support SQLServer.
|
39
|
+
|
3
40
|
## 3.2.9 (January 7th, 2015)
|
4
41
|
|
5
42
|
Require only haml, not haml-rails.
|
data/Gemfile
CHANGED
data/MIT-LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/infinum/phrasing.png)](https://travis-ci.org/infinum/phrasing)
|
4
4
|
|
5
|
-
![Phrasing](http://www.miataturbo.net/attachments/miata-parts-sale-trade-5/74257-lots-leftovers-near-boston-archer-phrasing2-300x225-jpg?dateline=1366600534)
|
6
|
-
|
7
5
|
Phrasing is a gem for live editing phrases (copy) on websites.
|
8
6
|
|
9
|
-
**Notice:** If using Phrasing version 3, checkout the [old README](https://github.com/infinum/phrasing/blob/new-release-4/README-3.md).
|
10
|
-
|
11
7
|
## Installation
|
12
8
|
|
13
9
|
Include the gem in your Gemfile
|
@@ -41,11 +37,9 @@ For example:
|
|
41
37
|
|
42
38
|
```ruby
|
43
39
|
module PhrasingHelper
|
44
|
-
|
45
40
|
def can_edit_phrases?
|
46
41
|
current_user.is_admin?
|
47
42
|
end
|
48
|
-
|
49
43
|
end
|
50
44
|
```
|
51
45
|
Include the phrasing **html** initializer at the top of your application layout file.
|
@@ -129,9 +123,9 @@ scope: 'homepage.footer' # add scopes just like you would w/ I18.n. If the first
|
|
129
123
|
## Credits
|
130
124
|
|
131
125
|
Phrasing is maintained and sponsored by
|
132
|
-
[Infinum]
|
126
|
+
[Infinum](http://www.infinum.co).
|
133
127
|
|
134
|
-
|
128
|
+
<img src="https://infinum.co/infinum.png" width="264">
|
135
129
|
|
136
130
|
Phrasing leverages parts of [Copycat](https://github.com/Zorros/copycat) and [ZenPen](https://github.com/tholman/zenpen/tree/master/).
|
137
131
|
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -16,7 +16,7 @@ class PhrasingPhrasesController < Phrasing.parent_controller.constantize
|
|
16
16
|
|
17
17
|
def index
|
18
18
|
params[:locale] ||= I18n.default_locale
|
19
|
-
@phrasing_phrases =
|
19
|
+
@phrasing_phrases = phrasing_phrases
|
20
20
|
@locale_names = PhrasingPhrase.distinct.pluck(:locale)
|
21
21
|
end
|
22
22
|
|
@@ -33,7 +33,7 @@ class PhrasingPhrasesController < Phrasing.parent_controller.constantize
|
|
33
33
|
app_env = Rails.env
|
34
34
|
time = Time.now.strftime('%Y_%m_%d_%H_%M_%S')
|
35
35
|
filename = "phrasing_phrases_#{app_name}_#{app_env}_#{time}.yml"
|
36
|
-
send_data Phrasing::Serializer.export_yaml, filename: filename
|
36
|
+
send_data Phrasing::Serializer.export_yaml(phrasing_phrases), filename: filename
|
37
37
|
end
|
38
38
|
|
39
39
|
def upload
|
@@ -84,4 +84,8 @@ class PhrasingPhrasesController < Phrasing.parent_controller.constantize
|
|
84
84
|
redirect_to phrasing_phrases_path, notice: "#{phrase.key} updated!"
|
85
85
|
end
|
86
86
|
|
87
|
+
def phrasing_phrases
|
88
|
+
PhrasingPhrase.fuzzy_search(params[:search], params[:locale])
|
89
|
+
end
|
90
|
+
|
87
91
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,6 +4,8 @@
|
|
4
4
|
= select_tag 'locale', locale_options
|
5
5
|
= text_field_tag :search, params[:search], placeholder: 'Search for keys or values', size: 40
|
6
6
|
= submit_tag 'Search', class: "btn btn-success"
|
7
|
+
= link_to 'Download', download_phrasing_phrases_path(search: params[:search], locale: params[:locale]), class: 'btn btn-success'
|
8
|
+
|
7
9
|
- if @phrasing_phrases.any?
|
8
10
|
%table.all-phrases
|
9
11
|
%thead
|
data/lib/phrasing/serializer.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Phrasing
|
2
2
|
module Serializer
|
3
3
|
class << self
|
4
|
-
|
4
|
+
|
5
5
|
def import_yaml(yaml)
|
6
6
|
number_of_changes = 0
|
7
7
|
hash = YAML.load(yaml)
|
@@ -16,7 +16,7 @@ module Phrasing
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
number_of_changes
|
21
21
|
end
|
22
22
|
|
@@ -24,7 +24,7 @@ module Phrasing
|
|
24
24
|
new_hash = {}
|
25
25
|
hash.each do |key, value|
|
26
26
|
if value.is_a? Hash
|
27
|
-
flatten_the_hash(value).each do |k,v|
|
27
|
+
flatten_the_hash(value).each do |k,v|
|
28
28
|
new_hash["#{key}.#{k}"] = v
|
29
29
|
end
|
30
30
|
else
|
@@ -34,9 +34,9 @@ module Phrasing
|
|
34
34
|
new_hash
|
35
35
|
end
|
36
36
|
|
37
|
-
def export_yaml
|
37
|
+
def export_yaml(phrasing_phrases)
|
38
38
|
hash = {}
|
39
|
-
|
39
|
+
phrasing_phrases.each do |phrase|
|
40
40
|
hash[phrase.locale] ||= {}
|
41
41
|
hash[phrase.locale][phrase.key] = phrase.value
|
42
42
|
end
|
@@ -45,4 +45,4 @@ module Phrasing
|
|
45
45
|
|
46
46
|
end
|
47
47
|
end
|
48
|
-
end
|
48
|
+
end
|
data/lib/phrasing/version.rb
CHANGED
data/spec/dummy/Rakefile
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/dummy/config.ru
CHANGED
File without changes
|
File without changes
|
data/spec/dummy/config/boot.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/dummy/db/.gitkeep
CHANGED
File without changes
|
File without changes
|
data/spec/dummy/db/migrate/20131120000856_create_phrasing_phrase_versions.phrasing_rails_engine.rb
CHANGED
File without changes
|
data/spec/dummy/public/404.html
CHANGED
File without changes
|
data/spec/dummy/public/422.html
CHANGED
File without changes
|
data/spec/dummy/public/500.html
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -118,7 +118,7 @@ describe Phrasing::Serializer do
|
|
118
118
|
expect(english_phrases.where(key: "site.intro").first.value).to eq("Go Home")
|
119
119
|
expect(english_phrases.where(key: "site.outro").first.value).to eq("Kthnx Bye")
|
120
120
|
|
121
|
-
yaml = Phrasing::Serializer.export_yaml
|
121
|
+
yaml = Phrasing::Serializer.export_yaml(PhrasingPhrase.where("value is not null"))
|
122
122
|
|
123
123
|
number_of_changes = Phrasing::Serializer.import_yaml(StringIO.new(yaml))
|
124
124
|
|
@@ -139,7 +139,7 @@ describe Phrasing::Serializer do
|
|
139
139
|
expect(english_phrases.where(key: "site.intro").first.value).to eq("Go Home")
|
140
140
|
expect(english_phrases.where(key: "site.outro").first.value).to eq("Kthnx Bye")
|
141
141
|
|
142
|
-
yaml = Phrasing::Serializer.export_yaml
|
142
|
+
yaml = Phrasing::Serializer.export_yaml(PhrasingPhrase.where("value is not null"))
|
143
143
|
|
144
144
|
expect(yaml).to match(/site.intro:\sGo Home/)
|
145
145
|
expect(yaml).to match(/site.outro:\sKthnx Bye/)
|
@@ -152,7 +152,7 @@ describe Phrasing::Serializer do
|
|
152
152
|
expect(english_phrases.where(key: "site.intro").first.value).to eq("Hello")
|
153
153
|
expect(french_phrases.where(key: "site.intro").first.value).to eq("Bonjour")
|
154
154
|
|
155
|
-
yaml = Phrasing::Serializer.export_yaml
|
155
|
+
yaml = Phrasing::Serializer.export_yaml(PhrasingPhrase.where("value is not null"))
|
156
156
|
|
157
157
|
expect(yaml).to match(/en:\s*\n\s*site.intro:\sHello/)
|
158
158
|
expect(yaml).to match(/fr:\s*\n\s*site.intro:\sBonjour/)
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrasing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomislav Car
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -89,7 +89,6 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".travis.yml"
|
92
|
-
- 4.0.0_changes.md
|
93
92
|
- CHANGELOG.md
|
94
93
|
- Gemfile
|
95
94
|
- MIT-LICENSE
|
@@ -196,12 +195,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
196
195
|
version: '0'
|
197
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
197
|
requirements:
|
199
|
-
- - "
|
198
|
+
- - ">="
|
200
199
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
200
|
+
version: '0'
|
202
201
|
requirements: []
|
203
202
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.4.5
|
205
204
|
signing_key:
|
206
205
|
specification_version: 4
|
207
206
|
summary: Edit phrases inline for Rails applications!
|
data/4.0.0_changes.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Changes
|