Function Hook_translation_bing_translator->get_translation_context

Definitions

sources/hooks/systems/translation/bing_translator.php

  • Get translation context for future internal use.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$context integer No No required parameter N/A N/A A TRANS_TEXT_CONTEXT_* constant
$from ?LANGUAGE_NAME No No required parameter N/A N/A Source language (null: autodetect from the text itself)
$to LANGUAGE_NAME No No required parameter N/A N/A Destination language
&$errormsg ?string Yes No required parameter N/A N/A Error message (returned by reference) (null: not set yet)

Returns

  • Context metadata for the particular translation effort
  • Type: mixed
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get translation context for future internal use.
 *
 * @param  integer $context A TRANS_TEXT_CONTEXT_* constant
 * @param  ?LANGUAGE_NAME $from Source language (null: autodetect from the text itself)
 * @param  LANGUAGE_NAME $to Destination language
 * @param  ?string $errormsg Error message (returned by reference) (null: not set yet)
 * @return mixed Context metadata for the particular translation effort
 */

public function get_translation_context(int $context, ?string $from, string $to, ?string &$errormsg)