mirror of
https://github.com/silverstripe/silverstripe-versionfeed
synced 2024-10-22 11:05:31 +02:00
Merge pull request #3 from silverstripe-labs/pulls/transifex
Globalisation, transifex support
This commit is contained in:
commit
3ad4f401ee
8
.tx/config
Normal file
8
.tx/config
Normal file
@ -0,0 +1,8 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[silverstripe-versionfeed.master]
|
||||
file_filter = lang/<lang>.yml
|
||||
source_file = lang/en.yml
|
||||
source_lang = en
|
||||
type = YML
|
10
README.md
10
README.md
@ -20,4 +20,12 @@ Or just clone/download the git repository into a subfolder (usually called "vers
|
||||
|
||||
## Usage
|
||||
|
||||
For usage instructions see [user manual](docs/en/user.md).
|
||||
For usage instructions see [user manual](docs/en/user.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
### Translations
|
||||
|
||||
Translations of the natural language strings are managed through a third party translation interface, transifex.com. Newly added strings will be periodically uploaded there for translation, and any new translations will be merged back to the project source code.
|
||||
|
||||
Please use [https://www.transifex.com/projects/p/silverstripe-versionfeed](https://www.transifex.com/projects/p/silverstripe-versionfeed) to contribute translations, rather than sending pull requests with YAML files.
|
@ -9,6 +9,10 @@ class VersionFeed extends SiteTreeExtension {
|
||||
'PublicHistory' => true
|
||||
);
|
||||
|
||||
public function updateFieldLabels(&$labels) {
|
||||
$labels['PublicHistory'] = _t('RSSHistory.LABEL', 'Make history public');
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a list of changes to the current page, excluding non-published and explicitly secured versions.
|
||||
*
|
||||
@ -81,23 +85,24 @@ class VersionFeed extends SiteTreeExtension {
|
||||
public function updateSettingsFields(FieldList $fields) {
|
||||
// Add public history field.
|
||||
$fields->addFieldToTab('Root.Settings', $publicHistory = new FieldGroup(
|
||||
new CheckboxField('PublicHistory', $this->owner->fieldLabel(_t(
|
||||
'RSSHistory.LABEL',
|
||||
'Make history public'))
|
||||
new CheckboxField('PublicHistory', $this->owner->fieldLabel('PublicHistory')
|
||||
)));
|
||||
$publicHistory->setTitle($this->owner->fieldLabel('Public history'));
|
||||
|
||||
$warning =
|
||||
$warning = _t(
|
||||
'VersionFeed.Warning',
|
||||
"Publicising the history will also disclose the changes that have at the time been protected " .
|
||||
"from the public view.";
|
||||
"from the public view."
|
||||
);
|
||||
|
||||
$fields->addFieldToTab('Root.Settings', new LiteralField('PublicHistoryWarning', $warning), 'PublicHistory');
|
||||
|
||||
if ($this->owner->CanViewType!='Anyone') {
|
||||
$warning =
|
||||
$warning = _t(
|
||||
'VersionFeed.Warning2',
|
||||
"Changing access settings in such a way that this page or pages under it become publicly<br>" .
|
||||
"accessible may result in publicising all historical changes on these pages too. Please review<br>" .
|
||||
"this section's \"Public history\" settings to ascertain only intended information is disclosed.";
|
||||
"this section's \"Public history\" settings to ascertain only intended information is disclosed."
|
||||
);
|
||||
|
||||
$fields->addFieldToTab('Root.Settings', new LiteralField('PublicHistoryWarning2', $warning), 'CanViewType');
|
||||
}
|
||||
|
0
lang/_manifest_exclude
Normal file
0
lang/_manifest_exclude
Normal file
9
lang/en.yml
Normal file
9
lang/en.yml
Normal file
@ -0,0 +1,9 @@
|
||||
en:
|
||||
RSSHistory:
|
||||
LABEL: 'Make history public'
|
||||
SINGLEPAGEFEEDTITLE: 'Updates to %s page'
|
||||
SITEFEEDTITLE: 'Updates to %s'
|
||||
TITLECHANGED: 'Title has changed:'
|
||||
VersionFeed:
|
||||
Warning: 'Publicising the history will also disclose the changes that have at the time been protected from the public view.'
|
||||
Warning2: 'Changing access settings in such a way that this page or pages under it become publicly<br>accessible may result in publicising all historical changes on these pages too. Please review<br>this section''s "Public history" settings to ascertain only intended information is disclosed.'
|
Loading…
Reference in New Issue
Block a user