1

I have been unable to configure things such that the Current Search Block or Search Facet block(s) have their strings show up in the Translation tool at :

admin/config/regional/translate/translate

They are however available in options in the translation tools filter

Please see attached image

I do have Facet API Translation installed

I have tried refreshing String translations at:

admin/config/regional/translate/i18n_string

And I have tried specifying the blocks as translatable on their respective blocks configuration forms (the form states that because the module is responsible for the content of the block that only Title translations are possible ... this is obviously not what I need to do to translate the blocks contents)

What are the Steps required to Translate Facet Search Block(s) and Current Search Block ?

1 Answer 1

0

I was able to solve this issue; however not in an ideal way:

see: https://drupal.org/node/1478908

see: https://drupal.org/node/1387504

see: https://drupal.org/node/1376786

see: https://drupal.org/project/facetapi_i18n

By implementing hook_block_view_alter and passing pieces of the markup to the translation function.

function MY_MODULE_block_view_alter(&$data, $block) {
    if($block->module == 'current_search'){
            $original_markup = $data['content']['results']['#markup'];
            $original_filtered = strip_tags($original_markup);
            $results_count_int = filter_var($original_filtered, FILTER_SANITIZE_NUMBER_INT);
            if($results_count_int){
                    $new_text = t('Search found @count item(s)', array('@count' => $results_count_int));
                    $new_markup = "<h3 class=\"\">$new_text</h3>";
                    $data['content']['results']['#markup'] = $new_markup;
            }
    }

}

1
  • hi @SMTF, can i see where did you implement this. thanks.
    – brainHax
    Feb 18, 2014 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.