FIX Update translation class names and replace sprintf translations with parameters

This commit is contained in:
Robbie Averill 2017-12-13 15:36:20 +13:00
parent 5096179825
commit bfba519cc3
8 changed files with 39 additions and 24 deletions

View File

@ -1,11 +1,12 @@
en:
SilverStripe\VersionFeed\VersionFeed:
LABEL: 'Make history public'
SINGLEPAGEFEEDTITLE: 'Updates to %s page'
SITEFEEDTITLE: 'Updates to %s'
SINGLEPAGEFEEDTITLE: 'Updates to {title} page'
SITEFEEDTITLE: 'Updates to {title}'
TITLECHANGED: 'Title has changed:'
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.'
SilverStripe\VersionFeed\VersionFeedSiteConfig:
ALLCHANGES: 'All page changes'
ALLCHANGESLABEL: 'Make global changes feed public'
Warning: 'Publicising the history will also disclose the changes that have at the time been protected from the public view.'

View File

@ -1,8 +1,8 @@
eo:
SilverStripe\VersionFeed\VersionFeed:
LABEL: 'Publikigu historion'
SINGLEPAGEFEEDTITLE: 'Ĝisdatigoj al paĝo %s'
SITEFEEDTITLE: 'Ĝisdatigoj al %s'
SINGLEPAGEFEEDTITLE: 'Ĝisdatigoj al paĝo {title}'
SITEFEEDTITLE: 'Ĝisdatigoj al {title}'
TITLECHANGED: 'Titolo estas ŝanĝita:'
Warning: 'Publikigi la historion ankaŭ malkaŝos la ŝanĝojn ĝis tiam protektitajn kontraŭ publika vido.'
Warning2: 'Ŝanĝi la alirajn agordojn tiel ke ĉi tiu paĝo, aŭ paĝoj sub ĝi, fariĝas publike alireblaj <br>eble rezultigos ke publikiĝos ĉiuj historiaj ŝanĝoj en tiuj paĝoj. Bonvole rekonsideru <br> la sekcion "Publika historio" de ĉi tiu sekcio, por certigi ke nur intencita informo publikiĝu.'

View File

@ -1,8 +1,8 @@
fi_FI:
SilverStripe\VersionFeed\VersionFeed:
LABEL: 'Tee historiasta julkinen'
SINGLEPAGEFEEDTITLE: 'Päivityksiä %s sivuun'
SITEFEEDTITLE: 'Päivityksiä: %s'
SINGLEPAGEFEEDTITLE: 'Päivityksiä {title} sivuun'
SITEFEEDTITLE: 'Päivityksiä: {title}'
TITLECHANGED: 'Otsikko on muuttunut:'
Warning: 'Historian julkaisu paljastaa myös muutokset, jotka ovat suojattu julkiselta tarkastelulta.'
Warning2: 'Muutettaessa tämä tai sen alasivut julkisiksi,<br>voi toimenpide aiheuttaa myös kaiken muutoshistorian muuttumisen julkiseksi kyseisillä sivuilla. Ole hyvä<br>ja tarkista "Julkinen historia"-asetuksista, että vain haluttu tieto on julkaistuna.'

View File

@ -1,8 +1,8 @@
hr:
SilverStripe\VersionFeed\VersionFeed:
LABEL: 'Učini povijest dostupnu svima'
SINGLEPAGEFEEDTITLE: 'Ažuriranja za %s stranicu'
SITEFEEDTITLE: 'Ažuriranja za %s'
SINGLEPAGEFEEDTITLE: 'Ažuriranja za {title} stranicu'
SITEFEEDTITLE: 'Ažuriranja za {title}'
TITLECHANGED: 'Naziv se promijenio:'
Warning: 'Objavom povijesti će se također otkriti promjene koje su u to vrijeme bili zaštićeni od očiju javnosti.'
Warning2: 'Promjenom postavki pristupi na takav način će učiniti da ova stranica ili stranice ispod nje postanu javno<br>dostupne mogu rezultirati objavomm svih povijesnih promjena na tim stranicama također. Molimo pregledajte<br>podatke sekcije "Public history" da budete sigurni samo željene informacije da su prikazane.'

View File

@ -1,8 +1,8 @@
mi:
SilverStripe\VersionFeed\VersionFeed:
LABEL: 'Meinga kia tūmatanui te hītori'
SINGLEPAGEFEEDTITLE: 'Ngā whakahou ki te whārangi %s'
SITEFEEDTITLE: 'Ngā whakahou ki te %s'
SINGLEPAGEFEEDTITLE: 'Ngā whakahou ki te whārangi {title}'
SITEFEEDTITLE: 'Ngā whakahou ki te {title}'
TITLECHANGED: 'Kua hurihia te taitara:'
Warning: 'Mā te whakarite kia tūmatanui te hītori ka whakaaturia hoki ngā huringa o mua tērā i hunaia i te tirohanga tūmatanui.'
Warning2: 'Mā te huri i ngā tautuhinga uru kia noho wātea <br>tūmatanui ai tēnei whārangi, ngā whārangi rānei i raro i taua whārangi, tērā pea ko te mutunga iho ko te wātea tūmatanui o ngā huringa hītori katoa i aua whārangi. Me arotake<br>ngā tautuhinga "Hītori tūmatanui" o tēnei wāhanga kia mōhio ai ka whakaaturia anake ngā mōhiohio ka hiahiatia.'

