para-i18n 0.1.3 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34b2ce3cde1648cdf50f7a0edf4f16914a3b31d5
4
- data.tar.gz: a68844dba0800c59d7009dce60f9567690e9e244
3
+ metadata.gz: 5d42fdf56d948684c4f79e31c8ba0f9d3294e6f2
4
+ data.tar.gz: 9aea334a03c9f1d2ccdda7035ac129b6a562e498
5
5
  SHA512:
6
- metadata.gz: 67188e5b8e71be0ded33f270b2f88cc3fd11674e0394c854c6208da0166b48381a71ace6459895f087697cd7417843c930da1e5e1c07b3ea53bb1f787f44d875
7
- data.tar.gz: dad4bd7ded6ee9443a7387116295115053861c8d977cce255237701f3fd54416a472bf8bc0ff17755d131c5ffd462a085f3f5facdd1b02f64e0c906ce8b043d9
6
+ metadata.gz: d8e539835da54493e3d414726aa5ee897d938da5116074f0212b400c62464e4e95f7a6d82935ea7575c644933764b32ab53b2b001f25d95729a63cf46f020ba6
7
+ data.tar.gz: a390ac46b53f0706b1defd4acdf48b2081ab2f4e87c67f8ad8cd0808c5fc6972e259e75096a909698cf25bf258aefb05e7becf9b06f0ea93b882fd6b60a82783
@@ -39,10 +39,6 @@ module Para
39
39
  @target_locale = params[:target_locale] || @locales.first
40
40
  end
41
41
 
42
- def resource_params
43
- params.require(:resource).permit!
44
- end
45
-
46
42
  def add_breadcrumbs
47
43
  add_breadcrumb(resource_title_for(resource), @component.relation_path(resource, action: :show)) if resource
48
44
  add_breadcrumb(t('para.i18n.translation'))
@@ -1,5 +1,5 @@
1
1
  .block.form-inputs
2
2
  .form-group
3
- = label :target_locale, t('i18n_admin.translations.choose_locale'), class: 'control-label col-md-3 pull-left'
3
+ = label :target_locale, t('para.i18n.choose_locale'), class: 'control-label col-md-3 pull-left'
4
4
  .col-md-9
5
5
  = select_tag :target_locale, options_for_select(locales.map { |locale| [locale, locale] }, target_locale), data: { :'locale-select' => true, selectize: true, multi: false, value: { text: target_locale, value: target_locale }, :'locale-select-target-url' => @component.relation_path(resource, :translation, action: :edit, target_locale: '_') }
@@ -1,4 +1,4 @@
1
1
  = page_top_bar(title: resource_title_for(resource), type: 'crud/translate')
2
2
 
3
- .page-content-wrap
3
+ .page-content-wrap.form-fixed-actions
4
4
  = render find_partial_for(resource, :translations_form)
@@ -3,3 +3,4 @@ fr:
3
3
  i18n:
4
4
  translate: "Traduire"
5
5
  translation: "Traduction"
6
+ choose_locale: "Traduire en :"
@@ -1,12 +1,10 @@
1
- require 'para/i18n/translations_helper'
2
-
3
1
  module Para
4
2
  module I18n
5
3
  class FormGenerator < Para::Generators::NamedBase
6
4
  include Para::Admin::BaseHelper
7
5
  include Para::Generators::FieldHelpers
8
6
  include Para::ModelHelper
9
- include Para::I18n::TranslationsHelper
7
+ include Para::I18n::Helpers::TranslationsHelper
10
8
 
11
9
  source_root File.expand_path("../templates", __FILE__)
12
10
 
@@ -24,7 +22,7 @@ module Para
24
22
  end
25
23
 
26
24
  def model
27
- @model ||= Para.const_get(class_name)
25
+ @model ||= class_name.constantize
28
26
  end
29
27
  end
30
28
  end
@@ -25,7 +25,9 @@ module Para
25
25
  def write_translated_attribute field, value, locale = ::I18n.locale
26
26
  return write_plain_or_store_attribute(field, value) if locale == ::I18n.default_locale
27
27
 
28
- model_translations[locale.to_s] ||= {}
28
+ # did not us ||= here to fix first assignation.
29
+ # Did not investigate on why ||= does not work
30
+ model_translations[locale.to_s] = {} unless model_translations[locale.to_s]
29
31
  model_translations[locale.to_s][field.to_s] = value
30
32
  end
31
33
 
@@ -1,5 +1,5 @@
1
1
  module Para
2
2
  module I18n
3
- VERSION = "0.1.3"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.6.7
114
+ rubygems_version: 2.6.11
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Para CMS I18n admin module for models