Skip to content

Commit

Permalink
Changes to allow pt-BR variant to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
basicavisual committed Dec 21, 2023
1 parent dd305fd commit 63b3af7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
8 changes: 5 additions & 3 deletions config/locales/pt.yml → config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
pt:
pt-BR:
activemodel:
attributes:
content_block_attachment:
background_image: Imagem de fundo
meeting:
end_time: Hora de término
iframe_embed_type: Tipo de iframe a embeber
Expand Down Expand Up @@ -797,7 +799,7 @@ pt:
admin:
import_results:
new:
download_export: Baixe a Exportação com formato CSV
download_export: "Baixe a Exportação com formato CSV"
info: |
<p>Nós recomendamos que você siga esses passos:</p>
<ol>
Expand All @@ -818,7 +820,7 @@ pt:
<li><b>ids_propostos:</b> Identificadores interno das propostas relacionadas (serparadas por vírgula). É automaticamente convertida para <span class='attribute-name'>url_proposta</span></li>
</ul>
</li>
</ol>
</ol>
admin_log:
status:
create: "%{user_name} criou o status %{resource_name} "
Expand Down
4 changes: 2 additions & 2 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
decidim_default: &decidim_default
application_name: <%= Decidim::Env.new("DECIDIM_APPLICATION_NAME", "My Application Name").to_json %>
mailer_sender: <%= Decidim::Env.new("DECIDIM_MAILER_SENDER", "change-me@example.org").to_s %>
available_locales: <%= Decidim::Env.new("DECIDIM_AVAILABLE_LOCALES", "ca,cs,de,en,es,eu,fi,fr,it,ja,nl,pl,pt,ro").to_array.to_json %>
default_locale: <%= Decidim::Env.new("DECIDIM_DEFAULT_LOCALE", "en").to_s %>
available_locales: <%= Decidim::Env.new("DECIDIM_AVAILABLE_LOCALES", "ca,cs,de,en,es,eu,fi,fr,it,ja,nl,pl,pt,ro,pt-BR").to_array.to_json %>
default_locale: <%= Decidim::Env.new("DECIDIM_DEFAULT_LOCALE", "pt-BR").to_s %>
force_ssl: <%= Decidim::Env.new("DECIDIM_FORCE_SSL", "auto").default_or_present_if_exists.to_s %>
enable_html_header_snippets: <%= Decidim::Env.new("DECIDIM_ENABLE_HTML_HEADER_SNIPPETS").to_boolean_string %>
currency_unit: <%= Decidim::Env.new("DECIDIM_CURRENCY_UNIT", "€").to_s %>
Expand Down
4 changes: 2 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
secondary_hosts: ["0.0.0.0", "127.0.0.1"],
external_domain_whitelist: ["decidim.org", "github.com"],
description: "",
default_locale: "pt",
available_locales: ["pt"],
default_locale: "pt-BR",
available_locales: ["pt-BR"],
reference_prefix: "minutas",
available_authorizations: Decidim.authorization_workflows.map(&:name),
users_registration_mode: :enabled,
Expand Down
22 changes: 22 additions & 0 deletions lib/tasks/local_to_pt_br.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require './config/environment'
# This task should
namespace :cominutas do
task :local_to_pt_br do

desc "Run this once to update organization to pt-BR"
puts "Following this guide: https://docs.decidim.org/en/v0.27/develop/fixing_locales.html"

puts "Updating organization locale's to pt-BR"
org = Decidim::Organization.first
org.available_locales = ["pt-BR"]
org.default_locale = "pt-BR"
org.save!
puts "updated locale to #{org.available_locales.to_s}"
puts "updated locale to #{org.default_locale}"

puts "Synchronizing all locales"
Rake::Task["decidim:locales:sync_all"].invoke
puts "rebuilding search index"
Rake::Task["decidim:locales:rebuild_search"].invoke
end
end

0 comments on commit 63b3af7

Please sign in to comment.