faq translations in seed are being generated
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
if SiteCustomization::Page.find_by(slug: "faq").nil?
|
||||
page = SiteCustomization::Page.new(slug: "faq", status: "published")
|
||||
def generate_content(page)
|
||||
page.title = I18n.t("pages.help.faq.page.title")
|
||||
page.content = "<p>#{I18n.t("pages.help.faq.page.description")}</p>"
|
||||
page.save!
|
||||
end
|
||||
if SiteCustomization::Page.find_by(slug: "faq").nil?
|
||||
page = SiteCustomization::Page.new(slug: "faq", status: "published")
|
||||
generate_content(page)
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.locale = locale
|
||||
translation = page.translations.build(locale: locale)
|
||||
generate_content(translation)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user