/** * Get data from context * * @since 1.0 * @return array */ public function get_context_data() { $data = array($this->id); if (function_exists('transposh_get_current_language')) { $data[] = transposh_get_current_language(); } return $data; }
/** * Function for use in themes to allow different outputs * @param string $default - the default text in the default language * @param array $altarray - array including alternatives in the format ("es" => "hola") */ function transposh_echo($default, $altarray) { if (isset($altarray[transposh_get_current_language()])) { echo TP_GTXT_BRK . $altarray[transposh_get_current_language()] . TP_GTXT_BRK_CLOSER; } else { echo $default; } }