← Back to team overview

mahara-contributors team mailing list archive

[Bug 942676] Re: Language strings for plural.

 

Hi Mits, as Francois said, we needed to make things more flexible for
languages with more than two plural forms.  Gregor Anzelj asked us to
make this change for Slovenian, which has this sort of thing in the
language pack:

$string['nusers'] = array(
    0 => '1 uporabnik',
    1 => '%s uporabnika',
    2 => '%s uporabniki',
    3 => '%s uporabnikov',
);

Which plural form is chosen depends on some formula specific to the language.  For Slovenian it's something strange like this:
1 user, 101 users, 201 users, etc. -> 1st form
2 users, 102 users, 202 users, etc. -> 2nd form
3 users, 4 users, 103 users, 104 users, etc. -> 3rd form
everything else -> 4th form

So we can't just go back to the old way because it will result in
ungrammatical messages, and we'll gradually be moving the existing
plural strings over to the new system so that they can be translated
correctly.

Launchpad handles this relatively nicely, but I appreciate it's trickier
when editing the php language pack directly.  If someone were to propose
a system (and provide a patch) to simplify things for languages with
only one or two plural forms while retaining the flexibility we need,
we'd certainly consider it.

** Changed in: mahara
       Status: Triaged => Won't Fix

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
https://bugs.launchpad.net/bugs/942676

Title:
  Language strings for plural.

Status in Mahara ePortfolio:
  Won't Fix

Bug description:
  I think it's not so easy to translate Mahara strings for plural  using array() on translations.launchpad.net now.
  So it's good for Mahara translators using the standard string definition instead of using array() as below.

  ----------

  Langfile:
  artefact/file/lang/en.utf8/artefact.file.php

  [before]
  $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.',
  );

  [after]
  $string['fileattachedtoportfolioitem'] = 'This file is attached to %s other item in your portfolio.';
  $string['fileattachedtoportfolioitems'] = 'This file is attached to %s other items in your portfolio.';

  ----------

  Langfile:
  artefact/file/lang/en.utf8/artefact.file.php

  [before]
  $string['nprofilepictures'] = array(
      'Profile picture',
      'Profile pictures',
  );

  [after]
  $string['nprofilepicture'] = 'Profile picture';
  $string['nprofilepictures'] = 'Profile pictures';

  ----------

  Langfile:
  artefact/file/lang/en.utf8/artefact.file.php

  [before]
  $string['nfolders'] = array(
      '%s folder',
      '%s folders',
  );

  [after]
  $string['nprofilepicture'] = '%s folder';
  $string['nprofilepictures'] = '%s folders';

  ----------

  Langfile:
  artefact/file/lang/en.utf8/artefact.file.php

  [before]
  $string['nfiles'] = array(
      '%s file',
      '%s files',
  );

  [after]
  $string['nprofilepicture'] = '%s file';
  $string['nprofilepictures'] = '%s files';

  ----------

  Langfile:
  lang/en.utf8/mahara.php

  [before]
  $string['nusers'] = array(
      '1 user',
      '%s users',
  );

  [after]
  $string['nuser'] = '1 user';
  $string['nusers'] = '%s users';

  ----------

  Langfile:
  lang/en.utf8/view.php

  [before]
  $string['nviews'] = array(
      '1 page',
      '%s pages',
  );

  [after]
  $string['nview'] = '1 page';
  $string['nviews'] = '%s pages';

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/942676/+subscriptions


References