Skip to content

Commit

Permalink
Refs #36575 - Avoid translations during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Jul 7, 2023
1 parent 30bedf7 commit e902a84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/concerns/api/v2/taxonomies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module Api::V2::TaxonomiesController
param :ignore_types, Array, N_("List of resources types that will be automatically associated"), :required => false
resource_name = (param_name == :location) ? 'organization' : 'location'
resource_ids = "#{resource_name}_ids".to_sym
param resource_ids, Array, N_("Associated %{resource} IDs") % { resource: _(resource_name) }, :required => false
# TODO: translate resource_name?
param resource_ids, Array, N_("Associated %{resource} IDs") % { resource: resource_name }, :required => false
end
end

Expand Down
5 changes: 4 additions & 1 deletion app/services/input_type/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ def self.attributes(*attrs)

def self.api_params_for_input_group(context)
attributes.each do |attr|
# TODO: humanized_name is translated, but that can't work
context.param attr, String, required: false,
desc: format(N_('%{input_type_attr_name}, used when input type is %{input_type}'), input_type_attr_name: attr.to_s.humanize, input_type: humanized_name)
desc: format(N_('%{input_type_attr_name}, used when input type is %{input_type}'),
input_type_attr_name: ->() { attr.to_s.humanize },
input_type: ->() { humanized_name })
end
end

Expand Down

0 comments on commit e902a84

Please sign in to comment.