You are here

function i18nstrings_save_context in Internationalization 6

Save / update context metadata.

There seems to be a race condition sometimes so skip errors, #277711

1 call to i18nstrings_save_context()
i18nstrings_add_string in i18nstrings/i18nstrings.module
Add source string to the locale tables for translation.

File

i18nstrings/i18nstrings.module, line 500
Internationalization (i18n) package - translatable strings.

Code

function i18nstrings_save_context($context) {
  if (db_result(db_query('SELECT lid FROM {i18n_strings} WHERE lid = %d', $context->lid))) {
    @db_query("UPDATE {i18n_strings} SET type = '%s', objectid = '%s', objectindex = %d, property = '%s', format = %d WHERE lid = %d", $context->type, $context->objectid, (int) $context->objectid, $context->property, $context->format, $context->lid);
  }
  else {
    @db_query("INSERT INTO {i18n_strings} (lid, type, objectid, objectindex, property, format) VALUES(%d, '%s', '%s', %d, '%s', %d)", $context->lid, $context->type, $context->objectid, (int) $context->objectid, $context->property, $context->format);
  }
}