Merge Request #126

Merged
softwarepublico/softwarepublico!126
Created by Luciano Prestes

Fix models translations

Atualizado a tradução das mensagens de erro na criação de software e de comunidade

Assignee: Daniela Feitosa
Milestone: None

Merged by Daniela Feitosa

Source branch has been removed
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>
    Luciano Prestes
     
2 participants
src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
... ... @@ -217,8 +217,8 @@ class GovUserPluginController &lt; 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 &lt; 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/locales/pt-BR.yml 0 → 120000
... ... @@ -0,0 +1 @@
  1 +../../software_communities/locales/pt-BR.yml
0 2 \ No newline at end of file
... ...
src/noosfero-spb/gov_user/public/views/create-institution.js
... ... @@ -113,12 +113,8 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
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(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
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 &quot;&quot;
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 &quot;&quot;
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>
... ...
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    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
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela
    Choose File ...   File name...
    Cancel
  • D06c8bf1c58ad143edc3f9314c51ed9f?s=40&d=identicon
    Luciano Prestes started a discussion on commit dd6919c5
    last updated by Luciano Prestes
  • D06c8bf1c58ad143edc3f9314c51ed9f?s=40&d=identicon
    Luciano Prestes @lucianopc
    Choose File ...   File name...
    Cancel