Skip to content

Commit

Permalink
#1673 Make sure the shared labels don't override the labels for each …
Browse files Browse the repository at this point in the history
…model
  • Loading branch information
xhero committed Dec 3, 2024
1 parent 0084120 commit d8e95f4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/editor_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,24 @@ def initialize(conf)
@id = conf[:id]
@filter = conf[:filter]
@model = conf[:model]
@squeezed_labels_config = squeeze(conf[:labels])

@squeezed_options_config = squeeze(conf[:options])
@squeezed_layout_config = squeeze(conf[:layout])

# Create an empty label conf
@squeezed_labels_config = Settings.new(Hash.new())

# ... the add all the shared labels...
superimpose_shared_file("SharedLanguageLabels.yml")
superimpose_shared_file("SharedISO3166Codes.yml")
superimpose_shared_file("SharedContentLabels.yml")
superimpose_shared_file("SharedKeyOrModes.yml")

# And lastly the actual label conf, so that it
# overrides the shared ones if needed.
# I.e. "a" can be A minor or records.earlier_heading
# depending on the context (but not both)
@squeezed_labels_config = squeeze(conf[:labels])
end

def superimpose_shared_file(name)
Expand Down

0 comments on commit d8e95f4

Please sign in to comment.