OSDN Git Service

Localize anonymous and non member roles names (#8072).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 5 Apr 2011 22:37:45 +0000 (22:37 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 5 Apr 2011 22:37:45 +0000 (22:37 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5333 e93f8b46-1217-0410-a6f0-8f06a7374b81

46 files changed:
app/models/role.rb
config/locales/bg.yml
config/locales/bs.yml
config/locales/ca.yml
config/locales/cs.yml
config/locales/da.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en-GB.yml
config/locales/en.yml
config/locales/es.yml
config/locales/eu.yml
config/locales/fa.yml
config/locales/fi.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/he.yml
config/locales/hr.yml
config/locales/hu.yml
config/locales/id.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/lt.yml
config/locales/lv.yml
config/locales/mk.yml
config/locales/mn.yml
config/locales/nl.yml
config/locales/no.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/pt.yml
config/locales/ro.yml
config/locales/ru.yml
config/locales/sk.yml
config/locales/sl.yml
config/locales/sr-YU.yml
config/locales/sr.yml
config/locales/sv.yml
config/locales/th.yml
config/locales/tr.yml
config/locales/uk.yml
config/locales/vi.yml
config/locales/zh-TW.yml
config/locales/zh.yml
test/unit/role_test.rb

index 6a4b9e4..e0b1843 100644 (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
index 07c6696..05a16ec 100644 (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
index 4621500..03a7459 100644 (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
index b39f14c..351a4e6 100644 (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
index a742394..880b0cd 100644 (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
index dbbda7b..7c50ba5 100644 (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
index 669399e..a0aca66 100644 (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
index 595fec5..9a44a0a 100644 (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
index be74724..3b1a135 100644 (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
index 49c2bdb..892f72f 100644 (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
index 64fc9e3..c1f4652 100644 (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
index 2ccb140..9b9bad4 100644 (file)
@@ -951,3 +951,5 @@ eu:
   label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author\r
   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\r
+  label_role_non_member: Non member\r
index a6a8552..a9db2d8 100644 (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
index 07223c4..4fac895 100644 (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
index 21268f3..e5b2c28 100644 (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
index 4bacae7..3378be1 100644 (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
index 7251ef8..9e4be72 100644 (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
index e37d4d4..1124174 100644 (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
index 0e8cc3f..69f749e 100644 (file)
   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
index fb415bb..fc683a6 100644 (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
index ea0cedf..e6fcb1e 100644 (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
index 0634c4a..9b01828 100644 (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
index cadabff..6f20897 100644 (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
index 1d835d0..3d9b4b9 100644 (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
index 319edf0..025dea1 100644 (file)
@@ -942,3 +942,5 @@ lv:
   label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author\r
   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\r
+  label_role_non_member: Non member\r
index 44cce07..20e07c5 100644 (file)
@@ -947,3 +947,5 @@ mk:
   label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author\r
   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\r
+  label_role_non_member: Non member\r
index 55296eb..2e0fcb4 100644 (file)
@@ -948,3 +948,5 @@ mn:
   label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author\r
   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\r
+  label_role_non_member: Non member\r
index 012b96f..4f9cf5a 100644 (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
index dd0f2f1..9066cd4 100644 (file)
   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
index 0625321..ad52ee9 100644 (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
index 8b39b9f..d0a9ae8 100644 (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
index 1b12f9a..4ede8c4 100644 (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
index dc86f3e..24a6d15 100644 (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
index d399a68..817f4e2 100644 (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
index 43ab7ed..c21d4a5 100644 (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
index 6db69b6..c3ebd5e 100644 (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
index 9a2412b..ad6f2e4 100644 (file)
@@ -947,3 +947,5 @@ sr-YU:
   label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author\r
   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\r
+  label_role_non_member: Non member\r
index 7e33ded..9acd1af 100644 (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
index ed8312a..3255c88 100644 (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
index 1e6ff79..cae6b73 100644 (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
index 98a10e4..6110952 100644 (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
index 378cc3a..3503dc0 100644 (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
index 823ba18..e56477a 100644 (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
index 89444bb..66b37f6 100644 (file)
   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
index e51803a..b84c711 100644 (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
index 41ad7e8..225219e 100644 (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