We had the same texts four times, with slight variations in the case of the management section. We're unifying them under the "verification" i18n namespace, since the texts are about actions which can be done depending on whether users are verified or not. Note the names of the i18n keys aren't very consistent, since we use "debates" in plural but "proposal" in singular. We're leaving it like this so existing translations aren't affected.
29 lines
1.2 KiB
Ruby
29 lines
1.2 KiB
Ruby
def generate_content(page)
|
|
page.title = I18n.t("welcome.welcome.title")
|
|
|
|
page.content = "<p>#{I18n.t("welcome.welcome.user_permission_info")}</p>
|
|
<ul>
|
|
<li>#{I18n.t("verification.user_permission_debates")}</li>
|
|
<li>#{I18n.t("verification.user_permission_proposal")}</li>
|
|
<li>#{I18n.t("verification.user_permission_support_proposal")}</li>
|
|
</ul>
|
|
|
|
<p>#{I18n.t("welcome.welcome.user_permission_verify")}</p>
|
|
<ul>
|
|
<li>#{I18n.t("verification.user_permission_votes")}</li>
|
|
</ul>
|
|
|
|
<a href='/verification' class='button success radius expand'>
|
|
#{I18n.t("welcome.welcome.user_permission_verify_my_account")}
|
|
</a>
|
|
|
|
<p><a href='/'>#{I18n.t("welcome.welcome.go_to_index")}</a></p>"
|
|
page.save!
|
|
end
|
|
if SiteCustomization::Page.find_by(slug: "welcome_level_two_verified").nil?
|
|
page = SiteCustomization::Page.new(slug: "welcome_level_two_verified", status: "published")
|
|
I18n.available_locales.each do |locale|
|
|
I18n.with_locale(locale) { generate_content(page) }
|
|
end
|
|
end
|