public function formatUsage($usage) { return sprintf(Horde_Argv_Translation::t("Usage:") . " %s\n", $usage); }
public function formatOptionHelp($formatter = null) { if (is_null($formatter)) { $formatter = $this->formatter; } $formatter->storeOptionStrings($this); $result = array(); $result[] = $formatter->formatHeading(Horde_Argv_Translation::t("Options")); $formatter->indent(); if ($this->optionList) { $result[] = parent::formatOptionHelp($formatter); $result[] = "\n"; } foreach ($this->optionGroups as $group) { $result[] = $group->formatHelp($formatter); $result[] = "\n"; } $formatter->dedent(); // Drop the last "\n", or the header if no options or option groups: array_pop($result); return implode('', $result); }
/** * Returns the plural translation of a message. * * @param string $singular The singular version to translate. * @param string $plural The plural version to translate. * @param integer $number The number that determines singular vs. plural. * * @return string The string translation, or the original string if no * translation exists. */ public static function ngettext($singular, $plural, $number) { self::$_domain = 'Horde_Argv'; self::$_directory = '@data_dir@' == '@' . 'data_dir' . '@' ? __DIR__ . '/../../../locale' : '@data_dir@/Horde_Argv/locale'; return parent::ngettext($singular, $plural, $number); }
public function formatUsage($usage) { return sprintf("%s %s\n", $this->formatHeading(Horde_Argv_Translation::t("Usage")), $usage); }
public function checkChoice($opt, $value) { if (in_array($value, $this->choices)) { return $value; } else { $choices = array(); foreach ($this->choices as $choice) { $choices[] = (string) $choice; } $choices = "'" . implode("', '", $choices) . "'"; throw new Horde_Argv_OptionValueException(sprintf(Horde_Argv_Translation::t("option %s: invalid choice: '%s' (choose from %s)"), $opt, $value, $choices)); } }