From 8b4fdd31c3d966958f33d6a629f9ff5bcbf27ee1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 24 Oct 2013 23:33:20 +0200 Subject: [PATCH] Globalisation, transifex support --- .tx/config | 8 ++++++++ README.md | 10 +++++++++- code/VersionFeed.php | 21 +++++++++++++-------- lang/_manifest_exclude | 0 lang/en.yml | 9 +++++++++ 5 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 .tx/config create mode 100644 lang/_manifest_exclude create mode 100644 lang/en.yml diff --git a/.tx/config b/.tx/config new file mode 100644 index 0000000..e7e385a --- /dev/null +++ b/.tx/config @@ -0,0 +1,8 @@ +[main] +host = https://www.transifex.com + +[silverstripe-versionfeed.master] +file_filter = lang/.yml +source_file = lang/en.yml +source_lang = en +type = YML \ No newline at end of file diff --git a/README.md b/README.md index 2c146d3..91e46a2 100644 --- a/README.md +++ b/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). \ No newline at end of file +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. \ No newline at end of file diff --git a/code/VersionFeed.php b/code/VersionFeed.php index fb4c619..bd2ec6d 100644 --- a/code/VersionFeed.php +++ b/code/VersionFeed.php @@ -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
" . "accessible may result in publicising all historical changes on these pages too. Please review
" . - "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'); } diff --git a/lang/_manifest_exclude b/lang/_manifest_exclude new file mode 100644 index 0000000..e69de29 diff --git a/lang/en.yml b/lang/en.yml new file mode 100644 index 0000000..9f96f8f --- /dev/null +++ b/lang/en.yml @@ -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
accessible may result in publicising all historical changes on these pages too. Please review
this section''s "Public history" settings to ascertain only intended information is disclosed.'