Revision 1298:4f746d8966dd .svn/pristine/15
| .svn/pristine/15/150305318b29a9433291a10fc5660acea2682a2e.svn-base | ||
|---|---|---|
| 1 |
// ** I18N |
|
| 2 |
|
|
| 3 |
// Calendar BG language |
|
| 4 |
// Author: Nikolay Solakov, <thoranga@gmail.com> |
|
| 5 |
// Encoding: any |
|
| 6 |
// Distributed under the same terms as the calendar itself. |
|
| 7 |
|
|
| 8 |
// For translators: please use UTF-8 if possible. We strongly believe that |
|
| 9 |
// Unicode is the answer to a real internationalized world. Also please |
|
| 10 |
// include your contact information in the header, as can be seen above. |
|
| 11 |
|
|
| 12 |
// full day names |
|
| 13 |
Calendar._DN = new Array |
|
| 14 |
("Неделя",
|
|
| 15 |
"Понеделник", |
|
| 16 |
"Вторник", |
|
| 17 |
"Сряда", |
|
| 18 |
"Четвъртък", |
|
| 19 |
"Петък", |
|
| 20 |
"Събота", |
|
| 21 |
"Неделя"); |
|
| 22 |
|
|
| 23 |
// Please note that the following array of short day names (and the same goes |
|
| 24 |
// for short month names, _SMN) isn't absolutely necessary. We give it here |
|
| 25 |
// for exemplification on how one can customize the short day names, but if |
|
| 26 |
// they are simply the first N letters of the full name you can simply say: |
|
| 27 |
// |
|
| 28 |
// Calendar._SDN_len = N; // short day name length |
|
| 29 |
// Calendar._SMN_len = N; // short month name length |
|
| 30 |
// |
|
| 31 |
// If N = 3 then this is not needed either since we assume a value of 3 if not |
|
| 32 |
// present, to be compatible with translation files that were written before |
|
| 33 |
// this feature. |
|
| 34 |
|
|
| 35 |
// short day names |
|
| 36 |
Calendar._SDN = new Array |
|
| 37 |
("Нед",
|
|
| 38 |
"Пон", |
|
| 39 |
"Вто", |
|
| 40 |
"Сря", |
|
| 41 |
"Чет", |
|
| 42 |
"Пет", |
|
| 43 |
"Съб", |
|
| 44 |
"Нед"); |
|
| 45 |
|
|
| 46 |
// First day of the week. "0" means display Sunday first, "1" means display |
|
| 47 |
// Monday first, etc. |
|
| 48 |
Calendar._FD = 1; |
|
| 49 |
|
|
| 50 |
// full month names |
|
| 51 |
Calendar._MN = new Array |
|
| 52 |
("Януари",
|
|
| 53 |
"Февруари", |
|
| 54 |
"Март", |
|
| 55 |
"Април", |
|
| 56 |
"Май", |
|
| 57 |
"Юни", |
|
| 58 |
"Юли", |
|
| 59 |
"Август", |
|
| 60 |
"Септември", |
|
| 61 |
"Октомври", |
|
| 62 |
"Ноември", |
|
| 63 |
"Декември"); |
|
| 64 |
|
|
| 65 |
// short month names |
|
| 66 |
Calendar._SMN = new Array |
|
| 67 |
("Яну",
|
|
| 68 |
"Фев", |
|
| 69 |
"Мар", |
|
| 70 |
"Апр", |
|
| 71 |
"Май", |
|
| 72 |
"Юни", |
|
| 73 |
"Юли", |
|
| 74 |
"Авг", |
|
| 75 |
"Сеп", |
|
| 76 |
"Окт", |
|
| 77 |
"Ное", |
|
| 78 |
"Дек"); |
|
| 79 |
|
|
| 80 |
// tooltips |
|
| 81 |
Calendar._TT = {};
|
|
| 82 |
Calendar._TT["INFO"] = "За календара"; |
|
| 83 |
|
|
| 84 |
Calendar._TT["ABOUT"] = |
|
| 85 |
"DHTML Date/Time Selector\n" + |
|
| 86 |
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) |
|
| 87 |
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + |
|
| 88 |
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + |
|
| 89 |
"\n\n" + |
|
| 90 |
"Избор на дата:\n" + |
|
| 91 |
"- Използвайте \xab, \xbb за избор на година\n" + |
|
| 92 |
"- Използвайте " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " за избор на месец\n" + |
|
| 93 |
"- Задръжте натиснат бутона за списък с години/месеци."; |
|
| 94 |
Calendar._TT["ABOUT_TIME"] = "\n\n" + |
|
| 95 |
"Избор на час:\n" + |
|
| 96 |
"- Кликнете на числата от часа за да ги увеличите\n" + |
|
| 97 |
"- или Shift-click за намаляването им\n" + |
|
| 98 |
"- или кликнете и влачете за по-бърза промяна."; |
|
| 99 |
|
|
| 100 |
Calendar._TT["PREV_YEAR"] = "Предишна година (задръжте за списък)"; |
|
| 101 |
Calendar._TT["PREV_MONTH"] = "Предишен месец (задръжте за списък)"; |
|
| 102 |
Calendar._TT["GO_TODAY"] = "Днешна дата"; |
|
| 103 |
Calendar._TT["NEXT_MONTH"] = "Следващ месец (задръжте за списък)"; |
|
| 104 |
Calendar._TT["NEXT_YEAR"] = "Следваща година (задръжте за списък)"; |
|
| 105 |
Calendar._TT["SEL_DATE"] = "Избор на дата"; |
|
| 106 |
Calendar._TT["DRAG_TO_MOVE"] = "Дръпнете за преместване"; |
|
| 107 |
Calendar._TT["PART_TODAY"] = " (днес)"; |
|
| 108 |
|
|
| 109 |
// the following is to inform that "%s" is to be the first day of week |
|
| 110 |
// %s will be replaced with the day name. |
|
| 111 |
Calendar._TT["DAY_FIRST"] = "Седмицата започва с %s"; |
|
| 112 |
|
|
| 113 |
// This may be locale-dependent. It specifies the week-end days, as an array |
|
| 114 |
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 |
|
| 115 |
// means Monday, etc. |
|
| 116 |
Calendar._TT["WEEKEND"] = "0,6"; |
|
| 117 |
|
|
| 118 |
Calendar._TT["CLOSE"] = "Затвори"; |
|
| 119 |
Calendar._TT["TODAY"] = "Днес"; |
|
| 120 |
Calendar._TT["TIME_PART"] = "(Shift-)Click или влачене за промяна на стойност"; |
|
| 121 |
|
|
| 122 |
// date formats |
|
| 123 |
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; |
|
| 124 |
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; |
|
| 125 |
|
|
| 126 |
Calendar._TT["WK"] = "седм"; |
|
| 127 |
Calendar._TT["TIME"] = "Час:"; |
|
| .svn/pristine/15/15b7222cb6b5695205873370eda995f4170a4d8e.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2013 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
require File.expand_path('../../test_helper', __FILE__)
|
|
| 19 |
|
|
| 20 |
class MemberTest < ActiveSupport::TestCase |
|
| 21 |
fixtures :projects, :trackers, :issue_statuses, :issues, |
|
| 22 |
:enumerations, :users, :issue_categories, |
|
| 23 |
:projects_trackers, |
|
| 24 |
:roles, |
|
| 25 |
:member_roles, |
|
| 26 |
:members, |
|
| 27 |
:enabled_modules, |
|
| 28 |
:groups_users, |
|
| 29 |
:watchers, |
|
| 30 |
:journals, :journal_details, |
|
| 31 |
:messages, |
|
| 32 |
:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions, |
|
| 33 |
:boards |
|
| 34 |
|
|
| 35 |
include Redmine::I18n |
|
| 36 |
|
|
| 37 |
def setup |
|
| 38 |
@jsmith = Member.find(1) |
|
| 39 |
end |
|
| 40 |
|
|
| 41 |
def test_create |
|
| 42 |
member = Member.new(:project_id => 1, :user_id => 4, :role_ids => [1, 2]) |
|
| 43 |
assert member.save |
|
| 44 |
member.reload |
|
| 45 |
|
|
| 46 |
assert_equal 2, member.roles.size |
|
| 47 |
assert_equal Role.find(1), member.roles.sort.first |
|
| 48 |
end |
|
| 49 |
|
|
| 50 |
def test_update |
|
| 51 |
assert_equal "eCookbook", @jsmith.project.name |
|
| 52 |
assert_equal "Manager", @jsmith.roles.first.name |
|
| 53 |
assert_equal "jsmith", @jsmith.user.login |
|
| 54 |
|
|
| 55 |
@jsmith.mail_notification = !@jsmith.mail_notification |
|
| 56 |
assert @jsmith.save |
|
| 57 |
end |
|
| 58 |
|
|
| 59 |
def test_update_roles |
|
| 60 |
assert_equal 1, @jsmith.roles.size |
|
| 61 |
@jsmith.role_ids = [1, 2] |
|
| 62 |
assert @jsmith.save |
|
| 63 |
assert_equal 2, @jsmith.reload.roles.size |
|
| 64 |
end |
|
| 65 |
|
|
| 66 |
def test_validate |
|
| 67 |
member = Member.new(:project_id => 1, :user_id => 2, :role_ids => [2]) |
|
| 68 |
# same use can't have more than one membership for a project |
|
| 69 |
assert !member.save |
|
| 70 |
|
|
| 71 |
# must have one role at least |
|
| 72 |
user = User.new(:firstname => "new1", :lastname => "user1", :mail => "test_validate@somenet.foo") |
|
| 73 |
user.login = "test_validate" |
|
| 74 |
user.password, user.password_confirmation = "password", "password" |
|
| 75 |
assert user.save |
|
| 76 |
|
|
| 77 |
set_language_if_valid 'fr' |
|
| 78 |
member = Member.new(:project_id => 1, :user_id => user.id, :role_ids => []) |
|
| 79 |
assert !member.save |
|
| 80 |
assert_include I18n.translate('activerecord.errors.messages.empty'), member.errors[:role]
|
|
| 81 |
str = "R\xc3\xb4le doit \xc3\xaatre renseign\xc3\xa9(e)" |
|
| 82 |
str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
|
|
| 83 |
assert_equal str, [member.errors.full_messages].flatten.join |
|
| 84 |
end |
|
| 85 |
|
|
| 86 |
def test_validate_member_role |
|
| 87 |
user = User.new(:firstname => "new1", :lastname => "user1", :mail => "test_validate@somenet.foo") |
|
| 88 |
user.login = "test_validate_member_role" |
|
| 89 |
user.password, user.password_confirmation = "password", "password" |
|
| 90 |
assert user.save |
|
| 91 |
member = Member.new(:project_id => 1, :user_id => user.id, :role_ids => [5]) |
|
| 92 |
assert !member.save |
|
| 93 |
end |
|
| 94 |
|
|
| 95 |
def test_destroy |
|
| 96 |
category1 = IssueCategory.find(1) |
|
| 97 |
assert_equal @jsmith.user.id, category1.assigned_to_id |
|
| 98 |
assert_difference 'Member.count', -1 do |
|
| 99 |
assert_difference 'MemberRole.count', -1 do |
|
| 100 |
@jsmith.destroy |
|
| 101 |
end |
|
| 102 |
end |
|
| 103 |
assert_raise(ActiveRecord::RecordNotFound) { Member.find(@jsmith.id) }
|
|
| 104 |
category1.reload |
|
| 105 |
assert_nil category1.assigned_to_id |
|
| 106 |
end |
|
| 107 |
|
|
| 108 |
def test_sort_without_roles |
|
| 109 |
a = Member.new(:roles => [Role.first]) |
|
| 110 |
b = Member.new |
|
| 111 |
|
|
| 112 |
assert_equal -1, a <=> b |
|
| 113 |
assert_equal 1, b <=> a |
|
| 114 |
end |
|
| 115 |
|
|
| 116 |
def test_sort_without_principal |
|
| 117 |
role = Role.first |
|
| 118 |
a = Member.new(:roles => [role], :principal => User.first) |
|
| 119 |
b = Member.new(:roles => [role]) |
|
| 120 |
|
|
| 121 |
assert_equal -1, a <=> b |
|
| 122 |
assert_equal 1, b <=> a |
|
| 123 |
end |
|
| 124 |
end |
|
Also available in: Unified diff