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 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
- **Note:** Also notice that your user must have an email attribute.
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
- and to your application layout
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
  ![Alt text](https://raw.github.com/BadrIT/translation_center/master/samples/inspector_shot.png "Inspected keys")
193
195
 
@@ -46,7 +46,7 @@ $(document).ready(function(){
46
46
  $('#search_activity').click();
47
47
  });
48
48
 
49
- $(".pagination a").on('click', function() {
49
+ $(document).on('click', '.pagination a', function(){
50
50
  $.ajax({
51
51
  type: "GET",
52
52
  url: $(this).attr("href"),
@@ -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 search-query', placeholder: 'KEY'
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 search-query', placeholder: 'USER'
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 search-query', placeholder: 'FROM DATE'
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 search-query', placeholder: 'TO DATE'
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: 'missing' # default missing
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: 'yaml' # can be db or yaml; default is yaml
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
@@ -1,3 +1,3 @@
1
1
  module TranslationCenter
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -3,9 +3,6 @@
3
3
  <head>
4
4
  <title>Dummy</title>
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
- <script>
7
- translation_center_root = "<%= translation_center_path %>"
8
- </script>
9
6
  <%= javascript_include_tag "application" %>
10
7
  <%= csrf_meta_tags %>
11
8
  </head>