Permalink
Browse files

MINOR Localized strings in PermissionCheckboxSetField

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@99590 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 11ad275 commit 4a93c9f6a7eccf6f012d09da5981236b3abff7fc @chillu chillu committed Feb 22, 2010
Showing with 46 additions and 8 deletions.
  1. +16 −0 lang/en_US.php
  2. +30 −8 security/PermissionCheckboxSetField.php
View
@@ -535,6 +535,22 @@
50,
'Singular name of the object, used in dropdowns and to generally identify a single object in the interface'
);
+$lang['en_US']['PermissionCheckboxSetField']['AssignedTo'] = 'assigned to "%s"';
+$lang['en_US']['PermissionCheckboxSetField']['FromGroup'] = array(
+ 'inherited from group "%s"',
+ PR_MEDIUM,
+ 'A permission inherited from a certain group'
+);
+$lang['en_US']['PermissionCheckboxSetField']['FromRole'] = array(
+ 'inherited from role "%s"',
+ PR_MEDIUM,
+ 'A permission inherited from a certain permission role'
+);
+$lang['en_US']['PermissionCheckboxSetField']['FromRoleOnGroup'] = array(
+ 'inherited from role "%s" on group "%s"',
+ PR_MEDIUM,
+ 'A permission inherited from a role on a certain group'
+);
$lang['en_US']['PermissionRole']['PLURALNAME'] = array(
'Permission Rols',
50,
@@ -109,8 +109,15 @@ function Field() {
foreach($record->Roles() as $role) {
foreach($role->Codes() as $code) {
if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array();
- // TODO i18n
- $inheritedCodes[$code->Code][] = 'from role "'.$role->Title . '"';
+ $inheritedCodes[$code->Code][] = sprintf(
+ _t(
+ 'PermissionCheckboxSetField.FromRole',
+ 'inherited from role "%s"',
+ PR_MEDIUM,
+ 'A permission inherited from a certain permission role'
+ ),
+ $role->Title
+ );
}
}
}
@@ -124,16 +131,32 @@ function Field() {
if ($role->Codes()) {
foreach($role->Codes() as $code) {
if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array();
- // TODO i18n
- $inheritedCodes[$code->Code][] = 'role "'.$role->Title.'" on group "'.$parent->Title . '"';
+ $inheritedCodes[$code->Code][] = sprintf(
+ _t(
+ 'PermissionCheckboxSetField.FromRoleOnGroup',
+ 'inherited from role "%s" on group "%s"',
+ PR_MEDIUM,
+ 'A permission inherited from a role on a certain group'
+ ),
+ $role->Title,
+ $parent->Title
+ );
}
}
}
if ($parent->Permissions()->Count()) {
foreach($parent->Permissions() as $permission) {
if (!isset($inheritedCodes[$permission->Code])) $inheritedCodes[$permission->Code] = array();
- // TODO i18n
- $inheritedCodes[$permission->Code][] = 'group "'.$parent->Title . '"';
+ $inheritedCodes[$permission->Code][] =
+ sprintf(
+ _t(
+ 'PermissionCheckboxSetField.FromGroup',
+ 'inherited from group "%s"',
+ PR_MEDIUM,
+ 'A permission inherited from a certain group'
+ ),
+ $parent->Title
+ );
}
}
}
@@ -163,8 +186,7 @@ function Field() {
if (isset($inheritedCodes[$code])) {
// disable inherited codes, as any saving logic would be too complicate to express in this interface
$disabled = ' disabled="true"';
- // TODO i18n
- $inheritMessage = ' (inherited from ' . join(', ', $inheritedCodes[$code]) . ')';
+ $inheritMessage = ' (' . join(', ', $inheritedCodes[$code]) . ')';
} elseif($this->records && $this->records->Count() > 1 && isset($uninheritedCodes[$code])) {
// If code assignments are collected from more than one "source group",
// show its origin automatically

0 comments on commit 4a93c9f

Please sign in to comment.