1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

AbstractController::Translation#t: dup options

This commit is contained in:
Nazar Matus 2019-02-15 18:21:41 +02:00 committed by GitHub
parent 607470c9b4
commit 341b5176c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ module AbstractController
# to translate many keys within the same controller / action and gives you a # to translate many keys within the same controller / action and gives you a
# simple framework for scoping them consistently. # simple framework for scoping them consistently.
def translate(key, options = {}) def translate(key, options = {})
options = options.dup
if key.to_s.first == "." if key.to_s.first == "."
path = controller_path.tr("/", ".") path = controller_path.tr("/", ".")
defaults = [:"#{path}#{key}"] defaults = [:"#{path}#{key}"]