Localize anonymous and non member roles names (#8072).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5333 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-04-05 22:37:45 +00:00
parent 5823481d6e
commit 44214ed1aa
46 changed files with 107 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -84,6 +84,14 @@ class Role < ActiveRecord::Base
name
end
def name
case builtin
when 1; l(:label_role_non_member, :default => read_attribute(:name))
when 2; l(:label_role_anonymous, :default => read_attribute(:name))
else; read_attribute(:name)
end
end
# Return true if the role is a builtin role
def builtin?
self.builtin != 0

View File

@ -947,3 +947,5 @@ bg:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -961,3 +961,5 @@ bs:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -950,3 +950,5 @@ ca:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -951,3 +951,5 @@ cs:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -963,3 +963,5 @@ da:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -964,3 +964,5 @@ de:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -947,3 +947,5 @@ el:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -463,6 +463,8 @@ en-GB:
label_role_plural: Roles
label_role_new: New role
label_role_and_permissions: Roles and permissions
label_role_anonymous: Anonymous
label_role_non_member: Non member
label_member: Member
label_member_new: New member
label_member_plural: Members

View File

@ -459,6 +459,8 @@ en:
label_role_plural: Roles
label_role_new: New role
label_role_and_permissions: Roles and permissions
label_role_anonymous: Anonymous
label_role_non_member: Non member
label_member: Member
label_member_new: New member
label_member_plural: Members

View File

@ -984,3 +984,5 @@ es:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -951,3 +951,5 @@ eu:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -950,3 +950,5 @@ fa:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -968,3 +968,5 @@ fi:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -462,6 +462,8 @@ fr:
label_role_plural: Rôles
label_role_new: Nouveau rôle
label_role_and_permissions: Rôles et permissions
label_role_anonymous: Anonyme
label_role_non_member: Non membre
label_member: Membre
label_member_new: Nouveau membre
label_member_plural: Membres

View File

@ -959,3 +959,5 @@ gl:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -952,3 +952,5 @@ he:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -954,3 +954,5 @@ hr:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -966,3 +966,5 @@
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -955,3 +955,5 @@ id:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -948,3 +948,5 @@ it:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -968,3 +968,5 @@ ja:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -999,3 +999,5 @@ ko:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -1007,3 +1007,5 @@ lt:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -942,3 +942,5 @@ lv:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -947,3 +947,5 @@ mk:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -948,3 +948,5 @@ mn:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -929,3 +929,5 @@ nl:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -934,3 +934,5 @@
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -964,3 +964,5 @@ pl:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -970,3 +970,5 @@ pt-BR:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -951,3 +951,5 @@ pt:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -940,3 +940,5 @@ ro:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -1060,3 +1060,5 @@ ru:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -942,3 +942,5 @@ sk:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -943,3 +943,5 @@ sl:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -947,3 +947,5 @@ sr-YU:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -948,3 +948,5 @@ sr:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -988,3 +988,5 @@ sv:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -944,3 +944,5 @@ th:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -966,3 +966,5 @@ tr:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -943,3 +943,5 @@ uk:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -998,3 +998,5 @@ vi:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -1029,3 +1029,5 @@
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -961,3 +961,5 @@ zh:
label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
label_bulk_edit_selected_time_entries: Bulk edit selected time entries
text_time_entries_destroy_confirmation: Are you sure you want to delete the selected time entr(y/ies)?
label_role_anonymous: Anonymous
label_role_non_member: Non member

View File

@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -49,6 +49,13 @@ class RoleTest < ActiveSupport::TestCase
assert ! role.permissions.include?(perm[0])
assert_equal size - 2, role.permissions.size
end
def test_name
I18n.locale = 'fr'
assert_equal 'Manager', Role.find(1).name
assert_equal 'Anonyme', Role.anonymous.name
assert_equal 'Non membre', Role.non_member.name
end
context "#anonymous" do
should "return the anonymous role" do