ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Po.php
Go to the documentation of this file.
1 <?php
3 
4 use Exception;
5 
6 class Po extends Exporter
7 {
11  protected static function toStringDo($languages)
12  {
13  if (count($languages) !== 1) {
14  throw new Exception('The '.get_called_class().' exporter can only export one language');
15  }
16  $language = $languages[0];
17  $lines = array();
18  $lines[] = '"Language: '.$language->id.'\n"';
19  $lines[] = '"Plural-Forms: nplurals='.count($language->categories).'; plural='.$language->formula.'\n"';
20  $lines[] = '';
21 
22  return implode("\n", $lines);
23  }
27  public static function getDescription()
28  {
29  return 'Build a string to be used for gettext .po files';
30  }
31 }
Base class for all the exporters.
Definition: Exporter.php:10
static toStringDo($languages)
Definition: Po.php:11
$languages
Definition: cssgen2.php:34