Skip to content

Commit 6298539

Browse files
committed
🏌
1 parent 2c1f1ab commit 6298539

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

plugin.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff 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
7774
end

0 commit comments

Comments
 (0)