activeadmin-translate 0.0.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # ActiveAdmin Translate Changelog
2
2
 
3
+ ## 0.2.0 - November 15, 2012
4
+
5
+ - Add `de`, `fr` and `it` to translations.
6
+ - Fix tab rendering when editing `has_many` relations.
7
+
3
8
  ## 0.1.0 - November 15, 2012
4
9
 
5
10
  - Initial version
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Dmitrii Soltis, Michael Kessler
1
+ Copyright (c) 2012 Michael Kessler
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ between the locales.
9
9
  Add the gem to your `Gemfile`
10
10
 
11
11
  ```ruby
12
- gem 'activeadmin-translate`
12
+ gem 'activeadmin-translate'
13
13
  ```
14
14
 
15
15
  and install it with Bundler:
@@ -31,14 +31,7 @@ config.i18n.available_locales = [:en, :de, :fr, :it]
31
31
 
32
32
  ### Include ActiveAdmin Translate
33
33
 
34
- You need to include the ActiveAdmin JavaScript by adding it to your manifest in
35
- `app/assets/javascripts/active_admin.js`:
36
-
37
- ```javascript
38
- //= require active_admin/translate
39
- ```
40
-
41
- Then you also need to import the SASS customizations in `app/assets/stylesheets/active_admin.css.scss`:
34
+ You need to import the SASS for styling the tabs to `app/assets/stylesheets/active_admin.css.scss`:
42
35
 
43
36
  ```css
44
37
  @import "active_admin/translate";
@@ -72,7 +65,7 @@ form do |f|
72
65
  end
73
66
  ```
74
67
 
75
- ### Translate your ActiveAdmin show action
68
+ ### Translate your ActiveAdmin attributes table
76
69
 
77
70
  To show the attributes for all locales, you use the `translate_attributes_table_for` view helper:
78
71
 
@@ -154,7 +147,7 @@ This project has taken some ideas and code from the following projects:
154
147
 
155
148
  ## License
156
149
 
157
- Copyright (c) 2012 Dmitrii Soltis, Michael Kessler
150
+ Copyright (c) 2012 Michael Kessler
158
151
 
159
152
  MIT License
160
153
 
@@ -0,0 +1,7 @@
1
+ de:
2
+ active_admin:
3
+ translate:
4
+ en: 'Englisch'
5
+ de: 'Deutsch'
6
+ fr: 'Französich'
7
+ it: 'Italienisch'
@@ -1,4 +1,7 @@
1
1
  en:
2
2
  active_admin:
3
3
  translate:
4
- en: "English"
4
+ en: 'English'
5
+ de: 'German'
6
+ fr: 'French'
7
+ it: 'Italian'
@@ -0,0 +1,7 @@
1
+ fr:
2
+ active_admin:
3
+ translate:
4
+ en: 'Anglais'
5
+ de: 'Allemand'
6
+ fr: 'Français'
7
+ it: 'Italien'
@@ -0,0 +1,7 @@
1
+ it:
2
+ active_admin:
3
+ translate:
4
+ en: 'Inglese '
5
+ de: 'Alemanno'
6
+ fr: 'Francese '
7
+ it: 'Italiano'
@@ -6,7 +6,7 @@ module ActiveAdmin
6
6
  class Engine < ::Rails::Engine
7
7
 
8
8
  initializer 'ActiveAdmin Translate precompile' do |app|
9
- app.config.assets.precompile += %w(active_admin/translate.css active_admin/translate.js)
9
+ app.config.assets.precompile += %w(active_admin/translate.css)
10
10
  end
11
11
 
12
12
  end
@@ -12,12 +12,20 @@ module ActiveAdmin
12
12
  #
13
13
  def translate_inputs(name = :translations, &block)
14
14
  form_buffers.last << template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do
15
- locale_tabs << locale_fields(name, block)
15
+ locale_tabs << locale_fields(name, block) << tab_script
16
16
  end
17
17
  end
18
18
 
19
19
  protected
20
20
 
21
+ # Create the script to activate the tabs on insertion.
22
+ #
23
+ # @return [String] the script tag
24
+ #
25
+ def tab_script
26
+ template.content_tag(:script, "$('.activeadmin-translate').tabs();".html_safe)
27
+ end
28
+
21
29
  # Create the local field sets to enter the inputs per locale.
22
30
  #
23
31
  # @param [Symbol] name the name of the translation association
@@ -1,6 +1,6 @@
1
1
  module ActiveAdmin
2
2
  module Translate
3
3
  # The current released version
4
- VERSION = '0.0.1'
4
+ VERSION = '0.2.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -66,14 +66,16 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - app/assets/javascripts/active_admin/translate.js
70
69
  - app/assets/stylesheets/active_admin/translate.css.scss
71
70
  - lib/active_admin/translate/engine.rb
72
71
  - lib/active_admin/translate/form_builder.rb
73
72
  - lib/active_admin/translate/version.rb
74
73
  - lib/active_admin/views/translate_attributes_table.rb
75
74
  - lib/activeadmin-translate.rb
75
+ - config/locales/de.yml
76
76
  - config/locales/en.yml
77
+ - config/locales/fr.yml
78
+ - config/locales/it.yml
77
79
  - LICENSE
78
80
  - README.md
79
81
  - CHANGELOG.md
@@ -1,3 +0,0 @@
1
- $(function() {
2
- $('.activeadmin-translate').tabs()
3
- });