Project

General

Profile

« Previous | Next » 

Revision 3e188ece

Added by Marc Dequènes over 14 years ago

  • ID 3e188eced1a015072b0d2d92940d27f9dba98105

[fix] don't crash if @config.i18n.restricted_language_set is not set

View differences:

lib/cyborghood/base/language.rb
list = ['en'] + Dir.new(Config::L10N_DIR).select{|d| File.directory?(File.join(Config::L10N_DIR, d)) and d[0..0] != "." }
# local admin can restrict available languages
# (may be useful if l10n is partial due to third party plugins)
list = list & @config.i18n.restricted_language_set if @config.i18n.restricted_language_set
list = list & @config.i18n.restricted_language_set if @config.i18n and @config.i18n.restricted_language_set
list = ['en'] if list.empty?
list
end

Also available in: Unified diff