bfojcapell: strings replaced with _t() calls

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42134 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 16:33:05 +00:00
parent f059655888
commit 83d500865e
10 changed files with 85 additions and 84 deletions

View File

@ -111,12 +111,12 @@ HTML;
new HiddenField("ID", "", $this->currentPageID()), new HiddenField("ID", "", $this->currentPageID()),
// needed because the button-action is triggered outside the iframe // needed because the button-action is triggered outside the iframe
new HiddenField("action_doUpload", "", "1"), new HiddenField("action_doUpload", "", "1"),
new FileField("Files[0]" , "Choose file "), new FileField("Files[0]" , _t('AssetAdmin.CHOOSEFILE','Choose file ')),
new LiteralField('UploadButton'," new LiteralField('UploadButton',"
<input type='submit' value='Upload Files Listed Below' name='action_upload' id='Form_UploadForm_action_upload' class='action' /> <input type='submit' value='". _t('AssetAdmin.UPLOAD', 'Upload Files Listed Below'). "' name='action_upload' id='Form_UploadForm_action_upload' class='action' />
"), "),
new LiteralField('MultifileCode'," new LiteralField('MultifileCode',"
<p>Files ready to upload:</p> <p>" . _t('AssetAdmin.FILESREADY','Files ready to upload:') ."</p>
<div id='Form_UploadForm_FilesList'></div> <div id='Form_UploadForm_FilesList'></div>
<script> <script>
var multi_selector = new MultiSelector($('Form_UploadForm_FilesList'), null, $('Form_UploadForm_action_upload')); var multi_selector = new MultiSelector($('Form_UploadForm_FilesList'), null, $('Form_UploadForm_action_upload'));
@ -177,7 +177,7 @@ HTML;
if( $this->can('AdminCMS') || ( File::allowedFileType( $extension ) && (!isset($maxsize) || $file['size'] < $maxSize))) if( $this->can('AdminCMS') || ( File::allowedFileType( $extension ) && (!isset($maxsize) || $file['size'] < $maxSize)))
$newFiles[] = $folder->addUploadToFolder($file); $newFiles[] = $folder->addUploadToFolder($file);
elseif( !File::allowedFileType( $extension ) ) { elseif( !File::allowedFileType( $extension ) ) {
$fileSizeWarnings .= "alert( 'Only administrators can upload $extension files.' );"; $fileSizeWarnings .= "alert( '". sprintf(_t('AssetAdmin.ONLYADMINS','Only administrators can upload %s files.'),$extension)."' );";
} else { } else {
if( $file['size'] > 1048576 ) if( $file['size'] > 1048576 )
$fileSize = "" . ceil( $file['size'] / 1048576 ) . "MB"; $fileSize = "" . ceil( $file['size'] / 1048576 ) . "MB";
@ -187,17 +187,17 @@ HTML;
$fileSize = "" . ceil( $file['size'] ) . "B"; $fileSize = "" . ceil( $file['size'] ) . "B";
$fileSizeWarnings .= "alert( '\\'" . $file['name'] . "\\' is too large ($fileSize). Files of this type cannot be larger than $warnSize ' );"; $fileSizeWarnings .= "alert( '". sprintf(_t('AssetAdmin.TOOLARGE', "%s is too large (%s). Files of this type cannot be larger than %s"),"\\'" . $file['name'] . "\\'", $fileSize, $warnSize ) ."' );";
} }
} }
} }
if($newFiles) { if($newFiles) {
$numFiles = sizeof($newFiles); $numFiles = sizeof($newFiles);
$statusMessage = "Uploaded $numFiles files"; $statusMessage = sprintf(_t('AssetAdmin.UPLOADEDX',"Uploaded %s files"),$numFiles) ;
$status = "good"; $status = "good";
} else if($status != 'bad') { } else if($status != 'bad') {
$statusMessage = "There was nothing to upload"; $statusMessage = _t('AssetAdmin.NOTHINGTOUPLOAD','There was nothing to upload');
$status = ""; $status = "";
} }
echo <<<HTML echo <<<HTML
@ -239,7 +239,7 @@ HTML;
if($record) { if($record) {
$nameField = ($id != "root") ? new TextField("Name", "Folder Name") : new HiddenField("Name"); $nameField = ($id != "root") ? new TextField("Name", "Folder Name") : new HiddenField("Name");
if( $record->userCanEdit() ) { if( $record->userCanEdit() ) {
$deleteButton = new InlineFormAction('deletemarked',"Delete selected files", 'delete'); $deleteButton = new InlineFormAction('deletemarked',_t('AssetAdmin.DELSELECTED','Delete selected files'), 'delete');
$deleteButton->includeDefaultJS(false); $deleteButton->includeDefaultJS(false);
} else { } else {
$deleteButton = new HiddenField('deletemarked'); $deleteButton = new HiddenField('deletemarked');
@ -257,9 +257,9 @@ HTML;
), ),
new Tab("Details", new Tab("Details",
new ReadonlyField("URL"), new ReadonlyField("URL"),
new ReadonlyField("ClassName", "Type"), new ReadonlyField("ClassName", _t('AssetAdmin.TYPE','Type')),
new ReadonlyField("Created", "First Uploaded"), new ReadonlyField("Created", _t('AssetAdmin.CREATED','First Uploaded')),
new ReadonlyField("LastEdited", "Last Updated") new ReadonlyField("LastEdited", _t('AssetAdmin.LASTEDITED','Last Updated'))
), ),
new Tab("Upload", new Tab("Upload",
new LiteralField("UploadIframe", new LiteralField("UploadIframe",
@ -275,7 +275,7 @@ HTML;
// Only show save button if not 'assets' folder // Only show save button if not 'assets' folder
if( $record->userCanEdit() && $id != "root") { if( $record->userCanEdit() && $id != "root") {
$actions = new FieldSet( $actions = new FieldSet(
new FormAction('save',"Save folder name") new FormAction('save',_t('AssetAdmin.SAVEFOLDERNAME','Save folder name'))
); );
} }
@ -291,9 +291,9 @@ HTML;
// @todo: These workflow features aren't really appropriate for all projects // @todo: These workflow features aren't really appropriate for all projects
if( Member::currentUser()->_isAdmin() && project() == 'mot' ) { if( Member::currentUser()->_isAdmin() && project() == 'mot' ) {
$fields->addFieldsToTab( 'Root.Workflow', new DropdownField("Owner", "Owner", Member::map() ) ); $fields->addFieldsToTab( 'Root.Workflow', new DropdownField("Owner", _t('AssetAdmin.OWNER','Owner'), Member::map() ) );
$fields->addFieldsToTab( 'Root.Workflow', new TreeMultiselectField("CanUse", "Content usable by") ); $fields->addFieldsToTab( 'Root.Workflow', new TreeMultiselectField("CanUse", _t('AssetAdmin.CONTENTUSABLEBY','Content usable by')) );
$fields->addFieldsToTab( 'Root.Workflow', new TreeMultiselectField("CanEdit", "Content modifiable by") ); $fields->addFieldsToTab( 'Root.Workflow', new TreeMultiselectField("CanEdit", _t('AssetAdmin.CONTENTMODBY','Content modifiable by')) );
} }
if( !$record->userCanEdit() ) if( !$record->userCanEdit() )
@ -330,7 +330,7 @@ HTML;
} }
} }
$message = 'Moved '.$numFiles.' files'; $message = sprintf(_t('AssetAdmin.MOVEDX','Moved %s files'),$numFiles);
FormResponse::status_message($message, "good"); FormResponse::status_message($message, "good");
FormResponse::add("$('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value)"); FormResponse::add("$('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value)");
return FormResponse::respond(); return FormResponse::respond();
@ -351,7 +351,7 @@ HTML;
$brokenPageList = ''; $brokenPageList = '';
if($fileList != "''") { if($fileList != "''") {
$files = DataObject::get("File", "`File`.ID IN ($fileList)"); $files = DataObject::get("File", "ID IN ($fileList)");
if($files) { if($files) {
foreach($files as $file) { foreach($files as $file) {
if($file instanceof Image) { if($file instanceof Image) {
@ -365,7 +365,7 @@ HTML;
$numFiles++; $numFiles++;
} }
if($brokenPages = Notifications::getItems("BrokenLink")) { if($brokenPages = Notifications::getItems("BrokenLink")) {
$brokenPageList = " These pages now have broken links:</ul>"; $brokenPageList = " ". _t('AssetAdmin.NOWBROKEN',"These pages now have broken links:")."</ul>";
foreach($brokenPages as $brokenPage) { foreach($brokenPages as $brokenPage) {
$brokenPageList .= "<li style=&quot;font-size: 65%&quot;>" . $brokenPage->Breadcrumbs(3, true) . "</li>"; $brokenPageList .= "<li style=&quot;font-size: 65%&quot;>" . $brokenPage->Breadcrumbs(3, true) . "</li>";
} }
@ -380,14 +380,14 @@ HTML;
$remaining = DB::query("SELECT COUNT(*) FROM `File` WHERE `ParentID`=$folderID")->value(); $remaining = DB::query("SELECT COUNT(*) FROM `File` WHERE `ParentID`=$folderID")->value();
if( !$remaining ) if( !$remaining )
$deleteList = "Element.removeClassName(\$('sitetree').getTreeNodeByIdx( '$folderID' ).getElementsByTagName('a')[0],'contents');"; $deleteList .= "Element.removeClassName(\$('sitetree').getTreeNodeByIdx( '$folderID' ).getElementsByTagName('a')[0],'contents');";
} }
} else { } else {
user_error("No files in $fileList could be found!", E_USER_ERROR); user_error("No files in $fileList could be found!", E_USER_ERROR);
} }
} }
$message = "Deleted $numFiles files.$brokenPageList"; $message = sprintf(_t('AssetAdmin.DELETEDX',"Deleted %s files.%s"),$numFiles,$brokenPageList) ;
FormResponse::add($deleteList); FormResponse::add($deleteList);
FormResponse::status_message($message, "good"); FormResponse::status_message($message, "good");
FormResponse::add("$('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value)"); FormResponse::add("$('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value)");
@ -419,8 +419,9 @@ HTML;
$record->write(); $record->write();
$title = Convert::raw2js($record->Title); $title = Convert::raw2js($record->Title);
$name = Convert::raw2js($record->Name); $name = Convert::raw2js($record->Name);
$saved = sprintf(_t('AssetAdmin.SAVEDFILE','Saved file %s'),"#$data[ID]");
echo <<<JS echo <<<JS
statusMessage('Saved file #$data[ID]'); statusMessage('$saved');
$('record-$data[ID]').getElementsByTagName('td')[1].innerHTML = "$title"; $('record-$data[ID]').getElementsByTagName('td')[1].innerHTML = "$title";
$('record-$data[ID]').getElementsByTagName('td')[2].innerHTML = "$name"; $('record-$data[ID]').getElementsByTagName('td')[2].innerHTML = "$name";
JS; JS;
@ -499,7 +500,7 @@ JS;
$p = new Folder(); $p = new Folder();
$p->ParentID = $parent; $p->ParentID = $parent;
$p->Title = "NewFolder"; $p->Title = _t('AssetAdmin.NEWFOLDER',"NewFolder");
$p->Name = "NewFolder"; $p->Name = "NewFolder";

View File

@ -62,14 +62,14 @@ class AssetTableField extends ComplexTableField {
$detailFormFields = new FieldSet( $detailFormFields = new FieldSet(
new TabSet("BottomRoot", new TabSet("BottomRoot",
new Tab("Main", new Tab("Main",
new TextField("Title"), new TextField("Title", _t('AssetTableField.TITLE','Title')),
new TextField("Name", "Filename"), new TextField("Name", _t('AssetTableField.FILENAME','Filename')),
new LiteralField("AbsoluteURL", $urlLink), new LiteralField("AbsoluteURL", $urlLink),
new ReadonlyField("FileType", "Type"), new ReadonlyField("FileType", _t('AssetTableField.TYPE','Type')),
new ReadonlyField("Size", "Size", $childData->getSize()), new ReadonlyField("Size", _t('AssetTableField.SIZE','Size'), $childData->getSize()),
new DropdownField("OwnerID", "Owner", Member::mapInCMSGroups( $folder->CanEdit() ) ), new DropdownField("OwnerID", _t('AssetTableField.OWNER','Owner'), Member::mapInCMSGroups( $folder->CanEdit() ) ),
new DateField_Disabled("Created", "First uploaded"), new DateField_Disabled("Created", _t('AssetTableField.CREATED','First uploaded')),
new DateField_Disabled("LastEdited", "Last changed") new DateField_Disabled("LastEdited", _t('AssetTableField.LASTEDIT','Last changed'))
) )
) )
); );
@ -79,7 +79,7 @@ class AssetTableField extends ComplexTableField {
$thumbnail = $childData->getFormattedImage('AssetLibraryPreview')->URL; $thumbnail = $childData->getFormattedImage('AssetLibraryPreview')->URL;
$detailFormFields->addFieldToTab("BottomRoot.Main", $detailFormFields->addFieldToTab("BottomRoot.Main",
new ReadonlyField("Dimensions"), new ReadonlyField("Dimensions", _t('AssetTableField.DIM','Dimensions')),
"Created" "Created"
); );
@ -100,9 +100,9 @@ class AssetTableField extends ComplexTableField {
foreach($links as $link) { foreach($links as $link) {
$backlinks[] = "<li><a href=\"admin/show/$link->ID\">" . $link->Breadcrumbs(null,true). "</a></li>"; $backlinks[] = "<li><a href=\"admin/show/$link->ID\">" . $link->Breadcrumbs(null,true). "</a></li>";
} }
$backlinks = "<div style=\"clear:left\">The following pages link to this file:<ul>" . implode("",$backlinks) . "</ul>"; $backlinks = "<div style=\"clear:left\">". _t('AssetTableField.PAGESLINKING','The following pages link to this file:') ."<ul>" . implode("",$backlinks) . "</ul>";
} }
if(!isset($backlinks)) $backlinks = "<p>This file hasn't been linked to from any pages.</p>"; if(!isset($backlinks)) $backlinks = "<p>". _t('AssetTableField.NOLINKS',"This file hasn't been linked to from any pages.") ."</p>";
$detailFormFields->addFieldToTab("BottomRoot.Links", new LiteralField("Backlinks", $backlinks)); $detailFormFields->addFieldToTab("BottomRoot.Links", new LiteralField("Backlinks", $backlinks));
} }

View File

@ -47,13 +47,13 @@ class BulkLoaderAdmin extends LeftAndMain {
$fields = $loader->getOptionFields(); $fields = $loader->getOptionFields();
if(!$fields) $fields = new FieldSet(); if(!$fields) $fields = new FieldSet();
$fields->push(new FileField("File", "CSV File")); $fields->push(new FileField("File", _t('BulkLoaderAdmin.CSVFILE','CSV File')));
$fields->push(new HiddenField('LoaderClass', '', $loader->class)); $fields->push(new HiddenField('LoaderClass', '', $loader->class));
return new Form($this, "EditForm", return new Form($this, "EditForm",
$fields, $fields,
new FieldSet( new FieldSet(
new FormAction('preview', "Preview") new FormAction('preview', _t('BulkLoaderAdmin.PREVIEW',"Preview"))
) )
); );
@ -68,7 +68,7 @@ class BulkLoaderAdmin extends LeftAndMain {
$results = $loader->processAll($_FILES['File']['tmp_name'], false); $results = $loader->processAll($_FILES['File']['tmp_name'], false);
return $this->customise(array( return $this->customise(array(
"Message" => "Press continue to load this data in", "Message" => _t('BulkLoaderAdmin.PRESSCNT','Press continue to load this data in'),
"Results" => $results, "Results" => $results,
"ConfirmForm" => $this->getConfirmFormFor($loader, $file), "ConfirmForm" => $this->getConfirmFormFor($loader, $file),
))->renderWith("BulkLoaderAdmin_preview"); ))->renderWith("BulkLoaderAdmin_preview");
@ -89,7 +89,7 @@ class BulkLoaderAdmin extends LeftAndMain {
new HiddenField("File", "", $tmpFile), new HiddenField("File", "", $tmpFile),
new HiddenField("LoaderClass", "", $loader->class) new HiddenField("LoaderClass", "", $loader->class)
), new FieldSet( ), new FieldSet(
new FormAction('process', 'Confirm bulk load') new FormAction('process', _t('BulkLoaderAdmin.CONFIRMBULK','Confirm bulk load'))
)); ));
} }
/** /**
@ -111,7 +111,7 @@ class BulkLoaderAdmin extends LeftAndMain {
$results = $loader->processAll($_REQUEST['Filename'], true); $results = $loader->processAll($_REQUEST['Filename'], true);
return $this->customise(array( return $this->customise(array(
"Message" => "This data has been loaded in", "Message" => _t('BulkLoaderAdmin.DATALOADED', 'This data has been loaded in'),
"Results" => $results, "Results" => $results,
"ConfirmForm" => " ", "ConfirmForm" => " ",
))->renderWith("BulkLoaderAdmin_preview"); ))->renderWith("BulkLoaderAdmin_preview");

View File

@ -208,34 +208,34 @@ class MemberList extends FormField {
{ {
return new TabularStyle(new Form($this->controller,'AddRecordForm', return new TabularStyle(new Form($this->controller,'AddRecordForm',
new FieldSet( new FieldSet(
new TextField("FirstName", "First Name"), new TextField("FirstName", _t('MemberList.FN', 'First Name')),
new TextField("Surname", "Surname"), new TextField("Surname", _t('MemberList.SN', 'Surname')),
new TextField("Email", "Email"), new TextField("Email", _t('MemberList.EMAIL', 'Email')),
new HiddenField("GroupID", null, $this->group->ID) new HiddenField("GroupID", null, $this->group->ID)
), ),
new FieldSet( new FieldSet(
new FormAction("addmember", "Add") new FormAction("addmember", _t('MemberList.ADD', 'Add'))
) )
)); ));
} else { } else {
return new TabularStyle(new Form($this->controller,'AddRecordForm', return new TabularStyle(new Form($this->controller,'AddRecordForm',
new FieldSet( new FieldSet(
new TextField("FirstName", "First Name"), new TextField("FirstName", _t('MemberList.FN')),
new TextField("Surname", "Surname"), new TextField("Surname", _t('MemberList.SN')),
new TextField("Email", "Email"), new TextField("Email", _t('MemberList.EMAIL')),
new TextField("Password", "Password"), new TextField("Password", _t('MemberList.PASSWD', 'Password')),
new HiddenField("GroupID", null, $this->group->ID) new HiddenField("GroupID", null, $this->group->ID)
), ),
new FieldSet( new FieldSet(
new FormAction("addmember", "Add") new FormAction("addmember", _t('MemberList.ADD'))
) )
)); ));
} }
} }
function SearchField() { function SearchField() {
$field = new TextField( 'MemberListSearch', 'Search' ); $field = new TextField( 'MemberListSearch', _t('MemberList.SEARCH','Search') );
return $field->FieldHolder(); return $field->FieldHolder();
} }
@ -263,7 +263,7 @@ class MemberList extends FormField {
foreach( $groups as $group ) foreach( $groups as $group )
$groupArray[$group->ID] = $group->Title; $groupArray[$group->ID] = $group->Title;
$field = new DropdownField('MemberListGroup','Filter by group',$groupArray ); $field = new DropdownField('MemberListGroup',_t('MemberList.FILTERBYG','Filter by group'),$groupArray );
return $field->FieldHolder(); return $field->FieldHolder();
} }
} }

View File

@ -255,7 +255,7 @@ class MemberTableField extends ComplexTableField {
// TODO add javascript to highlight added row (problem: might not show up due to sorting/filtering) // TODO add javascript to highlight added row (problem: might not show up due to sorting/filtering)
FormResponse::update_dom_id($this->id(), $this->renderWith($this->template), true); FormResponse::update_dom_id($this->id(), $this->renderWith($this->template), true);
FormResponse::status_message('Added member to group', 'good'); FormResponse::status_message(_t('MemberTableField.ADDEDTOGROUP','Added member to group'), 'good');
return FormResponse::respond(); return FormResponse::respond();
} }
@ -331,7 +331,7 @@ class MemberTableField extends ComplexTableField {
return new TabularStyle(new Form($this->controller,'AddRecordForm', return new TabularStyle(new Form($this->controller,'AddRecordForm',
$fields, $fields,
new FieldSet( new FieldSet(
new FormAction("addtogroup", "Add") new FormAction("addtogroup", _t('MemberTableField.ADD','Add'))
) )
)); ));
} }

View File

@ -232,8 +232,8 @@ class NewsletterAdmin extends LeftAndMain {
$fields = new FieldSet( $fields = new FieldSet(
new TabSet("Root", new TabSet("Root",
new Tab("Newsletter Settings", new Tab("Newsletter Settings",
new TextField("Title", "Newsletter Type"), new TextField("Title", _t('NewsletterAdmin.NEWSLTYPE','Newsletter Type')),
new TextField("FromEmail", "From email address"), new TextField("FromEmail", _t('NewsletterAdmin.FROMEM','From email address')),
$templates = new TemplateList("Template","Template", $mailType->Template, self::template_path()) $templates = new TemplateList("Template","Template", $mailType->Template, self::template_path())
) )
) )
@ -393,11 +393,11 @@ class NewsletterAdmin extends LeftAndMain {
$actions = new FieldSet(); $actions = new FieldSet();
if( $email->SentDate ) if( $email->SentDate )
$actions->push(new FormAction('send','Resend')); $actions->push(new FormAction('send',_t('NewsletterAdmin.RESEND','Resend')));
else else
$actions->push(new FormAction('send','Send...')); $actions->push(new FormAction('send',_t('NewsletterAdmin.SEND','Send...')));
$actions->push(new FormAction('save','Save')); $actions->push(new FormAction('save',_t('NewsletterAdmin.SAVE','Save')));
$form = new Form($this, "EditForm", $fields, $actions); $form = new Form($this, "EditForm", $fields, $actions);
$form->loadDataFrom($email); $form->loadDataFrom($email);
@ -415,7 +415,7 @@ class NewsletterAdmin extends LeftAndMain {
} }
public function SendProgressBar() { public function SendProgressBar() {
$progressBar = new ProgressBar( 'SendProgressBar', 'Sending emails...' ); $progressBar = new ProgressBar( 'SendProgressBar', _t('NewsletterAdmin.SENDING','Sending emails...') );
return $progressBar->FieldHolder(); return $progressBar->FieldHolder();
} }
@ -454,9 +454,9 @@ class NewsletterAdmin extends LeftAndMain {
$e->setTemplate( $nlType->Template ); $e->setTemplate( $nlType->Template );
self::sendToAddress( $e, $_REQUEST['TestEmail'], $messageID ); self::sendToAddress( $e, $_REQUEST['TestEmail'], $messageID );
FormResponse::status_message('Sent test to ' . $_REQUEST['TestEmail'],'good'); FormResponse::status_message(_t('NewsletterAdmin.SENTTESTTO','Sent test to ') . $_REQUEST['TestEmail'],'good');
} else { } else {
FormResponse::status_message('Please enter an email address','bad'); FormResponse::status_message(_t('NewsletterAdmin.PLEASEENTERMAIL','Please enter an email address'),'bad');
} }
break; break;
case "List": case "List":
@ -504,7 +504,7 @@ class NewsletterAdmin extends LeftAndMain {
$record->write(); $record->write();
FormResponse::set_node_title("mailtype_$id", $record->Title); FormResponse::set_node_title("mailtype_$id", $record->Title);
FormResponse::status_message('Saved', 'good'); FormResponse::status_message(_t('NewsletterAdmin.SAVED','Saved'), 'good');
$result = $this->getActionUpdateJS($record); $result = $this->getActionUpdateJS($record);
return FormResponse::respond(); return FormResponse::respond();
} }
@ -624,7 +624,7 @@ class NewsletterAdmin extends LeftAndMain {
$('MemberList').clearAddForm(); $('MemberList').clearAddForm();
JS; JS;
FormResponse::add($response); FormResponse::add($response);
FormResponse::status_message('Saved', 'good'); FormResponse::status_message(_t('NewsletterAdmin.SAVED'), 'good');
return FormResponse::respond(); return FormResponse::respond();
} }
@ -672,13 +672,13 @@ JS;
private function newNewsletterType() { private function newNewsletterType() {
// create a new group for the newsletter // create a new group for the newsletter
$newGroup = new Group(); $newGroup = new Group();
$newGroup->Title = "New mailing list"; $newGroup->Title = _t('NewsletterAdmin.NEWLIST','New mailing list');
$newGroup->Code = "new-mailing-list"; $newGroup->Code = "new-mailing-list";
$newGroup->write(); $newGroup->write();
// create the new type // create the new type
$newsletterType = new NewsletterType(); $newsletterType = new NewsletterType();
$newsletterType->Title = 'New newsletter type'; $newsletterType->Title = _t('NewsletterAdmin.NEWNEWSLTYPE','New newsletter type');
$newsletterType->GroupID = $newGroup->ID; $newsletterType->GroupID = $newGroup->ID;
$newsletterType->write(); $newsletterType->write();
@ -704,7 +704,7 @@ JS;
} }
$newsletter = new Newsletter(); $newsletter = new Newsletter();
$newsletter->Status = 'Draft'; $newsletter->Status = 'Draft';
$newsletter->Title = $newsletter->Subject = 'New draft newsletter'; $newsletter->Title = $newsletter->Subject = _t('NewsletterAdmin.MEWDRAFTMEWSL','New draft newsletter');
$newsletter->ParentID = $parentID; $newsletter->ParentID = $parentID;
$newsletter->write(); $newsletter->write();
} else { } else {
@ -761,7 +761,7 @@ JS;
); );
$actions = new FieldSet( $actions = new FieldSet(
new FormAction( "action_import", "Show contents" ) new FormAction( "action_import", _t('NewsletterAdmin.SHOWCONTENTS','Show contents') )
); );
return new RecipientImportField_UploadForm( $this, "UploadForm", $fields, $actions ); return new RecipientImportField_UploadForm( $this, "UploadForm", $fields, $actions );

View File

@ -44,9 +44,9 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
), ),
new Tab("Permissions", new Tab("Permissions",
new LiteralField("", "<p>This section is for advanced users only. new LiteralField("", "<p>"._t('SecurityAdmin.ADVANCEDONLY',"This section is for advanced users only.
See <a href=\"http://doc.silverstripe.com/doku.php?id=permissions:codes\" target=\"_blank\">this page</a> See <a href=\"http://doc.silverstripe.com/doku.php?id=permissions:codes\" target=\"_blank\">this page</a>
for more information.</p>"), for more information.")."</p>"),
new TableField( new TableField(
"Permissions", "Permissions",
"Permission", "Permission",
@ -65,10 +65,10 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$fields->push($idField = new HiddenField("ID")); $fields->push($idField = new HiddenField("ID"));
$idField->setValue($id); $idField->setValue($id);
$actions = new FieldSet( $actions = new FieldSet(
new FormAction('addmember','Add Member') new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member'))
); );
$actions->push(new FormAction('save','Save')); $actions->push(new FormAction('save',_t('SecurityAdmin.SAVE','Save')));
$form = new Form($this, "EditForm", $fields, $actions); $form = new Form($this, "EditForm", $fields, $actions);
$form->loadDataFrom($record); $form->loadDataFrom($record);
@ -140,7 +140,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$actions = new FieldSet(); $actions = new FieldSet();
$actions->push(new FormAction('savemember','Save')); $actions->push(new FormAction('savemember',_t('SecurityAdmin.SAVE')));
$form = new Form($this, "MemberForm", $fields, $actions); $form = new Form($this, "MemberForm", $fields, $actions);
if($record) $form->loadDataFrom($record); if($record) $form->loadDataFrom($record);
@ -226,7 +226,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\">" . $siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\">" .
"<li id=\"record-0\" class=\"Root\">" . "<li id=\"record-0\" class=\"Root\">" .
"<a href=\"admin/security/show/0\" >Security groups</a>" "<a href=\"admin/security/show/0\" >"._t('SecurityAdmin.SGROUPS',"Security groups")."</a>"
. $siteTree . . $siteTree .
"</li>" . "</li>" .
"</ul>"; "</ul>";
@ -238,7 +238,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
public function addgroup() { public function addgroup() {
$parent = $_REQUEST['ParentID'] ? $_REQUEST['ParentID'] : 0; $parent = $_REQUEST['ParentID'] ? $_REQUEST['ParentID'] : 0;
$p = new Group(); $p = new Group();
$p->Title = "New Group"; $p->Title = _t('SecurityAdmin.NEWGROUP',"New Group");
$p->Code = "new-group"; $p->Code = "new-group";
$p->ParentID = $parent; $p->ParentID = $parent;
$p->write(); $p->write();

View File

@ -28,7 +28,7 @@ abstract class SideReport extends Object {
} }
$result .= "</ul>\n"; $result .= "</ul>\n";
} else { } else {
$result = 'The '.$this->title().' report is empty.'; $result = sprintf(_t('SideReport.REPEMPTY','The %s report is empty.',PR_MEDIUM,'%s is a report title'),$this->title());
} }
return $result; return $result;
} }
@ -36,7 +36,7 @@ abstract class SideReport extends Object {
class SideReport_EmptyPages extends SideReport { class SideReport_EmptyPages extends SideReport {
function title() { function title() {
return "Empty pages"; return _t('SideReport.EMPTYPAGES',"Empty pages");
} }
function records() { function records() {
return DataObject::get("SiteTree", "Content = '' OR Content IS NULL OR Content LIKE '<p></p>' OR Content LIKE '<p>&nbsp;</p>'", "Title"); return DataObject::get("SiteTree", "Content = '' OR Content IS NULL OR Content LIKE '<p></p>' OR Content LIKE '<p>&nbsp;</p>'", "Title");
@ -50,7 +50,7 @@ class SideReport_EmptyPages extends SideReport {
class SideReport_RecentlyEdited extends SideReport { class SideReport_RecentlyEdited extends SideReport {
function title() { function title() {
return "Pages edited in the last 2 weeks"; return _t('SideReport.LAST2WEEKS',"Pages edited in the last 2 weeks");
} }
function records() { function records() {
return DataObject::get("SiteTree", "`SiteTree`.LastEdited > NOW() - INTERVAL 14 DAY", "`SiteTree`.`LastEdited` DESC"); return DataObject::get("SiteTree", "`SiteTree`.LastEdited > NOW() - INTERVAL 14 DAY", "`SiteTree`.`LastEdited` DESC");

View File

@ -10,9 +10,9 @@ class StaticExporter extends Controller {
parent::init(); parent::init();
if(!$this->can('AdminCMS')) { if(!$this->can('AdminCMS')) {
$messageSet = array( $messageSet = array(
'default' => "Please choose an authentication method and enter your credentials to access the CMS.", 'default' => _t('LeftAndMain.PERMDEFAULT'),
'alreadyLoggedIn' => "I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below", 'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY'),
'logInAgain' => "You have been logged out of the CMS. If you would like to log in again, enter a username and password below.", 'logInAgain' => _t('LeftAndMain.PERMAGAIN'),
); );
Security::permissionFailure($this, $messageSet); Security::permissionFailure($this, $messageSet);
@ -25,16 +25,16 @@ class StaticExporter extends Controller {
} }
function index() { function index() {
echo "<h1>Static exporter</h1>"; echo "<h1>"._t('StaticExporter.NAME','Static exporter')."</h1>";
echo $this->StaticExportForm()->forTemplate(); echo $this->StaticExportForm()->forTemplate();
} }
function StaticExportForm() { function StaticExportForm() {
return new Form($this, 'StaticExportForm', new FieldSet( return new Form($this, 'StaticExportForm', new FieldSet(
new TextField('folder', 'Folder to export to'), new TextField('folder', _t('StaticExporter.FOLDEREXPORT','Folder to export to')),
new TextField('baseurl', 'Base URL') new TextField('baseurl', _t('StaticExporter.BASEURL','Base URL'))
), new FieldSet( ), new FieldSet(
new FormAction('export', 'Export to that folder') new FormAction('export', _t('StaticExporter.EXPORTTOTHAT','Export to that folder'))
)); ));
} }
@ -78,7 +78,7 @@ class StaticExporter extends Controller {
} }
} }
} else { } else {
echo "Please specify a folder that exists"; echo _t('StaticExporter.ONETHATEXISTS',"Please specify a folder that exists");
} }
} }

View File

@ -42,7 +42,7 @@ class ThumbnailStripField extends FormField {
$folder = DataObject::get_by_id("Folder", $_GET['folderID']); $folder = DataObject::get_by_id("Folder", $_GET['folderID']);
if( !$folder ) if( !$folder )
return 'This is not a folder'; return _t('ThumbnailStripField.NOTAFOLDER','This is not a folder');
$folderList = $folder->getDescendantIDList("Folder"); $folderList = $folder->getDescendantIDList("Folder");
@ -89,7 +89,7 @@ class ThumbnailStripField extends FormField {
$folder = DataObject::get_by_id("Folder", $_GET['folderID']); $folder = DataObject::get_by_id("Folder", $_GET['folderID']);
if( !$folder ) if( !$folder )
return 'This is not a folder'; return _t('ThumbnailStripField.NOTAFOLDER');
$folderList = $folder->getDescendantIDList("Folder"); $folderList = $folder->getDescendantIDList("Folder");
array_unshift($folderList, $folder->ID); array_unshift($folderList, $folder->ID);