fix importer keyless translation error
unfortunately this error originally occured inside a rescue block for a media upload error (which should be fairly rare), so we won't be able reproduce it with any degree of reliability closes #CNVS-20632 Change-Id: Ic3375f81d7ee4490ec55247a74ae67a29235ff7d Reviewed-on: https://gerrit.instructure.com/54924 Tested-by: Jenkins Reviewed-by: Jeremy Stanley <jeremy@instructure.com> Product-Review: James Williams <jamesw@instructure.com> QA-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
43eeb1c2d6
commit
5b34c605d9
|
@ -15,9 +15,9 @@ module Importers
|
|||
attr_accessor :item_class
|
||||
|
||||
# forward translations to CalendarEvent; they used to live there.
|
||||
def translate(key, default, options = {})
|
||||
def translate(*args)
|
||||
raise "Needs self.item_class to be set in #{self}" unless self.item_class
|
||||
self.item_class.translate(key, default, options)
|
||||
self.item_class.translate(*args)
|
||||
end
|
||||
alias :t :translate
|
||||
|
||||
|
|
|
@ -339,6 +339,10 @@ describe Course do
|
|||
Importers::CourseContentImporter.import_content(@course, data, params, migration)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should be able to i18n without keys' do
|
||||
Importers::CourseContentImporter.translate('stuff')
|
||||
end
|
||||
end
|
||||
|
||||
def from_file_path(path, course)
|
||||
|
|
Loading…
Reference in New Issue