translation_center 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +17 -15
- data/app/assets/javascripts/translation_center/center.js +1 -1
- data/app/assets/javascripts/translation_center/{inspector.js → inspector.js.erb} +3 -0
- data/app/views/translation_center/center/dashboard.html.haml +4 -4
- data/lib/generators/translation_center/install/templates/config/translation_center.yml +31 -3
- data/lib/translation_center/version.rb +1 -1
- data/test/dummy/app/views/layouts/application.html.erb +0 -3
- data/test/dummy/log/development.log +4076 -0
- data/test/dummy/tmp/cache/assets/CC1/310/sprockets%2F96006e48b893964c6fd47a52ae3436b8 +0 -0
- data/test/dummy/tmp/cache/assets/CE0/2B0/sprockets%2F9f924e591087e633cea041028cff44c0 +0 -0
- data/test/dummy/tmp/cache/assets/D2F/FF0/sprockets%2F00d4ae0093a6d2ee8a2c5cf25283484b +0 -0
- data/test/dummy/tmp/cache/assets/D34/EE0/sprockets%2Fcd4de37fdb003c44a5342c51371d55f9 +0 -0
- data/test/dummy/tmp/cache/assets/D36/F70/sprockets%2F583f9d5a28506cf026af2bfaf0f01462 +0 -0
- data/test/dummy/tmp/cache/assets/D6F/C30/sprockets%2F5b966425a5e85aaa64d807ddb7eed014 +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -1
- metadata +7 -3
data/README.md
CHANGED
@@ -137,7 +137,7 @@ If your application doesn't use devise for authentication then you have to
|
|
137
137
|
provide helper named `current_user` that returns the current user in the session and a before_filter named `authenticate_user!` that redirects a user
|
138
138
|
to login page if not already signed in.
|
139
139
|
|
140
|
-
You need to add these methods in an initialize, for example `translation_authentication.rb` :
|
140
|
+
You also need to add these methods in an initialize, for example `translation_authentication.rb` :
|
141
141
|
```ruby
|
142
142
|
module TranslationCenter
|
143
143
|
class ApplicationController < ActionController::Base
|
@@ -157,7 +157,21 @@ module TranslationCenter
|
|
157
157
|
end
|
158
158
|
```
|
159
159
|
|
160
|
-
**
|
160
|
+
**Email attribute:**
|
161
|
+
|
162
|
+
Translation Center assumes that the translator model (for example `User`) has an `email` attribute, this attribute is used when showing translations, activity log in dashboard and updating existing translations.
|
163
|
+
|
164
|
+
If your `User` model has no `email` attribute add one or define a method named `email` like the following:
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
def email
|
168
|
+
"translator_#{self.id}@myapp.com"
|
169
|
+
end
|
170
|
+
```
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
161
175
|
|
162
176
|
|
163
177
|
##Inspector
|
@@ -175,19 +189,7 @@ and this line to your `application.js`
|
|
175
189
|
//= require translation_center/inspector
|
176
190
|
```
|
177
191
|
|
178
|
-
|
179
|
-
|
180
|
-
```ruby
|
181
|
-
translation_center_root = "<%= translation_center_path %>
|
182
|
-
```
|
183
|
-
|
184
|
-
if you are using haml then it should be
|
185
|
-
|
186
|
-
```ruby
|
187
|
-
translation_center_root = #{translation_center_path}
|
188
|
-
```
|
189
|
-
|
190
|
-
Now when you reload your page you will see a small icon beside your translated keys.
|
192
|
+
Now when you reload your page you will see a small icon beside your keys.
|
191
193
|
|
192
194
|

