/** * Get the translated user label for a given internal property ID. * Returns empty string for properties without a translation (these are * usually internal, generated by SMW but not shown to the user). * * @note An empty string is returned for incomplete translation (language * bug) or deliberately invisible property * * @since 2.1 * * @param string $id * * @return string */ public function findPropertyLabelById($id) { // This is a hack but there is no other good way to make it work without // open a whole new can of worms // '__' indicates predefined properties of extensions that contain alias // and translated labels and if available we want the translated label if (substr($id, 0, 2) === '__' && ($label = $this->propertyAliasFinder->findPropertyAliasById($id))) { return $label; } // core has dedicated files per language so the label is available over // the invoked language return $this->propertyLabelFinder->findPropertyLabelById($id); }
/** * Get the translated user label for a given internal property ID. * Returns empty string for properties without a translation (these are * usually internal, generated by SMW but not shown to the user). * * @note An empty string is returned for incomplete translation (language * bug) or deliberately invisible property * * @since 2.1 * * @param string $id * * @return string */ public function findPropertyLabelById($id) { return $this->propertyLabelFinder->findPropertyLabelById($id); }