In the i18n module for Drupal 5 there is no direct way of translating the vocabulary names whilst having associated translated terms. To translate the vocabulary names, I send them to the t() function then I create a translation in site configuration>localisation>manage strings.
Would it be possible to modify Faceted Search to send the vocabulary names to the t() function? Or is there another solution?
Many Thanks,
A Burton
Comments
Comment #1
ABurton commentedUpon further inspection, I read in the documentation that Faceted search should work with i18n. In Site Configuration>Multilingual System>Translation, all vocabularies are checked, (so that they are translated by the localisation system), but still the vocabulary names are not translated. (The terms are translated though).
Has anybody got any ideas?
Thanks,
A Burton
Comment #2
david lesieur commentedThe documentation you have read must have been that of the Drupal 6 branch. The Drupal 6 branch of Faceted Search supports localization of term and vocabulary names (coincidentally, this has been added to the dev version only yesterday!). However, there is not sufficient functionality in the Drupal 5 version of i18n to backport that code to Faceted Search for D5.
t() is not meant to be used with user data, which means it won't be added to Faceted Search for localizing term or vocabulary names.
The right way to solve this would be, I guess, to re-write the i18ntaxonomy module to use the i18nstrings module as in the D6 version. Then the localization code in Faceted Search could be backported to D5. This is not a task I intend to do, but patches are welcome.
Comment #3
ABurton commentedThanks for your swift reply. We are stuck with Drupal 5 for the moment because some of the modules we use have not yet been updated to Drupal 6. I will try and see if I can find a solution by studying the i18ntaxonomy, i18nstrings and faceted search modules. If anyone has any ideas or could help me, it would be most appreciated. I'm a bit surprised that no one else has had the same problem.
Thanks again,
A Burton
Comment #4
david lesieur commentedComment #5
ABurton commentedI found a solution by intercepting the facted search object and translating the vocabulary name before the block is created.
David, you said:
but for me vocabulary names are not user data. Could you please explain? Terms don't need to be localized as they are translated by the i18n module.
Anyway here is the modification I did to the hook_block implementation faceted_search_ui_block in the file faceted_search_ui.module. I have commented the modified lines. Please note, I started this post for version 5.x-1.0-beta4 but the following modif does not work for that version. We decided to stay with the 5.x-0.11 for which this modif works. Sorry, but I don't know how to make a patch. Any comments would be appreciated.
A. Burton
Comment #6
ABurton commentedSame modification in function faceted_search_ui_stage_facet() which is called when there are too many categories to display and we click on "more...". There are probably other places where the fix has to be made, but for us it is sufficient at least until we can upgrade to version 6.
A. Burton
Comment #7
david lesieur commentedTerms are user-entered data, even though the users might be site administrators. What I mean with "user-entered data" is data not originating from module source code.
This approach will work, but keep in mind that on some sites using t() that way will greatly "pollute" the locales_source table.
Comment #8
ABurton commentedOK, thanks. I think it will be alright because we have only have 15 vocabulary names to be translated with t(). Thanks again for you time,
A. Burton
Comment #9
drupalfan81 commentedHas anyone found a solution for this in D6. All my translated terms are displaying in Faceted Search, but the vocabulary names themselves are not being translated. My users cannot use the faceted search navigation if they cannot read what the vocabulary terms are. Any solutions to this problem?