|
193
195
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// Get the translation center engine root path
|
2
|
+
translation_center_root = "<%= Rails.application.routes.url_helpers.translation_center_path %>"
|
3
|
+
|
1
4
|
translation_center_translation_key_path = function(id) { return translation_center_root + '/translation_keys/' + id }
|
2
5
|
|
3
6
|
$(document).ready(function() {
|
@@ -38,15 +38,15 @@
|
|
38
38
|
.span12
|
39
39
|
|
40
40
|
= form_for @search, url: :search_activity, html: { method: :get, id: :search_form, class: 'pull-left form-search' } do |f|
|
41
|
-
= f.text_field 'auditable_TranslationCenter::Translation_type_translation_key_name_matches', class: 'search_field input-medium
|
41
|
+
= f.text_field 'auditable_TranslationCenter::Translation_type_translation_key_name_matches', class: 'search_field input-medium', placeholder: 'KEY'
|
42
42
|
|
43
43
|
= f.select 'auditable_TranslationCenter::Translation_type_lang_equals', I18n.available_locales.collect { |locale| [locale.to_s, locale.to_s] }, {:include_blank => t('.select_locale')}, class: 'search_field'
|
44
44
|
|
45
|
-
= f.text_field 'user_user_type_email_matches', class: 'search_field input-medium
|
45
|
+
= f.text_field 'user_user_type_email_matches', class: 'search_field input-medium', placeholder: 'USER'
|
46
46
|
|
47
|
-
= f.text_field :created_at_gteq, class: 'search_field datepicker input-medium
|
47
|
+
= f.text_field :created_at_gteq, class: 'search_field datepicker input-medium', placeholder: 'FROM DATE'
|
48
48
|
|
49
|
-
= f.text_field :created_at_lteq, class: 'search_field datepicker input-medium
|
49
|
+
= f.text_field :created_at_lteq, class: 'search_field datepicker input-medium', placeholder: 'TO DATE'
|
50
50
|
|
51
51
|
%button.btn#search_activity{ type: :button }
|
52
52
|
= t('.search')
|
@@ -5,16 +5,15 @@ development:
|
|
5
5
|
# "missing" to inspect only untranslated keys
|
6
6
|
# "all" to enable inspector for translated and untranslated keys
|
7
7
|
# "off" to turn off keys inspector
|
8
|
-
inspector: '
|
8
|
+
inspector: 'all' # default missing
|
9
9
|
|
10
|
-
|
11
10
|
# what language to support and their display names
|
12
11
|
lang:
|
13
12
|
en: 'English'
|
14
13
|
# de: 'Deutch'
|
15
14
|
|
16
15
|
# I18n.translate source
|
17
|
-
i18n_source: '
|
16
|
+
i18n_source: 'db' # can be db or yaml; default is yaml
|
18
17
|
|
19
18
|
# yaml imported translations created by translator email
|
20
19
|
yaml_translator_email: 'coder@tc.com'
|
@@ -27,3 +26,32 @@ development:
|
|
27
26
|
|
28
27
|
# when a new key is added to db, the value of the key is added as the default translation in English
|
29
28
|
save_default_translation: true
|
29
|
+
|
30
|
+
production:
|
31
|
+
enabled: true # default false
|
32
|
+
|
33
|
+
# Keys inspector allowed values:
|
34
|
+
# "missing" to inspect only untranslated keys
|
35
|
+
# "all" to enable inspector for translated and untranslated keys
|
36
|
+
# "off" to turn off keys inspector
|
37
|
+
inspector: 'off' # default missing
|
38
|
+
|
39
|
+
# what language to support and their display names
|
40
|
+
lang:
|
41
|
+
en: 'English'
|
42
|
+
# de: 'Deutch'
|
43
|
+
|
44
|
+
# I18n.translate source
|
45
|
+
i18n_source: 'yaml' # can be db or yaml; default is yaml
|
46
|
+
|
47
|
+
# yaml imported translations created by translator email
|
48
|
+
yaml_translator_email: 'coder@tc.com'
|
49
|
+
|
50
|
+
# when import translation from yaml to db set it to accepted by default
|
51
|
+
yaml2db_translations_accepted: true # default is false
|
52
|
+
|
53
|
+
# when admins add/edit translations they are considered accepted directly
|
54
|
+
accept_admin_translations: true
|
55
|
+
|
56
|
+
# when a new key is added to db, the value of the key is added as the default translation in English
|
57
|
+
save_default_translation: false
|