From a164bdc0cd8fc1d953807a0d42f05d8435bf77bf Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 21 Jul 2008 23:01:25 +0000 Subject: [PATCH] ActionItem523: calling "Communities" as "Groups" --- app/controllers/public/search_controller.rb | 4 ++-- app/helpers/assets_helper.rb | 2 +- app/models/communities_block.rb | 10 +++++----- app/views/memberships/index.rhtml | 2 +- app/views/profile/index.rhtml | 2 +- lib/noosfero/core_ext/object.rb | 1 + lib/zen3_terminology.rb | 7 ++++++- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index 88d9174..32ef73b 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -167,13 +167,13 @@ class SearchController < ApplicationController where_to_search.select { |key,description| @searching[key] }.each do |key, description| @order << key @results[key] = @finder.find(key, @filtered_query, calculate_find_options(key, limit, params[:page], @product_category, @region, params[:radius], params[:year], params[:month])) - @names[key] = gettext(description) + @names[key] = getterm(description) end if @results.keys.size == 1 specific_action = @results.keys.first if respond_to?(specific_action) - @asset_name = gettext(@names[@results.keys.first]) + @asset_name = getterm(@names[@results.keys.first]) send(specific_action) render :action => specific_action return diff --git a/app/helpers/assets_helper.rb b/app/helpers/assets_helper.rb index d63eb7c..bce1e10 100644 --- a/app/helpers/assets_helper.rb +++ b/app/helpers/assets_helper.rb @@ -8,7 +8,7 @@ module AssetsHelper [ options.merge(:asset => 'people'), "icon-menu-people", _('People') ], [ options.merge(:asset => 'products'), "icon-menu-product", _('Products') ], [ options.merge(:asset => 'enterprises'), "icon-menu-enterprise", _('Enterprises') ], - [ options.merge(:asset => 'communities'), "icon-menu-community", _('Communities') ], + [ options.merge(:asset => 'communities'), "icon-menu-community", __('Communities') ], [ options.merge(:asset => 'events'), "icon-menu-events", _('Events') ], ].select do |target, css_class, name| diff --git a/app/models/communities_block.rb b/app/models/communities_block.rb index bf4845f..06779c9 100644 --- a/app/models/communities_block.rb +++ b/app/models/communities_block.rb @@ -1,15 +1,15 @@ class CommunitiesBlock < ProfileListBlock def self.description - _('A block that displays your communities') + __('A block that displays your communities') end def default_title - _('Communities') + __('Communities') end def help - _('The communities in which the user is a member') + __('The communities in which the user is a member') end def footer @@ -17,11 +17,11 @@ class CommunitiesBlock < ProfileListBlock case owner when Profile lambda do - link_to _('All communities'), :profile => owner.identifier, :controller => 'profile', :action => 'communities' + link_to __('All communities'), :profile => owner.identifier, :controller => 'profile', :action => 'communities' end when Environment lambda do - link_to _('All communities'), :controller => 'search', :action => 'assets', :asset => 'communities' + link_to __('All communities'), :controller => 'search', :action => 'assets', :asset => 'communities' end else '' diff --git a/app/views/memberships/index.rhtml b/app/views/memberships/index.rhtml index b3b7a76..c4fde80 100644 --- a/app/views/memberships/index.rhtml +++ b/app/views/memberships/index.rhtml @@ -11,7 +11,7 @@ <%= membership.display_name %>
<%= _('Role: %s') % rolename_for(profile, membership) %>
- <%= _('Type: %s') % _(membership.class.name) %>
+ <%= _('Type: %s') % getterm(membership.class.name) %>
<%= _('Description: %s') % membership.description + '
' if membership.community? %> <%= _('Members: %s') % membership.members.size.to_s %>
<%= _('Created at: %s') % show_date(membership.created_at) %>
diff --git a/app/views/profile/index.rhtml b/app/views/profile/index.rhtml index dd41ce4..71ee239 100644 --- a/app/views/profile/index.rhtml +++ b/app/views/profile/index.rhtml @@ -19,7 +19,7 @@ <%# FIXME %> <% if profile.kind_of? Person %>
  • <%= link_to _('Friends'), :action => 'friends' %>
  • -
  • <%= link_to _('Communities'), :action => 'communities' %>
  • +
  • <%= link_to __('Communities'), :action => 'communities' %>
  • <%= link_to _('Enterprises'), :action => 'enterprises' %>
  • <% end %> <% if profile.kind_of? Organization %> diff --git a/lib/noosfero/core_ext/object.rb b/lib/noosfero/core_ext/object.rb index c7f3ba9..2036bf9 100644 --- a/lib/noosfero/core_ext/object.rb +++ b/lib/noosfero/core_ext/object.rb @@ -2,4 +2,5 @@ class Object def __(*args) gettext(Noosfero.term(*args)) end + alias :getterm :__ end diff --git a/lib/zen3_terminology.rb b/lib/zen3_terminology.rb index 6d3f700..24ce353 100644 --- a/lib/zen3_terminology.rb +++ b/lib/zen3_terminology.rb @@ -7,7 +7,12 @@ class Zen3Terminology < Noosfero::Terminology::Custom # NOTE: the hash values must be marked for translation!! super({ 'My Home Page' => N_('My ePortfolio'), - 'Homepage' => N_('ePortfolio') + 'Homepage' => N_('ePortfolio'), + 'Communities' => N_('Groups'), + 'A block that displays your communities' => N_('A block that displays your groups'), + 'The communities in which the user is a member' => N_('The groups in which the user is a member'), + 'All communities' => N_('All groups'), + 'Community' => N_('Group'), }) end -- libgit2 0.21.2