Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
Provide tools for translation and display of text in multiple languages and support for regionalization/localization for dates, numbers, currency, measurement, or other local contexts.
Changes the way in which Solr Search module stores the multilingual content, making it use solr dynamic fields for translatable entity fields.
For example, when indexing "body:value" field, solr would normally store its value in tm_body:value property. With this hook (assuming that body field is translatable and comes from translatable entity, and that currently being processed content language is fr) it will be stored in tm_fr_body:value instead, with nothing saved to default tm_body:value property.
Obviously it also works when retrieving data from solr, looking for language-based dynamic fields, and, if they exist - assigning their values back to relevant Search API properties (not language-based anymore).