diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index ee929e9..02e0df2 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -10,7 +10,6 @@ class ApplicationController < ActionController::Base
# Be sure to include AuthenticationSystem in Application Controller instead
include AuthenticatedSystem
extend PermissionCheck
-
init_gettext 'noosfero'
before_filter :detect_stuff_by_domain, :load_profile_from_params
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 36b17a5..c716990 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,7 +1,8 @@
# Methods added to this helper will be available to all templates in the
# application.
module ApplicationHelper
-
+ include PermissionName
+
# Displays context help. You can pass the content of the help message as the
# first parameter or using template code inside a block passed to this
# method. *Note*: the block is ignored if content is not
diff --git a/app/models/profile.rb b/app/models/profile.rb
index aef8a31..c2b14f8 100644
--- a/app/models/profile.rb
+++ b/app/models/profile.rb
@@ -3,6 +3,13 @@
# which by default is the one returned by Environment:default.
class Profile < ActiveRecord::Base
+ PERMISSIONS[:profile] = {
+ 'edit_profile' => N_('Edit profile'),
+ 'destroy_profile' => N_('Destroy profile'),
+ 'manage_memberships' => N_('Manage memberships'),
+ 'post_content' => N_('Post content'),
+ }
+
after_create do |profile|
homepage = Article.new
homepage.title = profile.name
diff --git a/app/views/role/_form.rhtml b/app/views/role/_form.rhtml
index ec337b0..9e7bf39 100644
--- a/app/views/role/_form.rhtml
+++ b/app/views/role/_form.rhtml
@@ -5,8 +5,8 @@
<%= f.text_field :name %>
<%= _('Permissions: ') %>
- <% Role::PERMISSIONS[:profile].keys.each do |p| %>
- <%= labelled_form_field(Role.permission_name(p), (check_box_tag "role[permissions][]", p, @role.has_permission?(p))) %>
+ <% Profile::PERMISSIONS[:profile].keys.each do |p| %>
+ <%= labelled_form_field(permission_name(p), (check_box_tag "role[permissions][]", p, @role.has_permission?(p))) %>
<% end %>
<%= submit_tag (mode == :edit) ? _('Save changes') : _('Create role')%>
diff --git a/app/views/role/show.rhtml b/app/views/role/show.rhtml
index 3e89eec..5db3517 100644
--- a/app/views/role/show.rhtml
+++ b/app/views/role/show.rhtml
@@ -3,7 +3,7 @@