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
16 * Convenience class for PHP-Gettext compatibility.
18 class CRM_Core_I18n_NativeGettext
{
25 public function translate($string) {
26 return gettext($string);
30 * Based on php-gettext, since native gettext does not support this as is.
37 public function pgettext($context, $text) {
38 $key = $context . chr(4) . $text;
39 $ret = $this->translate($key);
41 if (strpos($ret, "\004") !== FALSE) {
56 public function ngettext($text, $plural, $count) {
57 return ngettext($text, $plural, $count);