3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
18 * Convenience class for PHP-Gettext compatibility.
20 class CRM_Core_I18n_NativeGettext
{
27 public function translate($string) {
28 return gettext($string);
32 * Based on php-gettext, since native gettext does not support this as is.
39 public function pgettext($context, $text) {
40 $key = $context . chr(4) . $text;
41 $ret = $this->translate($key);
43 if (strpos($ret, "\004") !== FALSE) {
58 public function ngettext($text, $plural, $count) {
59 return ngettext($text, $plural, $count);