View File

@ -1,8 +1,8 @@
zh:
SilverStripe\VersionFeed\VersionFeed:
LABEL: '将历史记录公开'
SINGLEPAGEFEEDTITLE: '更新至 %s 页面'
SITEFEEDTITLE: '更新至 %s'
SINGLEPAGEFEEDTITLE: '更新至 {title} 页面'
SITEFEEDTITLE: '更新至 {title}'
TITLECHANGED: '标题已更改:'
Warning: '发布历史记录还会在公开视图中显示受保护事件内进行的改动。'
Warning2: '用这种方式更改访问设置会使得本页及下级页面变为公开的<br>可能还会使得这些页面的所有变动历史记录也变为公开的。请查阅<br>本节的“公开历史记录”设置,确保只将需要的信息披露出来。'

View File

@ -3,14 +3,12 @@
namespace SilverStripe\VersionFeed;
use SilverStripe\Core\Config\Config;
use SilverStripe\VersionFeed\VersionFeed;
use SilverStripe\Control\RSS\RSSFeed;
use SilverStripe\SiteConfig\SiteConfig;
use SilverStripe\ORM\DB;
use SilverStripe\Security\Member;
use SilverStripe\ORM\ArrayList;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Versioned\Versioned_Version;
use SilverStripe\Core\Convert;
use SilverStripe\View\Requirements;
use SilverStripe\Core\Extension;
@ -18,7 +16,6 @@ use SilverStripe\VersionFeed\Filters\ContentFilter;
class VersionFeedController extends Extension
{
private static $allowed_actions = array(
'changes',
'allchanges'
@ -84,7 +81,11 @@ class VersionFeedController extends Extension
});
// Generate the output.
$title = sprintf(_t(VersionFeed::class . '.SINGLEPAGEFEEDTITLE', 'Updates to %s page'), $this->owner->Title);
$title = _t(
'SilverStripe\\VersionFeed\\VersionFeed.SINGLEPAGEFEEDTITLE',
'Updates to {title} page',
['title' => $this->owner->Title]
);
$rss = new RSSFeed($entries, $this->owner->request->getURL(), $title, '', 'Title', '', null);
$rss->setTemplate('Page_changes_rss');
return $rss->outputToBrowser();
@ -148,7 +149,15 @@ class VersionFeedController extends Extension
// Produce output
$url = $this->owner->getRequest()->getURL();
$rss = new RSSFeed($changeList, $url, $this->linkToAllSitesRSSFeedTitle(), '', 'Title', '', null);
$rss = new RSSFeed(
$changeList,
$url,
$this->linkToAllSitesRSSFeedTitle(),
'',
'Title',
'',
null
);
$rss->setTemplate('Page_allchanges_rss');
return $rss->outputToBrowser();
}
@ -164,9 +173,10 @@ class VersionFeedController extends Extension
RSSFeed::linkToFeed(
$this->owner->Link('changes'),
sprintf(
_t(VersionFeed::class . '.SINGLEPAGEFEEDTITLE', 'Updates to %s page'),
$this->owner->Title
_t(
'SilverStripe\\VersionFeed\\VersionFeed.SINGLEPAGEFEEDTITLE',
'Updates to {title} page',
['title' => $this->owner->Title]
)
);
}
@ -194,6 +204,10 @@ class VersionFeedController extends Extension
public function linkToAllSitesRSSFeedTitle()
{
return sprintf(_t(VersionFeed::class . '.SITEFEEDTITLE', 'Updates to %s'), SiteConfig::current_site_config()->Title);
return _t(
'SilverStripe\\VersionFeed\\VersionFeed.SITEFEEDTITLE',
'Updates to {title}',
['title' => SiteConfig::current_site_config()->Title]
);
}
}

View File

@ -25,7 +25,7 @@ class VersionFeedSiteConfig extends DataExtension
public function updateFieldLabels(&$labels)
{
$labels['AllChangesEnabled'] = _t(VersionFeedSiteConfig::class . '.ALLCHANGESLABEL', 'Make global changes feed public');
$labels['AllChangesEnabled'] = _t(__CLASS__ . '.ALLCHANGESLABEL', 'Make global changes feed public');
}
public function updateCMSFields(FieldList $fields)
@ -37,9 +37,9 @@ class VersionFeedSiteConfig extends DataExtension
$fields->addFieldToTab(
'Root.Access',
FieldGroup::create(new CheckboxField('AllChangesEnabled', $this->owner->fieldLabel('AllChangesEnabled')))
->setTitle(_t(VersionFeedSiteConfig::class . '.ALLCHANGES', 'All page changes'))
->setTitle(_t(__CLASS__ . '.ALLCHANGES', 'All page changes'))
->setDescription(_t(
VersionFeed::class . '.Warning',
__CLASS__ . '.Warning',
"Publicising the history will also disclose the changes that have at the time been protected " .
"from the public view."
))