Commit d10b1993 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1053308: export section - plural strings format fix

behatnotneeded

Change-Id: Ie98a2f97da4db41565bc5a72ae7f270e0020d8b0
parent e785dd1b
...@@ -47,10 +47,7 @@ class HtmlExportBlog extends HtmlExportArtefactPlugin { ...@@ -47,10 +47,7 @@ class HtmlExportBlog extends HtmlExportArtefactPlugin {
} }
if ($blogs) { if ($blogs) {
$smarty->assign('blogs', $blogs); $smarty->assign('blogs', $blogs);
$stryouhaveblogs = get_string('youhavenblog', 'artefact.blog', count($blogs), count($blogs));
$stryouhaveblogs = (count($blogs) == 1)
? get_string('youhaveoneblog', 'artefact.blog')
: get_string('youhaveblogs', 'artefact.blog', count($blogs));
} }
else { else {
$stryouhaveblogs = get_string('youhavenoblogs', 'artefact.blog'); $stryouhaveblogs = get_string('youhavenoblogs', 'artefact.blog');
......
...@@ -161,8 +161,10 @@ $string['youhavenoblogs'] = 'You have no journals.'; ...@@ -161,8 +161,10 @@ $string['youhavenoblogs'] = 'You have no journals.';
$string['youhavenogroupblogs'] = 'There are no journals in this group.'; $string['youhavenogroupblogs'] = 'There are no journals in this group.';
$string['youhavenoinstitutionblogs'] = 'There are no journals in this institution.'; $string['youhavenoinstitutionblogs'] = 'There are no journals in this institution.';
$string['youhavenositeblogs'] = 'There are no site journals.'; $string['youhavenositeblogs'] = 'There are no site journals.';
$string['youhaveoneblog'] = 'You have 1 journal.'; $string['youhavenblog'] = array(
$string['youhaveblogs'] = 'You have %s journals.'; 'You have 1 journal.',
'You have %d journals.'
);
$string['feedsnotavailable'] = 'Feeds are not available for this artefact type.'; $string['feedsnotavailable'] = 'Feeds are not available for this artefact type.';
$string['feedrights'] = 'Copyright %s.'; $string['feedrights'] = 'Copyright %s.';
......
...@@ -44,8 +44,12 @@ class HtmlExportPlans extends HtmlExportArtefactPlugin { ...@@ -44,8 +44,12 @@ class HtmlExportPlans extends HtmlExportArtefactPlugin {
} }
$smarty->assign('plans', $plans); $smarty->assign('plans', $plans);
if (count($plans)) {
$smarty->assign('stryouhaveplans', get_string('youhavenplan', 'artefact.plans', count($plans), count($plans)));
}
return array( return array(
'title' => get_string('plans', 'artefact.plans'), 'title' => get_string('Plans', 'artefact.plans'),
'description' => $smarty->fetch('export:html/plans:summary.tpl'), 'description' => $smarty->fetch('export:html/plans:summary.tpl'),
); );
} }
......
...@@ -39,6 +39,10 @@ $string['planstasksdescription'] = 'Add tasks below or use the "%s" button to be ...@@ -39,6 +39,10 @@ $string['planstasksdescription'] = 'Add tasks below or use the "%s" button to be
$string['saveplan'] = 'Save plan'; $string['saveplan'] = 'Save plan';
$string['title'] = 'Title'; $string['title'] = 'Title';
$string['titledesc'] = 'The title will be used to display each task in the plans blocktype.'; $string['titledesc'] = 'The title will be used to display each task in the plans blocktype.';
$string['youhavenplan'] = array(
'You have 1 plan.',
'You have %d plans.'
);
/* Tasks */ /* Tasks */
$string['alltasks'] = 'All tasks'; $string['alltasks'] = 'All tasks';
......
...@@ -476,10 +476,7 @@ class PluginExportHtml extends PluginExport { ...@@ -476,10 +476,7 @@ class PluginExportHtml extends PluginExport {
if (!empty($list['views']) if (!empty($list['views'])
&& ($this->viewexportmode == self::EXPORT_ALL_VIEWS_COLLECTIONS && ($this->viewexportmode == self::EXPORT_ALL_VIEWS_COLLECTIONS
|| $this->viewexportmode == self::EXPORT_LIST_OF_VIEWS)) { || $this->viewexportmode == self::EXPORT_LIST_OF_VIEWS)) {
$stryouhaveviews = ($nviews == 1) $smarty->assign('stryouhaveviews', get_string('youhavenviews', 'view', $nviews, $nviews));
? get_string('youhaveoneview', 'view')
: get_string('youhaveviews', 'view', $nviews);
$smarty->assign('stryouhaveviews', $stryouhaveviews);
$smarty->assign('list', $list['views']); $smarty->assign('list', $list['views']);
$summary['view'] = array( $summary['view'] = array(
'title' => get_string('Views', 'view'), 'title' => get_string('Views', 'view'),
...@@ -493,10 +490,7 @@ class PluginExportHtml extends PluginExport { ...@@ -493,10 +490,7 @@ class PluginExportHtml extends PluginExport {
if (!empty($list['collections']) if (!empty($list['collections'])
&& ($this->viewexportmode == self::EXPORT_ALL_VIEWS_COLLECTIONS && ($this->viewexportmode == self::EXPORT_ALL_VIEWS_COLLECTIONS
|| $this->viewexportmode == self::EXPORT_LIST_OF_COLLECTIONS)) { || $this->viewexportmode == self::EXPORT_LIST_OF_COLLECTIONS)) {
$stryouhavecollections = ($ncollections == 1) $smarty->assign('stryouhavecollections', get_string('youhavencollections', 'collection', $ncollections, $ncollections));
? get_string('youhaveonecollection', 'collection')
: get_string('youhavecollections', 'collection', $ncollections);
$smarty->assign('stryouhavecollections', $stryouhavecollections);
$smarty->assign('list', $list['collections']); $smarty->assign('list', $list['collections']);
$summary['collection'] = array( $summary['collection'] = array(
'title' => get_string('Collections', 'collection'), 'title' => get_string('Collections', 'collection'),
......
...@@ -116,8 +116,10 @@ $string['copiedpagesblocksandartefactsfromtemplate'] = 'Copied %d pages, %d bloc ...@@ -116,8 +116,10 @@ $string['copiedpagesblocksandartefactsfromtemplate'] = 'Copied %d pages, %d bloc
$string['copiedblogpoststonewjournal'] = 'Copied journal posts have been put into a new separate journal.'; $string['copiedblogpoststonewjournal'] = 'Copied journal posts have been put into a new separate journal.';
$string['by'] = 'by'; $string['by'] = 'by';
$string['copycollection'] = 'Copy collection'; $string['copycollection'] = 'Copy collection';
$string['youhaveonecollection'] = 'You have 1 collection.'; $string['youhavencollections'] = array(
$string['youhavecollections'] = 'You have %s collections.'; 'You have 1 collection.',
'You have %d collections.',
);
$string['youhavenocollections'] = 'You have no collections.'; $string['youhavenocollections'] = 'You have no collections.';
$string['collectionssharedtogroup'] = 'Collections shared with this group'; $string['collectionssharedtogroup'] = 'Collections shared with this group';
$string['nosharedcollectionsyet'] = 'There are no collections shared with this group yet'; $string['nosharedcollectionsyet'] = 'There are no collections shared with this group yet';
......
...@@ -101,8 +101,10 @@ $string['nviews'] = array( ...@@ -101,8 +101,10 @@ $string['nviews'] = array(
); );
$string['youhavenoviews1'] = 'You don\'t have any pages or collections.'; $string['youhavenoviews1'] = 'You don\'t have any pages or collections.';
$string['youhaventcreatedanyviewsyet'] = "You have not created any pages yet."; $string['youhaventcreatedanyviewsyet'] = "You have not created any pages yet.";
$string['youhaveoneview'] = 'You have 1 page.'; $string['youhavenviews'] = array(
$string['youhaveviews'] = 'You have %s pages.'; 'You have 1 page.',
'You have %d pages.',
);
$string['viewsownedbygroup'] = 'Pages owned by this group'; $string['viewsownedbygroup'] = 'Pages owned by this group';
$string['nogroupviewsyet'] = 'There are no pages in this group yet'; $string['nogroupviewsyet'] = 'There are no pages in this group yet';
$string['viewssharedtogroup'] = 'Pages shared with this group'; $string['viewssharedtogroup'] = 'Pages shared with this group';
......
<p>{$stryouhaveplans}</p>
{if $plans} {if $plans}
<ul> <ul>
{foreach from=$plans item=plan} {foreach from=$plans item=plan}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment