Globalisation, transifex support

This commit is contained in:
Ingo Schommer 2013-10-24 23:33:20 +02:00
parent d1dcd2bf3c
commit 8b4fdd31c3
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

@ -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.

View File

@ -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
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.'