You are here

public function i18n_string_textgroup_default::context_update in Internationalization 7

Update / create translation source for user defined strings.

Parameters

$name: Textgroup and location glued with ':'.

$string: Source string in default language. Default language may or may not be English.

$options: Array with additional options:

  • 'format', String format if the string has text format.
  • 'messages', Whether to print out status messages.
  • 'check', whether to check string format and then update/delete if not allowed.

File

i18n_string/i18n_string.inc, line 804
API for internationalization strings

Class

i18n_string_textgroup_default
Textgroup handler for i18n_string API

Code

public function context_update($context, $string, $options = array()) {
  $options += array(
    'format' => FALSE,
    'messages' => $this->debug,
    'watchdog' => TRUE,
    'check' => TRUE,
  );
  $i18nstring = $this
    ->build_string($context, $string);
  $i18nstring->format = $options['format'];
  $this
    ->string_update($i18nstring, $options);
  return $this;
}