File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ module ::DiscourseTranslator
4848 serializer . object . detected_locale == I18n . locale . to_s . gsub ( "_" , "-" )
4949 cooked
5050 else
51- translation = serializer . object . translation_for ( I18n . locale )
52- translation if translation . present?
51+ serializer . object . translation_for ( I18n . locale ) . presence
5352 end
5453 end
5554
@@ -59,8 +58,7 @@ module ::DiscourseTranslator
5958 serializer . object . detected_locale == I18n . locale . to_s . gsub ( "_" , "-" )
6059 fancy_title
6160 else
62- translation = serializer . object . translation_for ( I18n . locale )
63- translation if translation . present?
61+ serializer . object . translation_for ( I18n . locale ) . presence
6462 end
6563 end
6664
@@ -70,8 +68,7 @@ module ::DiscourseTranslator
7068 serializer . object . topic . detected_locale == I18n . locale . to_s . gsub ( "_" , "-" )
7169 fancy_title
7270 else
73- translation = serializer . object . topic . translation_for ( I18n . locale )
74- translation if translation . present?
71+ serializer . object . topic . translation_for ( I18n . locale ) . presence
7572 end
7673 end
7774end
You can’t perform that action at this time.
0 commit comments