Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Text collector translations now compile without errors #100

Merged
merged 1 commit into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions code/SiteConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@ public function getCMSFields()
),
$viewerGroupsField = ListboxField::create(
"ViewerGroups",
_t(SiteTree::class . '.VIEWERGROUPS', "Viewer Groups")
_t('SilverStripe\\CMS\\Model\\SiteTree.VIEWERGROUPS', "Viewer Groups")
)
->setSource($groupsMap)
->setAttribute(
'data-placeholder',
_t(SiteTree::class . '.GroupPlaceholder', 'Click to select group')
_t('SilverStripe\\CMS\\Model\\SiteTree.GroupPlaceholder', 'Click to select group')
),
$editorsOptionsField = new OptionsetField(
"CanEditType",
_t(self::class . '.EDITHEADER', "Who can edit pages on this site?")
),
$editorGroupsField = ListboxField::create(
"EditorGroups",
_t(SiteTree::class . '.EDITORGROUPS', "Editor Groups")
_t('SilverStripe\\CMS\\Model\\SiteTree.EDITORGROUPS', "Editor Groups")
)
->setSource($groupsMap)
->setAttribute(
'data-placeholder',
_t(SiteTree::class . '.GroupPlaceholder', 'Click to select group')
_t('SilverStripe\\CMS\\Model\\SiteTree.GroupPlaceholder', 'Click to select group')
),
$topLevelCreatorsOptionsField = new OptionsetField(
"CanCreateTopLevelType",
Expand All @@ -148,48 +148,48 @@ public function getCMSFields()
->setSource($groupsMap)
->setAttribute(
'data-placeholder',
_t(SiteTree::class . '.GroupPlaceholder', 'Click to select group')
_t('SilverStripe\\CMS\\Model\\SiteTree.GroupPlaceholder', 'Click to select group')
)
)
),
new HiddenField('ID')
);

$viewersOptionsSource = [];
$viewersOptionsSource["Anyone"] = _t(SiteTree::class . '.ACCESSANYONE', "Anyone");
$viewersOptionsSource["Anyone"] = _t('SilverStripe\\CMS\\Model\\SiteTree.ACCESSANYONE', "Anyone");
$viewersOptionsSource["LoggedInUsers"] = _t(
SiteTree::class . '.ACCESSLOGGEDIN',
'SilverStripe\\CMS\\Model\\SiteTree.ACCESSLOGGEDIN',
"Logged-in users"
);
$viewersOptionsSource["OnlyTheseUsers"] = _t(
SiteTree::class . '.ACCESSONLYTHESE',
'SilverStripe\\CMS\\Model\\SiteTree.ACCESSONLYTHESE',
"Only these groups (choose from list)"
);
$viewersOptionsField->setSource($viewersOptionsSource);

if ($viewAllGroupsMap) {
$viewerGroupsField->setDescription(_t(
SiteTree::class . '.VIEWER_GROUPS_FIELD_DESC',
'SilverStripe\\CMS\\Model\\SiteTree.VIEWER_GROUPS_FIELD_DESC',
'Groups with global view permissions: {groupList}',
['groupList' => implode(', ', array_values($viewAllGroupsMap))]
));
}

if ($editAllGroupsMap) {
$editorGroupsField->setDescription(_t(
SiteTree::class . '.EDITOR_GROUPS_FIELD_DESC',
'SilverStripe\\CMS\\Model\\SiteTree.EDITOR_GROUPS_FIELD_DESC',
'Groups with global edit permissions: {groupList}',
['groupList' => implode(', ', array_values($editAllGroupsMap))]
));
}

$editorsOptionsSource = [];
$editorsOptionsSource["LoggedInUsers"] = _t(
SiteTree::class . '.EDITANYONE',
'SilverStripe\\CMS\\Model\\SiteTree.EDITANYONE',
"Anyone who can log-in to the CMS"
);
$editorsOptionsSource["OnlyTheseUsers"] = _t(
SiteTree::class . '.EDITONLYTHESE',
'SilverStripe\\CMS\\Model\\SiteTree.EDITONLYTHESE',
"Only these groups (choose from list)"
);
$editorsOptionsField->setSource($editorsOptionsSource);
Expand Down Expand Up @@ -241,7 +241,7 @@ public function getCMSActions()
$actions = new FieldList(
FormAction::create(
'save_siteconfig',
_t(CMSMain::class . '.SAVE', 'Save')
_t('SilverStripe\\CMS\\Controllers\\CMSMain.SAVE', 'Save')
)->addExtraClass('btn-primary font-icon-save')
);
} else {
Expand Down Expand Up @@ -428,7 +428,10 @@ public function providePermissions()
return [
'EDIT_SITECONFIG' => [
'name' => _t(self::class . '.EDIT_PERMISSION', 'Manage site configuration'),
'category' => _t(Permission::class . '.PERMISSIONS_CATEGORY', 'Roles and access permissions'),
'category' => _t(
'SilverStripe\\Security\\Permission.PERMISSIONS_CATEGORY',
'Roles and access permissions'
),
'help' => _t(
self::class . '.EDIT_PERMISSION_HELP',
'Ability to edit global access settings/top-level page permissions.'
Expand Down
5 changes: 4 additions & 1 deletion code/SiteConfigLeftAndMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ public function save_siteconfig($data, $form)
if ($siteConfig->hasExtension(RecursivePublishable::class)) {
$siteConfig->publishRecursive();
}
$this->response->addHeader('X-Status', rawurlencode(_t(LeftAndMain::class . '.SAVEDUP', 'Saved.')));
$this->response->addHeader(
'X-Status',
rawurlencode(_t('SilverStripe\\Admin\\LeftAndMain.SAVEDUP', 'Saved.'))
);
return $form->forTemplate();
}

Expand Down
4 changes: 4 additions & 0 deletions lang/en.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
en:
SilverStripe\CMS\Model\SiteTree:
EDITANYONE: 'Anyone who can log-in to the CMS'
EDITONLYTHESE: 'Only these groups (choose from list)'
GroupPlaceholder: 'Click to select group'
SilverStripe\SiteConfig\SiteConfig:
EDITHEADER: 'Who can edit pages on this site?'
EDIT_PERMISSION: 'Manage site configuration'
Expand Down