|
|
@@ -1084,6 +1084,26 @@
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
+ * Allows you to override the current domain for a single message lookup.
|
|
|
+ *
|
|
|
+ * @param string $domain
|
|
|
+ * @param string $msg
|
|
|
+ * @param string $return
|
|
|
+ * @return translated string if $return is false string will be echoed
|
|
|
+ */
|
|
|
+ function __d($domain, $msg, $return = false) {
|
|
|
+ if(!class_exists('I18n')) {
|
|
|
+ uses('i18n');
|
|
|
+ }
|
|
|
+
|
|
|
+ if($return === false) {
|
|
|
+ echo I18n::translate($msg, null, $domain);
|
|
|
+ } else {
|
|
|
+ return I18n::translate($msg, null, $domain);
|
|
|
+ }
|
|
|
+ }
|
|
|
+/**
|
|
|
+ *
|
|
|
* Allows you to override the current domain for a single plural message lookup
|
|
|
* Returns correct plural form of message identified by $singular and $plural for count $count
|
|
|
* from domain $domain
|
|
|
@@ -1099,21 +1119,17 @@
|
|
|
if(!class_exists('I18n')) {
|
|
|
uses('i18n');
|
|
|
}
|
|
|
- $calledFrom = debug_backtrace();
|
|
|
- $dir = dirname($calledFrom[0]['file']);
|
|
|
|
|
|
if($return === false) {
|
|
|
- echo I18n::translate($singular, $plural, $domain, 5, $count, $dir);;
|
|
|
+ echo I18n::translate($singular, $plural, $domain, 5, $count);
|
|
|
} else {
|
|
|
- return I18n::translate($singular, $plural, $domain, 5, $count, $dir);
|
|
|
+ return I18n::translate($singular, $plural, $domain, 5, $count);
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
- * Allows you to override the current domain for a single plural message lookup.
|
|
|
+ * Allows you to override the current domain for a single message lookup.
|
|
|
* It also allows you to specify a category.
|
|
|
- * Returns correct plural form of message identified by $singular and $plural for count $count
|
|
|
- * from domain $domain
|
|
|
*
|
|
|
* The category argument allows a specific category of the locale settings to be used for fetching a message.
|
|
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
|
|
@@ -1128,30 +1144,28 @@
|
|
|
* LC_ALL 6
|
|
|
*
|
|
|
* @param string $domain
|
|
|
- * @param string $singular
|
|
|
- * @param string $plural
|
|
|
- * @param integer $count
|
|
|
+ * @param string $msg
|
|
|
* @param string $category
|
|
|
* @param boolean $return
|
|
|
- * @return plural form of translated string if $return is false string will be echoed
|
|
|
+ * @return translated string if $return is false string will be echoed
|
|
|
*/
|
|
|
- function __dcn($domain, $singular, $plural, $count, $category, $return = false) {
|
|
|
+ function __dc($domain, $msg, $category, $return = false) {
|
|
|
if(!class_exists('I18n')) {
|
|
|
uses('i18n');
|
|
|
}
|
|
|
- $calledFrom = debug_backtrace();
|
|
|
- $dir = dirname($calledFrom[0]['file']);
|
|
|
|
|
|
if($return === false) {
|
|
|
- echo I18n::translate($singular, $plural, $domain, $category, $count, $dir);
|
|
|
+ echo I18n::translate($msg, null, $domain, $category);
|
|
|
} else {
|
|
|
- return I18n::translate($singular, $plural, $domain, $category, $count, $dir);
|
|
|
+ return I18n::translate($msg, null, $domain, $category);
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
- * Allows you to override the current domain for a single message lookup.
|
|
|
+ * Allows you to override the current domain for a single plural message lookup.
|
|
|
* It also allows you to specify a category.
|
|
|
+ * Returns correct plural form of message identified by $singular and $plural for count $count
|
|
|
+ * from domain $domain
|
|
|
*
|
|
|
* The category argument allows a specific category of the locale settings to be used for fetching a message.
|
|
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
|
|
@@ -1166,48 +1180,26 @@
|
|
|
* LC_ALL 6
|
|
|
*
|
|
|
* @param string $domain
|
|
|
- * @param string $msg
|
|
|
+ * @param string $singular
|
|
|
+ * @param string $plural
|
|
|
+ * @param integer $count
|
|
|
* @param string $category
|
|
|
* @param boolean $return
|
|
|
- * @return translated string if $return is false string will be echoed
|
|
|
+ * @return plural form of translated string if $return is false string will be echoed
|
|
|
*/
|
|
|
- function __dc($domain, $msg, $category, $return = false) {
|
|
|
+ function __dcn($domain, $singular, $plural, $count, $category, $return = false) {
|
|
|
if(!class_exists('I18n')) {
|
|
|
uses('i18n');
|
|
|
}
|
|
|
- $calledFrom = debug_backtrace();
|
|
|
- $dir = dirname($calledFrom[0]['file']);
|
|
|
|
|
|
if($return === false) {
|
|
|
- echo I18n::translate($msg, null, $domain, $category, null, $dir);
|
|
|
+ echo I18n::translate($singular, $plural, $domain, $category, $count);
|
|
|
} else {
|
|
|
- return I18n::translate($msg, null, $domain, $category, null, $dir);
|
|
|
+ return I18n::translate($singular, $plural, $domain, $category, $count);
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
- * Allows you to override the current domain for a single message lookup.
|
|
|
- *
|
|
|
- * @param string $domain
|
|
|
- * @param string $msg
|
|
|
- * @param string $return
|
|
|
- * @return translated string if $return is false string will be echoed
|
|
|
- */
|
|
|
- function __d($domain, $msg, $return = false) {
|
|
|
- if(!class_exists('I18n')) {
|
|
|
- uses('i18n');
|
|
|
- }
|
|
|
- $calledFrom = debug_backtrace();
|
|
|
- $dir = dirname($calledFrom[0]['file']);
|
|
|
-
|
|
|
- if($return === false) {
|
|
|
- echo I18n::translate($msg, null, $domain, 5, null, $dir);
|
|
|
- } else {
|
|
|
- return I18n::translate($msg, null, $domain, 5, null, $dir);
|
|
|
- }
|
|
|
- }
|
|
|
-/**
|
|
|
- *
|
|
|
* The category argument allows a specific category of the locale settings to be used for fetching a message.
|
|
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
|
|
*
|