Commit 526e4698 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use the plural form translations for selected strings (bug #901051)



Minor changes to several strings in the default language pack to use
plural forms.  This commit is intended as an example to demonstrate
the use of plural forms.

Change-Id: I425fbdaa10496c747b415e07e18aeb23736967b8
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 52a6e7e1
......@@ -70,6 +70,9 @@ $next .= (strpos($next, '?') === false ? '?' : '&') . 'folder=' . $status['basef
$SESSION->set('unzip', false);
$message = get_string('extractfilessuccess', 'artefact.file', $status['folderscreated'], $status['filescreated']);
$message = get_string('createdtwothings', 'artefact.file',
get_string('nfolders', 'artefact.file', $status['folderscreated']),
get_string('nfiles', 'artefact.file', $status['filescreated'])
);
print_extractprogress_footer($message, $next);
......@@ -154,7 +154,11 @@ function unzip_artefact_submit(Pieform $form, $values) {
$status = $file->extract();
$SESSION->add_ok_msg(get_string('extractfilessuccess', 'artefact.file', $status['folderscreated'], $status['filescreated']));
$message = get_string('createdtwothings', 'artefact.file',
get_string('nfolders', 'artefact.file', $status['folderscreated']),
get_string('nfiles', 'artefact.file', $status['filescreated'])
);
$SESSION->add_ok_msg($message);
$redirect = $from . (strpos($from, '?') === false ? '?' : '&') . 'folder=' . $status['basefolderid'];
redirect($redirect);
}
......@@ -337,7 +337,7 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
warn += get_string('defaultprofileicon') + ' ';
}
if (self.filedata[id].attachcount > 0) {
warn += get_string('fileattached', self.filedata[id].attachcount) + ' ';
warn += get_string('fileattachedtoportfolioitems', self.filedata[id].attachcount) + ' ';
}
if (self.filedata[id].viewcount > 0) {
warn += get_string('fileappearsinviews') + ' ';
......
......@@ -83,7 +83,10 @@ $string['File'] = 'File';
$string['fileadded'] = 'File selected';
$string['filealreadyindestination'] = 'The file you moved is already in that folder';
$string['fileappearsinviews'] = 'This file appears in one or more of your pages.';
$string['fileattached'] = 'This file is attached to %s other item(s) in your portfolio.';
$string['fileattachedtoportfolioitems'] = array(
0 => 'This file is attached to %s other item in your portfolio.',
1 => 'This file is attached to %s other items in your portfolio.',
);
$string['fileremoved'] = 'File removed';
$string['files'] = 'files';
$string['Files'] = 'Files';
......@@ -228,7 +231,10 @@ $string['noimagesfound'] = 'No images found';
$string['profileiconaddedtoimagesfolder'] = "Your profile picture has been uploaded to your '%s' folder.";
$string['profileiconsetdefaultnotvalid'] = 'Could not set the default profile picture, the choice was not valid';
$string['profileiconsdefaultsetsuccessfully'] = 'Default profile picture set successfully';
$string['profileiconsdeletedsuccessfully'] = 'Profile picture(s) deleted successfully';
$string['nprofilepictures'] = array(
'Profile picture',
'Profile pictures',
);
$string['profileiconsnoneselected'] = 'No profile pictures were selected to be deleted';
$string['onlyfiveprofileicons'] = 'You may upload only five profile pictures';
$string['or'] = 'or';
......@@ -248,7 +254,15 @@ $string['wrongfiletypeforblock'] = 'The file you uploaded was not the correct ty
// Unzip
$string['Contents'] = 'Contents';
$string['Continue'] = 'Continue';
$string['extractfilessuccess'] = 'Created %s folders and %s files.';
$string['nfolders'] = array(
'%s folder',
'%s folders',
);
$string['nfiles'] = array(
'%s file',
'%s files',
);
$string['createdtwothings'] = 'Created %s and %s.';
$string['filesextractedfromarchive'] = 'Files extracted from archive';
$string['filesextractedfromziparchive'] = 'Files extracted from Zip archive';
$string['fileswillbeextractedintofolder'] = 'Files will be extracted into %s';
......
......@@ -130,7 +130,7 @@ class PluginArtefactFile extends PluginArtefact {
'editfile',
'editfolder',
'fileappearsinviews',
'fileattached',
'fileattachedtoportfolioitems',
'filewithnameexists',
'folderappearsinviews',
'foldercontainsprofileicons',
......
......@@ -283,7 +283,9 @@ function settings_submit_delete(Pieform $form, $values) {
db_commit();
$SESSION->add_ok_msg(get_string('profileiconsdeletedsuccessfully', 'artefact.file'));
$SESSION->add_ok_msg(
get_string('filethingdeleted', 'artefact.file', get_string('nprofilepictures', 'artefact.file', count($icons)))
);
}
else {
$SESSION->add_info_msg(get_string('profileiconsnoneselected', 'artefact.file'));
......
......@@ -110,7 +110,10 @@ $string['youhavenottaggedanythingyet'] = 'You have not tagged anything yet';
$string['mytags'] = 'My Tags';
$string['Tag'] = 'Tag';
$string['itemstaggedwith'] = 'Items tagged with "%s"';
$string['numitems'] = '%s items';
$string['nitems'] = array(
'%s item',
'%s items',
);
$string['searchresultsfor'] = 'Search results for';
$string['alltags'] = 'All Tags';
$string['sortalpha'] = 'Sort tags alphabetically';
......
......@@ -2,7 +2,7 @@
<div class="sidebar-content tagblock">
{if $sbdata.tags}
{foreach from=$sbdata.tags item=tag}
<a class="tag"{if $tag->size} style="font-size: {$tag->size}em;"{/if} href="{$WWWROOT}tags.php?tag={$tag->tag|urlencode|safe}" title="{str tag=numitems arg1=$tag->count}">{$tag->tag|str_shorten_text:20}</a>
<a class="tag"{if $tag->size} style="font-size: {$tag->size}em;"{/if} href="{$WWWROOT}tags.php?tag={$tag->tag|urlencode|safe}" title="{str tag=nitems arg1=$tag->count}">{$tag->tag|str_shorten_text:20}</a>
{/foreach}
{else}
{str tag=youhavenottaggedanythingyet}
......
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