<div class='join-leave-button'>
  <% if logged_in? %>
    <% if profile.members.include?(user) %>
      <%= button(:delete, content_tag('span', _('Leave community')), profile.leave_url,
        :class => 'leave-community',
        :title => _("Leave community"),
        :style => 'position: relative;') %>
      <%= button(:add, content_tag('span', _('Join')), profile.join_url,
        :class => 'join-community',
        :title => _("Join community"),
        :style => 'position: relative; display: none;') %>
    <% else %>
      <% unless profile.already_request_membership?(user) %>
        <%= button(:delete, content_tag('span', _('Leave community')), profile.leave_url,
          :class => 'leave-community',
          :title => _("Leave community"),
          :style => 'position: relative; display: none;') %>
        <%= button(:add, content_tag('span', _('Join')), profile.join_url,
          :class => 'join-community',
          :title => _("Join community"),
          :style => 'position: relative;') %>
      <% end %>
    <% end %>
  <% else %>
      <%= button(:add, _('Join'), profile.join_not_logged_url, :title => _('Join this community')) %>
  <% end %>
</div>

<div class='join-leave-button'>
  <% if logged_in? %>
    <% if profile.members.include?(user) %>
      <%= button(:delete, content_tag('span', _('Leave community')), profile.leave_url,
        :class => 'leave-community',
        :title => _("Leave community"),
        :style => 'position: relative;') %>
      <%= button(:add, content_tag('span', __('Join this community')), profile.join_url,
        :class => 'join-community',
        :title => _("Join community"),
        :style => 'position: relative; display: none;') %>
    <% else %>
      <% unless profile.already_request_membership?(user) %>
        <%= button(:delete, content_tag('span', _('Leave community')), profile.leave_url,
          :class => 'leave-community',
          :title => _("Leave community"),
          :style => 'position: relative; display: none;') %>
        <%= button(:add, content_tag('span', __('Join this community')), profile.join_url,
          :class => 'join-community',
          :title => _("Join community"),
          :style => 'position: relative;') %>
      <% end %>
    <% end %>
  <% else %>
      <%= button(:add, _('Join'), profile.join_not_logged_url, :title => _('Join this community')) %>
  <% end %>
</div>

Change join community text to differ from login
Change join community text to differ from login
