Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jdanthinne’s picture

The advanced search form is generated by the core search module, not Custom Search… Where have you find the related node_type_get_names() in the i18n submodule?

cmseasy’s picture

Same issue here.

Using contenttypes (with translated names) as selector, the default language is shown in the select options in all languages. Is this related to the i18n submodule?

jdanthinne’s picture

Status: Active » Postponed (maintainer needs more info)

@cmseasy: which selector are you talking about? In the advanced search form (as this issue title says), or in the search block?

cmseasy’s picture

In the search block: see http://herder.com.mx/ in the menu.
The "refine your search" "- all -" and "close" are translatable, the contenttypes are not.
Libros / Books is a contenttype, I cannot change it to "Books" and the translation "Libros"

Maybe a different issue, but related...?

msweb69’s picture

I have same issue.
When change the language in my website, in a block with custom search the content types name not change language.
Not change also the language select for search or in italian or in english.
Sorry for my english!!!!

andypanix’s picture

Version: 7.x-1.13 » 7.x-1.x-dev
Component: i18n submodule » Code
Status: Postponed (maintainer needs more info) » Needs review
FileSize
630 bytes

This small patch apply to latest dev version and make the names of content types translatable.

  • jdanthinne committed 49fd75b on 7.x-1.x
    [#2165063] fixed by andypanix: translate content types.
    
jdanthinne’s picture

Status: Needs review » Fixed

Thanks.
Pushed to Dev and Custom Search 7.x-1.19.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rroose’s picture

I've upgraded to the new version (7.20) but the content types are still not using the translated entities nor do I see the option to translate the content types in when I translate the interface.

How should the content types be translated?

MariskaTh’s picture

Hello,

I'm facing the same problem. I have the newest update of the module. Is there any other solution yet?

Best regards,
Mariska.

joel_osc’s picture

FYI, wrapping the names in t is not a good solution... you need to use i18n here. Otherwise the end use will have multiple places where they need to translate the content-type name.

+    if (module_exists('i18n')) {
+      $name = i18n_node_type_name($machine_name, $name);
+    }
alexeye’s picture

.

jrochate’s picture

Same here:
- custom-search-7.x-1.x-dev
- custom_search_i18n-7.x-1.x-dev
- i18n_node-7.x-1.26
- translation-7.59

Already checked translation on admin/config/regional/translate/translate and make sure content types were translated.

Still, no translation on content types when user searches on en/search/node/example_term_search

Any tips?

joel_osc’s picture

It looks the (bad) patch got committed, with the content type name wrapped in a 't'. Here is the code in the dev version of this module:

       if (count($types)) {
          $names = node_type_get_names();
          if (count($types) > 1 || variable_get('custom_search_' . $delta . 'any_force', FALSE)) {
            $toptions['c-all'] = variable_get('custom_search_' . $delta . 'type_selector_all', CUSTOM_SEARCH_ALL_TEXT_DEFAULT);
          }
          foreach ($types as $type) {
            $toptions['c-' . $type] = t($names[$type]);
          }
        }

So this means that translating your content-type in the "Node types" text group will not be enough. You will need to translate it a second time in the "Built-in interface" text group.

jrochate’s picture

Issue summary: View changes

The "node type" string won't be available on "Built-in interface" if that string is not cumulative used somewhere else.

So, that's not a working solution, like you said on #12.

jrochate’s picture

Issue summary: View changes

Hi,

The content types are not being translated. I have tried to look into the code and the module appears to rely on node_type_get_names() which doesn't print the translation of the content types.

I have managed to solve my problem by overriding in template.php with this content:

theme/custom_search.pages.inc

by using i18n_node_type_name() in the two functions, I was able to show them translated in results page, which is fine.