Merge pull request #3 from silverstripe-labs/pulls/transifex

Globalisation, transifex support
This commit is contained in:
Mateusz U 2013-10-29 13:47:19 -07:00
commit 3ad4f401ee
5 changed files with 39 additions and 9 deletions

8
.tx/config Normal file
View 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

View File

@ -21,3 +21,11 @@ Or just clone/download the git repository into a subfolder (usually called "vers
## Usage ## 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.

View File

@ -9,6 +9,10 @@ class VersionFeed extends SiteTreeExtension {
'PublicHistory' => true '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. * 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) { public function updateSettingsFields(FieldList $fields) {
// Add public history field. // Add public history field.
$fields->addFieldToTab('Root.Settings', $publicHistory = new FieldGroup( $fields->addFieldToTab('Root.Settings', $publicHistory = new FieldGroup(
new CheckboxField('PublicHistory', $this->owner->fieldLabel(_t( new CheckboxField('PublicHistory', $this->owner->fieldLabel('PublicHistory')
'RSSHistory.LABEL',
'Make history public'))
))); )));
$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 " . "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'); $fields->addFieldToTab('Root.Settings', new LiteralField('PublicHistoryWarning', $warning), 'PublicHistory');
if ($this->owner->CanViewType!='Anyone') { 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>" . "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>" . "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'); $fields->addFieldToTab('Root.Settings', new LiteralField('PublicHistoryWarning2', $warning), 'CanViewType');
} }

0
lang/_manifest_exclude Normal file
View File

9
lang/en.yml Normal file
View 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.'