Merge Request #126
← To merge requests
From
fix_models_translations
into
master
Fix models translations
Atualizado a tradução das mensagens de erro na criação de software e de comunidade
Commits (1)
-
- plugins: gov_user, software_communities - Update translation on errors of create institution - Update translation on error of create software Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com> Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
Showing
7 changed files
Show diff stats
src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
... | ... | @@ -217,8 +217,8 @@ class GovUserPluginController < ApplicationController |
217 | 217 | end |
218 | 218 | |
219 | 219 | def save_institution institution |
220 | - inst_errors = institution.errors.messages | |
221 | - com_errors = institution.community.errors.messages | |
220 | + inst_errors = institution.errors.full_messages | |
221 | + com_errors = institution.community.errors.full_messages | |
222 | 222 | |
223 | 223 | set_errors institution |
224 | 224 | |
... | ... | @@ -230,7 +230,7 @@ class GovUserPluginController < ApplicationController |
230 | 230 | else |
231 | 231 | { :success => false, |
232 | 232 | :message => _("Institution could not be created!"), |
233 | - :errors => inst_errors.merge(com_errors) | |
233 | + :errors => inst_errors + com_errors | |
234 | 234 | } |
235 | 235 | end |
236 | 236 | end | ... | ... |
src/noosfero-spb/gov_user/public/views/create-institution.js
... | ... | @@ -113,12 +113,8 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
113 | 113 | var errors = "<ul>"; |
114 | 114 | var field_name; |
115 | 115 | |
116 | - for(var error_key in response.errors) { | |
117 | - field_name = adjust_error_key(error_key); | |
118 | - | |
119 | - if(response.errors[error_key].length > 0){ | |
120 | - errors += "<li><b>"+field_name+"</b>: "+response.errors[error_key]+"</li>"; | |
121 | - } | |
116 | + for(var error in response.errors) { | |
117 | + errors += "<li>"+response.errors[error]+"</li>"; | |
122 | 118 | } |
123 | 119 | |
124 | 120 | errors += "</ul>"; |
... | ... | @@ -147,14 +143,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
147 | 143 | } |
148 | 144 | |
149 | 145 | |
150 | - function adjust_error_key(error_key) { | |
151 | - var text = error_key.replace(/_/, " "); | |
152 | - text = text.charAt(0).toUpperCase() + text.slice(1); | |
153 | - | |
154 | - return text; | |
155 | - } | |
156 | - | |
157 | - | |
158 | 146 | function save_institution(evt) { |
159 | 147 | evt.preventDefault(); |
160 | 148 | ... | ... |
src/noosfero-spb/software_communities/locales/pt-BR.yml
0 → 100644
... | ... | @@ -0,0 +1,26 @@ |
1 | +# encoding: UTF-8 | |
2 | + | |
3 | +"pt-BR": &pt-BR | |
4 | + | |
5 | + activerecord: | |
6 | + attributes: | |
7 | + community: | |
8 | + name: 'Nome' | |
9 | + state: 'Estado' | |
10 | + city: 'Cidade' | |
11 | + software_info: | |
12 | + finality: 'Finalidade' | |
13 | + license_info: | |
14 | + version: 'Versão' | |
15 | + institution: | |
16 | + name: 'Nome' | |
17 | + state: 'Estado' | |
18 | + city: 'Cidade' | |
19 | + governmental_power: 'Poder Governamental' | |
20 | + governmental_sphere: 'Esfera Governamental' | |
21 | + juridical_nature: 'Natureza Jurídica' | |
22 | + | |
23 | +'pt_BR': | |
24 | + <<: *pt-BR | |
25 | +'pt': | |
26 | + <<: *pt-BR | ... | ... |
src/noosfero-spb/software_communities/po/pt/software_communities.po
... | ... | @@ -860,8 +860,8 @@ msgstr "" |
860 | 860 | "e critérios" |
861 | 861 | |
862 | 862 | #: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22 |
863 | -msgid "\"Can`t create new software: #{@errors.length} errors\"" | |
864 | -msgstr "\"Não foi possível criar o software: #{@errors.length} errors\"" | |
863 | +msgid "Can`t create new software: %s errors" | |
864 | +msgstr "Não foi possível criar o software: %s erros" | |
865 | 865 | |
866 | 866 | #: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45 |
867 | 867 | msgid "Domain" | ... | ... |
src/noosfero-spb/software_communities/po/software_communities.pot
... | ... | @@ -825,7 +825,7 @@ msgid "" |
825 | 825 | msgstr "" |
826 | 826 | |
827 | 827 | #: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22 |
828 | -msgid "\"Can`t create new software: #{@errors.length} errors\"" | |
828 | +msgid "Can`t create new software: %s errors" | |
829 | 829 | msgstr "" |
830 | 830 | |
831 | 831 | #: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45 | ... | ... |
src/noosfero-spb/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | |
20 | 20 | <% unless @errors.blank? %> |
21 | 21 | <div class="errorExplanation" id="errorExplanation"> |
22 | - <h2> <%= _("Can`t create new software: #{@errors.length} errors") %> </h2> | |
22 | + <h2> <%= _("Can`t create new software: %s errors") % @errors.length %> </h2> | |
23 | 23 | <ul> |
24 | 24 | <% @errors.each do |error| %> |
25 | 25 | <li> <%= error %> </li> | ... | ... |
-
Added 42 new commits:
- 738de186 - Disable mailman archiving
- f0f4b848 - Add setting to avoid indexing duplicated content
- 4fc3afb2 - Bump colab-spb-theme version
- 206813e1 - Remove secondary_email from user
- b2fbfd8b - Fix link of categories on categores_and_tags block
- 068e891e - Merge branch 'fix_categories_and_tags_block' into 'master'
- 3e4d6e8e - Bump colab version
- 12917e41 - Merge branch 'mailinglist_summary_page' into 'master'
- 5717fe77 - Fix bug when there was no event to be displayed
- e6f69622 - Merge branch 'fix_event_block_display_bug' into 'master'
- 264f3eae - Merge branch 'master' of beta.softwarepublico.gov.br:softwarepublico/softwarepublico
- 48ccd8fe - Bump colab-spb-theme package version
- 0731f938 - Bump noosfero-spb version
- 180db4e7 - Mailing list summary page
- 0719f15b - Reduced top from total and order text
- 9f2987ed - Merge branch 'mailinglist_page_fix' into 'master'
- d8ea8228 - Bump colab-theme version
- cb360ed8 - Update SISP translations
- 8600e789 - Fix rating form arrow bug
- 30e45981 - Merge branch 'fix_rating_form_addition_fields_bug' into 'master'
- 4ebd3569 - Update event block translation
- d5b7cb34 - Update Sisp admin identifier
- f694996f - Updates SISP migration timestamp
- 223c4d0b - Bump noosfero-spb version
- fdcdb38c - fix load data field on download block edition
- 64717354 - Merge branch 'fix_load_data_on_download_block_edition' into 'master'
- 6e38acc7 - Bump noosfero-spb package Version
- f099ccdc - Bump noosfero version
- 2de9cb34 - Improvements on task that creates discussion list
- f2089124 - Fix translation of categories name
- 02d6694f - Merge branch 'fix_categories_translation' into 'master'
- b66db0d0 - Add label you-are-here based on secom breadcrumbs pattern
- 5188eefd - Merge branch 'add_you_are_here_breadcrumbs_label' into 'master'
- 1eeb5ddb - Fix link to community when there are 2 environments
- 8fb02967 - Fix sisp task
- 8e5713cc - Bump noosfero-spb version
- 68046e28 - Fix visualization of softwares on sisp search applying a generic css solution on…
- c6ac103e - Merge branch 'fix_sisp_search_css' into 'master'
- c5d0378f - Change gitlab cache dir owner.
- 1a89b572 - Merge branch 'gitlab_tmp_cache_dir' into 'master'
- 523171af - Bump colab-spb-theme version
- dd6919c5 - Add locales files into noosfero plugins
-
mentioned in commit 7233d84ea21f3135d88c81518dc31fd048c8e23a
-
mentioned in commit e6b17a7c1eb538bc4ff199103027de1541580777
started a discussion on commit
dd6919c5