You are here

function _search_by_page_paths_update_translation in Search by Page 8

Updates the strings to be translated for one path record.

Parameters

$vals: Associative array of information from sbpp_path table.

2 calls to _search_by_page_paths_update_translation()
search_by_page_paths_edit_form_submit in search_by_page_paths/search_by_page_paths.module
Submit callback for search_by_page_paths_edit_form().
_search_by_page_paths_refresh_all_translations in search_by_page_paths/search_by_page_paths.module
Refreshes all path info translations.

File

search_by_page_paths/search_by_page_paths.module, line 566
Module file for Search by Page Paths, a sub-module for Search by Page.

Code

function _search_by_page_paths_update_translation($vals) {
  if (\Drupal::moduleHandler()
    ->moduleExists('i18n_string') && $vals['pid']) {
    $code = 'search_by_page_paths:path:' . $vals['pid'] . ':';
    i18n_string_update($code . 'title', $vals['title']);
    i18n_string_update($code . 'type', $vals['type']);
    $snip = mb_strtolower($vals['snippet']);
    if ($snip != 'yes' && $snip != 'no') {
      i18n_string_update($code . 'snippet', $vals['snippet']);
    }
  }
}