Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 5da8aa3

Browse files
committed
ignore empty
1 parent 7029f4d commit 5da8aa3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/translation/category_localizer.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ def self.localize(category, target_locale = I18n.locale)
99
target_locale_sym = target_locale.to_s.sub("-", "_").to_sym
1010

1111
translated_name = ShortTextTranslator.new(category.name, target_locale_sym).translate
12-
# category descriptions are first paragraphs of posts
1312
translated_description =
14-
PostRawTranslator.new(category.description, target_locale_sym).translate
13+
if category.description.present?
14+
PostRawTranslator.new(category.description, target_locale_sym).translate
15+
else
16+
""
17+
end
1518

1619
localization =
1720
CategoryLocalization.find_or_initialize_by(

0 commit comments

Comments
 (0)