summaryrefslogtreecommitdiffstats
path: root/inc/util.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r--inc/util.inc.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php
index 06cd8981..3d912f80 100644
--- a/inc/util.inc.php
+++ b/inc/util.inc.php
@@ -513,6 +513,18 @@ SADFACE;
}
/**
+ * Return localized strings for yes or no depending on $bool
+ * @param bool $bool Input to evaluate
+ * @return string Yes or No, in user's selected language
+ */
+ public static function boolToString($bool)
+ {
+ if ($bool)
+ return Dictionary::translate('lang_yes', true);
+ return Dictionary::translate('lang_no', true);
+ }
+
+ /**
* Format a duration, in seconds, into a readable string.
* @param int $seconds The number to format
* @param int $showSecs whether to show seconds, or rather cut after minutes