[Git][noosfero/noosfero][stable-1.7] Merge branch 'translation_fixes' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Fri Feb 3 17:37:12 BRST 2017


Rodrigo Souto pushed to branch stable-1.7 at Noosfero / noosfero


Commits:
0936072a by Rodrigo Souto at 2017-02-03T19:37:10+00:00
Merge branch 'translation_fixes' into 'master'

Fixes translation issues

See merge request !1106
- - - - -


3 changed files:

- app/helpers/profile_helper.rb
- app/helpers/search_helper.rb
- app/views/search/search_page.html.erb


Changes:

=====================================
app/helpers/profile_helper.rb
=====================================
--- a/app/helpers/profile_helper.rb
+++ b/app/helpers/profile_helper.rb
@@ -34,17 +34,21 @@ module ProfileHelper
     :organization => [:blogs, :image_galleries, :interests],
   }
 
-  CUSTOM_LABELS = {
-    :zip_code => _('ZIP code'),
-    :email => _('e-Mail'),
-    :jabber_id => _('Jabber'),
-    :birth_date => _('Date of birth'),
-    :created_at => _('Profile created at'),
-    :members_count => _('Members'),
-    :privacy_setting => _('Privacy setting'),
-    :article_tags => _('Tags'),
-    :followed_profiles => _('Following')
-  }
+  def custom_labels
+    {
+      :zip_code => _('ZIP code'),
+      :email => _('e-Mail'),
+      :jabber_id => _('Jabber'),
+      :birth_date => _('Date of birth'),
+      :created_at => _('Profile created at'),
+      :members_count => _('Members'),
+      :privacy_setting => _('Privacy setting'),
+      :article_tags => _('Tags'),
+      :followed_profiles => _('Following'),
+      :basic_information => _('Basic information'),
+      :contact => _('Contact')
+    }
+  end
 
   EXCEPTION = {
     :person => [:image, :preferred_domain, :description, :tag_list],
@@ -66,7 +70,7 @@ module ProfileHelper
 
   def title(field, entry = nil)
     return self.send("#{field}_custom_title", entry) if MULTIPLE[kind].include?(field) && entry.present?
-    CUSTOM_LABELS[field.to_sym] || _(field.to_s.humanize)
+    custom_labels[field.to_sym] || _(field.to_s.humanize)
   end
 
   def display_field(field)


=====================================
app/helpers/search_helper.rb
=====================================
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -27,6 +27,13 @@ module SearchHelper
     :communities
   ]
 
+  def asset_to_human(asset)
+    custom_names = {
+      articles:    _('content')
+    }
+    custom_names[asset] || _(asset.to_s.singularize)
+  end
+
   # FIXME remove it after search_controler refactored
   include EventsHelper
 


=====================================
app/views/search/search_page.html.erb
=====================================
--- a/app/views/search/search_page.html.erb
+++ b/app/views/search/search_page.html.erb
@@ -1,4 +1,4 @@
-<%= render :partial => 'search_form', :locals => { :hint => _("Type words about the %s you're looking for").html_safe % _(@asset.to_s.singularize) } %>
+<%= render :partial => 'search_form', :locals => { :hint => _("Type words about the %s you're looking for").html_safe % asset_to_human(@asset) } %>
 <%= render :partial => 'search_content' %>
 
 <div style="clear: both"></div>



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/0936072a7d9c105f3b4eb45abe3212c280141724
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170203/a5387da4/attachment-0001.html>


More information about the Noosfero-dev mailing list