Sha256: 4463c3d12a75fdb6867ad62d2a9f1643aab0f6f4a472fe16f3f5def8985115f4

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 KB

Contents

require "spree/zoned/search/base"

#
# ZONED_COMMON_COUNTRIES is the list of countries that will be separately listed
# in the beginning of the country select box for easy selection.
# Edit the list to your liking.
#    
ZONED_COMMON_COUNTRIES =
[
  214, # United States
  74, # Germany
  13, # Austria
  195, # Switzerland
  142, # Netherlands
  20, # Belgium
  117, # Luxembourg
]

#
# ZONED_COMMOM_LOCALES specifies - for each contry contained in ZONED_COMMON_COUNTRIES - a list (array)
# of locales that are possibile to select for that specific country.
# For all countries not included in ZONED_COMMON_COUNTRIES, the locale will automatically be set to :en.
# The first locale listed for each country is considered that countrie's default locale.
#
ZONED_COMMON_LOCALES =
{
  -214 => [:en], # United States
  -74  => [:de, :en], # Germany
  -13  => [:de, :en], # Austria
  -195 => [:de, :en], # Switzerland
  -142 => [:'nl-NL', :en], # Netherlands
  -20  => [:'nl-NL', :de, :en], # Belgium
  -117 => [:de, :en, :'nl-NL'], # Luxembourg
}

Rails.configuration.commonCountriesForSelect = ZONED_COMMON_COUNTRIES.map do |id|
  [ Spree::Country.find_by_id(id).name, -id ]
end

Rails.configuration.availableLanguages = Hash[ZONED_COMMON_LOCALES.map { |c, lgs| [c, lgs.map { |l| [((l==:en ? "English" : (l==:de ? "Deutsch" : "Nederlands"))) ,l]}]}]

Spree::Config.searcher_class = Spree::Zoned::Search::Base
Spree::Config.admin_products_per_page = 64

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_zoned-0.5.31 config/initializers/zoned_init.rb
spree_zoned-0.5.30 config/initializers/zoned_init.rb
spree_zoned-0.5.29 config/initializers/zoned_init.rb
spree_zoned-0.5.28 config/initializers/zoned_init.rb
spree_zoned-0.5.27 config/initializers/zoned_init.rb
spree_zoned-0.5.26 config/initializers/zoned_init.rb