Skip to content

Commit

Permalink
Fixes #36839 - Optimize apipie-dsl translate method
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Oct 18, 2023
1 parent 7585e55 commit ec40f41
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions config/initializers/apipie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@
config.default_locale = FastGettext.default_locale
config.locale = ->(loc) { loc ? FastGettext.set_locale(loc) : FastGettext.locale }

config.translate = lambda do |str, loc|
old_loc = FastGettext.locale
FastGettext.set_locale(loc)
trans = _(str) if str
FastGettext.set_locale(old_loc)
trans
end
config.translate = ->(str, loc) { str ? FastGettext.with_locale(loc) { _(str) } : nil }
config.help_layout = 'apipie_dsl/apipie_dsls/help.html.erb'
end

Expand Down

0 comments on commit ec40f41

Please sign in to comment.