spree_globalize icon indicating copy to clipboard operation
spree_globalize copied to clipboard

Localization Settings don't work in General settings

Open bonekost opened this issue 8 years ago • 5 comments

Can't add localization settings in admin General settings. Working only with initializer:

SpreeI18n::Config.available_locales = [:en, :es, :'pt-BR'] # displayed on frontend select box
SpreeGlobalize::Config.supported_locales = [:en, :'pt-BR'] # displayed on translation forms

Spree v3.1.0 Rails v4.2.6

bonekost avatar Aug 18 '16 13:08 bonekost

spree_globalize and spree_i18n both overrides update_i18n_settings method in general_settings_controller

milep avatar Aug 19 '16 09:08 milep

I don't think so... spree_globalize just added new method for update

 before_filter :update_i18n_settings, only: :update

  private
    def update_i18n_settings
      params.each do |name, value|
        next unless SpreeGlobalize::Config.has_preference? name
        SpreeGlobalize::Config[name] = value.map(&:to_sym)
      end
    end

bonekost avatar Aug 19 '16 11:08 bonekost

I mean, they both add method with a same name.

https://github.com/spree-contrib/spree_i18n/blob/master/app/controllers/spree/admin/general_settings_controller_decorator.rb

  before_filter :update_i18n_settings, only: :update

  private

  def update_i18n_settings
    params.each do |name, value|
      next unless SpreeI18n::Config.has_preference? name
      SpreeI18n::Config[name] = value.map(&:to_sym)
    end
  end

milep avatar Aug 19 '16 11:08 milep

WTF???

bonekost avatar Aug 19 '16 11:08 bonekost

Same problem here !

Spree 3.1.0 spree_i18n 3-1-stable spree_globalize master

ste26054 avatar Oct 08 '16 16:10 ste26054