equal
deleted
inserted
replaced
10 require_once __DIR__ . '/plural-forms.php'; |
10 require_once __DIR__ . '/plural-forms.php'; |
11 require_once __DIR__ . '/entry.php'; |
11 require_once __DIR__ . '/entry.php'; |
12 |
12 |
13 if ( ! class_exists( 'Translations', false ) ) : |
13 if ( ! class_exists( 'Translations', false ) ) : |
14 class Translations { |
14 class Translations { |
15 var $entries = array(); |
15 public $entries = array(); |
16 var $headers = array(); |
16 public $headers = array(); |
17 |
17 |
18 /** |
18 /** |
19 * Add entry to the PO structure |
19 * Add entry to the PO structure |
20 * |
20 * |
21 * @param array|Translation_Entry $entry |
21 * @param array|Translation_Entry $entry |
114 * 0 if there is one element, 1 otherwise |
114 * 0 if there is one element, 1 otherwise |
115 * |
115 * |
116 * This function should be overridden by the subclasses. For example MO/PO can derive the logic |
116 * This function should be overridden by the subclasses. For example MO/PO can derive the logic |
117 * from their headers. |
117 * from their headers. |
118 * |
118 * |
119 * @param integer $count number of items |
119 * @param int $count number of items |
120 */ |
120 */ |
121 function select_plural_form( $count ) { |
121 function select_plural_form( $count ) { |
122 return 1 == $count ? 0 : 1; |
122 return 1 == $count ? 0 : 1; |
123 } |
123 } |
124 |
124 |
299 if ( ! class_exists( 'NOOP_Translations', false ) ) : |
299 if ( ! class_exists( 'NOOP_Translations', false ) ) : |
300 /** |
300 /** |
301 * Provides the same interface as Translations, but doesn't do anything |
301 * Provides the same interface as Translations, but doesn't do anything |
302 */ |
302 */ |
303 class NOOP_Translations { |
303 class NOOP_Translations { |
304 var $entries = array(); |
304 public $entries = array(); |
305 var $headers = array(); |
305 public $headers = array(); |
306 |
306 |
307 function add_entry( $entry ) { |
307 function add_entry( $entry ) { |
308 return true; |
308 return true; |
309 } |
309 } |
310 |
310 |