versacommerce_app 1.0.17 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/versacommerce_app/templates/app/controllers/application_controller.rb +22 -0
- data/lib/generators/versacommerce_app/templates/app/controllers/sessions_controller.rb +3 -3
- data/lib/generators/versacommerce_app/templates/app/views/sessions/new.html.erb +5 -5
- data/lib/generators/versacommerce_app/templates/config/locales/de.yml +30 -0
- data/lib/generators/versacommerce_app/templates/config/locales/de_rails.yml +203 -0
- data/lib/generators/versacommerce_app/templates/config/locales/en.yml +34 -0
- data/lib/generators/versacommerce_app/versacommerce_app_generator.rb +9 -0
- data/lib/versacommerce_app/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad91ebadc719af96a5d66e8013a7a8bc81d92c1d
|
4
|
+
data.tar.gz: 66712b6a8eefc10fdbb9ffdf3715a99cc69b54b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e7e49cf800bb0a3c1cbe05e23cdaf2817caa8b93680d6d39e861125eb0ab66cf10d9785744f075c000c0a512a05ebba41205c0f4ee45de2d364cb07741591f7
|
7
|
+
data.tar.gz: 8ef122e065f2fd5310ca163f0134c42cbecf35f5bcda4beababba42d0cb233080194d1353f0dd03afcc0eae21ad85d5f77aa194e55595069abc77e940f216b04
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class ApplicationController < ActionController::Base
|
2
|
+
# Prevent CSRF attacks by raising an exception.
|
3
|
+
# For APIs, you may want to use :null_session instead.
|
4
|
+
protect_from_forgery with: :exception
|
5
|
+
before_filter :set_locale
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def extract_locale_from_accept_language_header
|
10
|
+
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].try(:scan, /^[a-z]{2}/).try(:first).try(:to_sym)
|
11
|
+
session[:locale] = browser_locale if I18n.available_locales.include? browser_locale
|
12
|
+
end
|
13
|
+
|
14
|
+
def set_locale
|
15
|
+
extract_locale_from_accept_language_header if session[:locale].blank?
|
16
|
+
session[:locale] = I18n.default_locale if session[:locale].blank?
|
17
|
+
session[:locale] = params[:locale] if params[:locale]
|
18
|
+
I18n.locale = session[:locale]
|
19
|
+
Rails.application.routes.default_url_options[:locale]= I18n.locale
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -11,7 +11,7 @@ class SessionsController < ApplicationController
|
|
11
11
|
|
12
12
|
def destroy
|
13
13
|
session[:versacommerce] = nil
|
14
|
-
flash[:success] =
|
14
|
+
flash[:success] = t('sessions.controller.destroy')
|
15
15
|
redirect_to :action => 'new'
|
16
16
|
end
|
17
17
|
|
@@ -34,10 +34,10 @@ class SessionsController < ApplicationController
|
|
34
34
|
# https://github.com/versacommerce/versacommerce_api (see sample code)
|
35
35
|
#
|
36
36
|
session[:versacommerce] = current_session
|
37
|
-
flash[:success] =
|
37
|
+
flash[:success] = t('sessions.controller.finalize_ok')
|
38
38
|
redirect_to return_address
|
39
39
|
else
|
40
|
-
flash[:warning] =
|
40
|
+
flash[:warning] = t('sessions.controller.finalize_error')
|
41
41
|
redirect_to :action => 'index'
|
42
42
|
end
|
43
43
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<div class="page-header" id="login-header">
|
2
2
|
<%= image_tag 'versacommerce-100.png', class: "pull-right", style: "opacity:.55" %>
|
3
|
-
<h1
|
4
|
-
<h1><small
|
3
|
+
<h1><%= t('sessions.views.new.title') %></h1>
|
4
|
+
<h1><small><%= t('sessions.views.new.subtitle') %></small></h1>
|
5
5
|
</div>
|
6
6
|
|
7
7
|
<div>
|
8
8
|
<%= form_tag login_path, :class => 'form-inline' do %>
|
9
|
-
<span class="help-block"
|
9
|
+
<span class="help-block"><%= t('sessions.views.new.help') %></span>
|
10
10
|
<div class="form-group">
|
11
|
-
<%= text_field_tag 'shop', nil, size: 40, :
|
11
|
+
<%= text_field_tag 'shop', nil, size: 40, placeholder: t('sessions.views.new.placeholder'), class: 'form-control' %>
|
12
12
|
</div>
|
13
|
-
<%= submit_tag '
|
13
|
+
<%= submit_tag t('sessions.views.new.submit'), :class => 'btn btn-primary btn-large' %>
|
14
14
|
<% end %>
|
15
15
|
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# To use the locales, use `I18n.t`:
|
2
|
+
#
|
3
|
+
# I18n.t 'hello'
|
4
|
+
#
|
5
|
+
# In views, this is aliased to just `t`:
|
6
|
+
#
|
7
|
+
# <%= t('hello') %>
|
8
|
+
#
|
9
|
+
# To use a different locale, set it with `I18n.locale`:
|
10
|
+
#
|
11
|
+
# I18n.locale = :es
|
12
|
+
#
|
13
|
+
# This would use the information in config/locales/es.yml.
|
14
|
+
#
|
15
|
+
# To learn more, please read the Rails Internationalization guide
|
16
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
17
|
+
|
18
|
+
de:
|
19
|
+
sessions:
|
20
|
+
views:
|
21
|
+
new:
|
22
|
+
title: "Registrieren Sie diese Anwendung bei Ihrem Shop."
|
23
|
+
subtitle: "Sie müssen Sich bei ihrem Shop anmelden, um dieser Anwendung Zugriff zu gewähren."
|
24
|
+
help: "Bitte geben Sie Ihre Shop-URL ein. Beispiel: mein-shop.versacommerce.de"
|
25
|
+
placeholder: "mein-shop.versacommerce.de"
|
26
|
+
submit: "Registrieren (Installieren)"
|
27
|
+
controller:
|
28
|
+
destroy: "Sie sind nun abgemeldet."
|
29
|
+
finalize_ok: "Verbindung wurde erfolgreich aufgebaut."
|
30
|
+
finalize_error: "Verbindung konnte nicht aufgebaut werden."
|
@@ -0,0 +1,203 @@
|
|
1
|
+
de:
|
2
|
+
date:
|
3
|
+
abbr_day_names:
|
4
|
+
- So
|
5
|
+
- Mo
|
6
|
+
- Di
|
7
|
+
- Mi
|
8
|
+
- Do
|
9
|
+
- Fr
|
10
|
+
- Sa
|
11
|
+
abbr_month_names:
|
12
|
+
-
|
13
|
+
- Jan
|
14
|
+
- Feb
|
15
|
+
- Mär
|
16
|
+
- Apr
|
17
|
+
- Mai
|
18
|
+
- Jun
|
19
|
+
- Jul
|
20
|
+
- Aug
|
21
|
+
- Sep
|
22
|
+
- Okt
|
23
|
+
- Nov
|
24
|
+
- Dez
|
25
|
+
day_names:
|
26
|
+
- Sonntag
|
27
|
+
- Montag
|
28
|
+
- Dienstag
|
29
|
+
- Mittwoch
|
30
|
+
- Donnerstag
|
31
|
+
- Freitag
|
32
|
+
- Samstag
|
33
|
+
formats:
|
34
|
+
default: ! '%d.%m.%Y'
|
35
|
+
long: ! '%e. %B %Y'
|
36
|
+
short: ! '%e. %b'
|
37
|
+
month_names:
|
38
|
+
-
|
39
|
+
- Januar
|
40
|
+
- Februar
|
41
|
+
- März
|
42
|
+
- April
|
43
|
+
- Mai
|
44
|
+
- Juni
|
45
|
+
- Juli
|
46
|
+
- August
|
47
|
+
- September
|
48
|
+
- Oktober
|
49
|
+
- November
|
50
|
+
- Dezember
|
51
|
+
order:
|
52
|
+
- :day
|
53
|
+
- :month
|
54
|
+
- :year
|
55
|
+
datetime:
|
56
|
+
distance_in_words:
|
57
|
+
about_x_hours:
|
58
|
+
one: etwa eine Stunde
|
59
|
+
other: etwa %{count} Stunden
|
60
|
+
about_x_months:
|
61
|
+
one: etwa ein Monat
|
62
|
+
other: etwa %{count} Monate
|
63
|
+
about_x_years:
|
64
|
+
one: etwa ein Jahr
|
65
|
+
other: etwa %{count} Jahre
|
66
|
+
almost_x_years:
|
67
|
+
one: fast ein Jahr
|
68
|
+
other: fast %{count} Jahre
|
69
|
+
half_a_minute: eine halbe Minute
|
70
|
+
less_than_x_minutes:
|
71
|
+
one: weniger als eine Minute
|
72
|
+
other: weniger als %{count} Minuten
|
73
|
+
less_than_x_seconds:
|
74
|
+
one: weniger als eine Sekunde
|
75
|
+
other: weniger als %{count} Sekunden
|
76
|
+
over_x_years:
|
77
|
+
one: mehr als ein Jahr
|
78
|
+
other: mehr als %{count} Jahre
|
79
|
+
x_days:
|
80
|
+
one: ein Tag
|
81
|
+
other: ! '%{count} Tage'
|
82
|
+
x_minutes:
|
83
|
+
one: eine Minute
|
84
|
+
other: ! '%{count} Minuten'
|
85
|
+
x_months:
|
86
|
+
one: ein Monat
|
87
|
+
other: ! '%{count} Monate'
|
88
|
+
x_seconds:
|
89
|
+
one: eine Sekunde
|
90
|
+
other: ! '%{count} Sekunden'
|
91
|
+
prompts:
|
92
|
+
day: Tag
|
93
|
+
hour: Stunden
|
94
|
+
minute: Minuten
|
95
|
+
month: Monat
|
96
|
+
second: Sekunden
|
97
|
+
year: Jahr
|
98
|
+
errors: &errors
|
99
|
+
format: ! '%{attribute} %{message}'
|
100
|
+
messages:
|
101
|
+
accepted: muss akzeptiert werden
|
102
|
+
blank: muss ausgefüllt werden
|
103
|
+
confirmation: stimmt nicht mit der Bestätigung überein
|
104
|
+
empty: muss ausgefüllt werden
|
105
|
+
equal_to: muss genau %{count} sein
|
106
|
+
even: muss gerade sein
|
107
|
+
exclusion: ist nicht verfügbar
|
108
|
+
greater_than: muss größer als %{count} sein
|
109
|
+
greater_than_or_equal_to: muss größer oder gleich %{count} sein
|
110
|
+
inclusion: ist kein gültiger Wert
|
111
|
+
invalid: ist nicht gültig
|
112
|
+
less_than: muss kleiner als %{count} sein
|
113
|
+
less_than_or_equal_to: muss kleiner oder gleich %{count} sein
|
114
|
+
not_a_number: ist keine Zahl
|
115
|
+
not_an_integer: muss ganzzahlig sein
|
116
|
+
odd: muss ungerade sein
|
117
|
+
record_invalid: ! 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}'
|
118
|
+
taken: ist bereits vergeben
|
119
|
+
too_long: ist zu lang (mehr als %{count} Zeichen)
|
120
|
+
too_short: ist zu kurz (weniger als %{count} Zeichen)
|
121
|
+
wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben)
|
122
|
+
template:
|
123
|
+
body: ! 'Bitte überprüfen Sie die folgenden Felder:'
|
124
|
+
header:
|
125
|
+
one: ! 'Konnte %{model} nicht speichern: ein Fehler.'
|
126
|
+
other: ! 'Konnte %{model} nicht speichern: %{count} Fehler.'
|
127
|
+
helpers:
|
128
|
+
select:
|
129
|
+
prompt: Bitte wählen
|
130
|
+
submit:
|
131
|
+
create: ! '%{model} erstellen'
|
132
|
+
submit: ! '%{model} speichern'
|
133
|
+
update: ! '%{model} aktualisieren'
|
134
|
+
number:
|
135
|
+
currency:
|
136
|
+
format:
|
137
|
+
delimiter: .
|
138
|
+
format: ! '%n %u'
|
139
|
+
precision: 2
|
140
|
+
separator: ! ','
|
141
|
+
significant: false
|
142
|
+
strip_insignificant_zeros: false
|
143
|
+
unit: €
|
144
|
+
format:
|
145
|
+
delimiter: .
|
146
|
+
precision: 2
|
147
|
+
separator: ! ','
|
148
|
+
significant: false
|
149
|
+
strip_insignificant_zeros: false
|
150
|
+
human:
|
151
|
+
decimal_units:
|
152
|
+
format: ! '%n %u'
|
153
|
+
units:
|
154
|
+
billion:
|
155
|
+
one: Milliarde
|
156
|
+
other: Milliarden
|
157
|
+
million: Millionen
|
158
|
+
quadrillion:
|
159
|
+
one: Billiarde
|
160
|
+
other: Billiarden
|
161
|
+
thousand: Tausend
|
162
|
+
trillion: Billionen
|
163
|
+
unit: ''
|
164
|
+
format:
|
165
|
+
delimiter: ''
|
166
|
+
precision: 1
|
167
|
+
significant: true
|
168
|
+
strip_insignificant_zeros: true
|
169
|
+
storage_units:
|
170
|
+
format: ! '%n %u'
|
171
|
+
units:
|
172
|
+
byte:
|
173
|
+
one: Byte
|
174
|
+
other: Bytes
|
175
|
+
gb: GB
|
176
|
+
kb: KB
|
177
|
+
mb: MB
|
178
|
+
tb: TB
|
179
|
+
percentage:
|
180
|
+
format:
|
181
|
+
delimiter: ''
|
182
|
+
precision:
|
183
|
+
format:
|
184
|
+
delimiter: ''
|
185
|
+
support:
|
186
|
+
array:
|
187
|
+
last_word_connector: ! ' und '
|
188
|
+
two_words_connector: ! ' und '
|
189
|
+
words_connector: ! ', '
|
190
|
+
time:
|
191
|
+
am: vormittags
|
192
|
+
formats:
|
193
|
+
default: ! '%A, %d. %B %Y, %H:%M Uhr'
|
194
|
+
long: ! '%A, %d. %B %Y, %H:%M Uhr'
|
195
|
+
short: ! '%d. %B, %H:%M Uhr'
|
196
|
+
pm: nachmittags
|
197
|
+
# remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
|
198
|
+
activemodel:
|
199
|
+
errors:
|
200
|
+
<<: *errors
|
201
|
+
activerecord:
|
202
|
+
errors:
|
203
|
+
<<: *errors
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
sessions:
|
24
|
+
views:
|
25
|
+
new:
|
26
|
+
title: "Register this app with your shop."
|
27
|
+
subtitle: "This app requires you to login to start using it."
|
28
|
+
help: "Please enter the shop url. Example: myshop.versacommerce.de"
|
29
|
+
placeholder: "myshop.versacommerce.de"
|
30
|
+
submit: "Install / Register"
|
31
|
+
controller:
|
32
|
+
destroy: "Successfully logged out."
|
33
|
+
finalize_ok: "Connection successfully established."
|
34
|
+
finalize_error: "Connection could not be established."
|
@@ -50,6 +50,15 @@ production:
|
|
50
50
|
route_without_newline "controller :sessions do"
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
def add_config_locale
|
55
|
+
inject_into_file 'config/application.rb', <<-DATA, :after => "class Application < Rails::Application\n"
|
56
|
+
|
57
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
58
|
+
config.encoding = "utf-8"
|
59
|
+
config.time_zone = 'Berlin'
|
60
|
+
DATA
|
61
|
+
end
|
53
62
|
|
54
63
|
def show_readme
|
55
64
|
`bundle install`
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: versacommerce_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VersaCommerce
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/generators/versacommerce_app/templates/app/assets/images/versacommerce-114.png
|
68
68
|
- lib/generators/versacommerce_app/templates/app/assets/images/versacommerce-57.png
|
69
69
|
- lib/generators/versacommerce_app/templates/app/assets/images/versacommerce-72.png
|
70
|
+
- lib/generators/versacommerce_app/templates/app/controllers/application_controller.rb
|
70
71
|
- lib/generators/versacommerce_app/templates/app/controllers/home_controller.rb
|
71
72
|
- lib/generators/versacommerce_app/templates/app/controllers/sessions_controller.rb
|
72
73
|
- lib/generators/versacommerce_app/templates/app/helpers/home_helper.rb
|
@@ -74,6 +75,9 @@ files:
|
|
74
75
|
- lib/generators/versacommerce_app/templates/app/views/home/index.html.erb
|
75
76
|
- lib/generators/versacommerce_app/templates/app/views/layouts/application.html.erb
|
76
77
|
- lib/generators/versacommerce_app/templates/app/views/sessions/new.html.erb
|
78
|
+
- lib/generators/versacommerce_app/templates/config/locales/de.yml
|
79
|
+
- lib/generators/versacommerce_app/templates/config/locales/de_rails.yml
|
80
|
+
- lib/generators/versacommerce_app/templates/config/locales/en.yml
|
77
81
|
- lib/generators/versacommerce_app/templates/config/versacommerce_api.yml
|
78
82
|
- lib/generators/versacommerce_app/templates/public/404.html
|
79
83
|
- lib/generators/versacommerce_app/templates/public/422.html
|