deliver/lib/deliver/upload_metadata.rb
# If the user is using the 'default' language, then assign values where they are needed
If the user is using the 'default' language, then assign values where they are needed
If the user is using the ' default ' language then assign values where they are needed
def assign_defaults(options)
      enabled_languages = []
      (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
        current = options[key]
        next unless current && current.kind_of?(Hash)
        current.each do |language, value|
          enabled_languages << language unless enabled_languages.include?(language)
        end
      end
      Loader.language_folders(options[:metadata_path]).each do |lng_folder|
        next unless File.directory?(lng_folder) 
        language = File.basename(lng_folder)
        enabled_languages << language unless enabled_languages.include?(language)
      end
      return unless enabled_languages.include?("default")
      UI.message("Detected languages: " + enabled_languages.to_s)
      (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
        current = options[key]
        next unless current && current.kind_of?(Hash)
        default = current["default"]
        next if default.nil?
        enabled_languages.each do |language|
          value = current[language]
          next unless value.nil?
          current[language] = default
        end
        current.delete("default")
      end
    end
def assign_defaults ( options ) enabled_languages = [ ] ( LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES ) . each do | key | current = options [ key ] next unless current && current . kind_of? ( Hash ) current . each do | language , value | enabled_languages << language unless enabled_languages . include? ( language ) end end Loader . language_folders ( options [ :metadata_path ] ) . each do | lng_folder | next unless File . directory? ( lng_folder ) language = File . basename ( lng_folder ) enabled_languages << language unless enabled_languages . include? ( language ) end return unless enabled_languages . include? ( "default" ) UI . message ( "Detected languages: " + enabled_languages . to_s ) ( LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES ) . each do | key | current = options [ key ] next unless current && current . kind_of? ( Hash ) default = current [ "default" ] next if default . nil? enabled_languages . each do | language | value = current [ language ] next unless value . nil? current [ language ] = default end current . delete ( "default" ) end end
If the user is using the 'default' language, then assign values where they are needed
If the user is using the ' default ' language then assign values where they are needed
# Build a complete list of the required languages # Get all languages used in existing settings # Check folder list (an empty folder signifies a language is required) # We don't want to read txt as they are non localised
options
<not_specific>