diff --git a/src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb b/src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
index cda91d5..04b94b7 100644
--- a/src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
+++ b/src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
@@ -217,8 +217,8 @@ class GovUserPluginController < ApplicationController
end
def save_institution institution
- inst_errors = institution.errors.messages
- com_errors = institution.community.errors.messages
+ inst_errors = institution.errors.full_messages
+ com_errors = institution.community.errors.full_messages
set_errors institution
@@ -230,7 +230,7 @@ class GovUserPluginController < ApplicationController
else
{ :success => false,
:message => _("Institution could not be created!"),
- :errors => inst_errors.merge(com_errors)
+ :errors => inst_errors + com_errors
}
end
end
diff --git a/src/noosfero-spb/gov_user/locales/pt-BR.yml b/src/noosfero-spb/gov_user/locales/pt-BR.yml
new file mode 120000
index 0000000..f1231ae
--- /dev/null
+++ b/src/noosfero-spb/gov_user/locales/pt-BR.yml
@@ -0,0 +1 @@
+../../software_communities/locales/pt-BR.yml
\ No newline at end of file
diff --git a/src/noosfero-spb/gov_user/public/views/create-institution.js b/src/noosfero-spb/gov_user/public/views/create-institution.js
index 8082693..61578c1 100644
--- a/src/noosfero-spb/gov_user/public/views/create-institution.js
+++ b/src/noosfero-spb/gov_user/public/views/create-institution.js
@@ -113,12 +113,8 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement']
var errors = "
";
var field_name;
- for(var error_key in response.errors) {
- field_name = adjust_error_key(error_key);
-
- if(response.errors[error_key].length > 0){
- errors += "- "+field_name+": "+response.errors[error_key]+"
";
- }
+ for(var error in response.errors) {
+ errors += "- "+response.errors[error]+"
";
}
errors += "
";
@@ -147,14 +143,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement']
}
- function adjust_error_key(error_key) {
- var text = error_key.replace(/_/, " ");
- text = text.charAt(0).toUpperCase() + text.slice(1);
-
- return text;
- }
-
-
function save_institution(evt) {
evt.preventDefault();
diff --git a/src/noosfero-spb/software_communities/locales/pt-BR.yml b/src/noosfero-spb/software_communities/locales/pt-BR.yml
new file mode 100644
index 0000000..ea6f7dc
--- /dev/null
+++ b/src/noosfero-spb/software_communities/locales/pt-BR.yml
@@ -0,0 +1,26 @@
+# encoding: UTF-8
+
+"pt-BR": &pt-BR
+
+ activerecord:
+ attributes:
+ community:
+ name: 'Nome'
+ state: 'Estado'
+ city: 'Cidade'
+ software_info:
+ finality: 'Finalidade'
+ license_info:
+ version: 'Versão'
+ institution:
+ name: 'Nome'
+ state: 'Estado'
+ city: 'Cidade'
+ governmental_power: 'Poder Governamental'
+ governmental_sphere: 'Esfera Governamental'
+ juridical_nature: 'Natureza Jurídica'
+
+'pt_BR':
+ <<: *pt-BR
+'pt':
+ <<: *pt-BR
diff --git a/src/noosfero-spb/software_communities/po/pt/software_communities.po b/src/noosfero-spb/software_communities/po/pt/software_communities.po
index 4fdbc37..f55313f 100644
--- a/src/noosfero-spb/software_communities/po/pt/software_communities.po
+++ b/src/noosfero-spb/software_communities/po/pt/software_communities.po
@@ -860,8 +860,8 @@ msgstr ""
"e critérios"
#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22
-msgid "\"Can`t create new software: #{@errors.length} errors\""
-msgstr "\"Não foi possível criar o software: #{@errors.length} errors\""
+msgid "Can`t create new software: %s errors"
+msgstr "Não foi possível criar o software: %s erros"
#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45
msgid "Domain"
diff --git a/src/noosfero-spb/software_communities/po/software_communities.pot b/src/noosfero-spb/software_communities/po/software_communities.pot
index e42e65d..b701d23 100644
--- a/src/noosfero-spb/software_communities/po/software_communities.pot
+++ b/src/noosfero-spb/software_communities/po/software_communities.pot
@@ -825,7 +825,7 @@ msgid ""
msgstr ""
#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22
-msgid "\"Can`t create new software: #{@errors.length} errors\""
+msgid "Can`t create new software: %s errors"
msgstr ""
#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45
diff --git a/src/noosfero-spb/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb b/src/noosfero-spb/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb
index ad9795d..2eeeaca 100644
--- a/src/noosfero-spb/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb
+++ b/src/noosfero-spb/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb
@@ -19,7 +19,7 @@
<% unless @errors.blank? %>
-
<%= _("Can`t create new software: #{@errors.length} errors") %>
+
<%= _("Can`t create new software: %s errors") % @errors.length %>
<% @errors.each do |error| %>
- <%= error %>
--
libgit2 0.21.2