Closed (fixed)
Project:
Facet API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2011 at 07:40 UTC
Updated:
9 Jan 2012 at 15:22 UTC
Jump to comment: Most recent file
I added support:
-i18n_taxonomy in callbacks,
-i18n_node in callbacks
-translated language in callback
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | facetapi-i18n_support-1368206.patch | 1.38 KB | janchojnacki |
| #6 | translate_language.patch | 519 bytes | benys |
| support_i18n.patch | 1.4 KB | benys |
Comments
Comment #1
cpliakas commentedThanks for the post and patch. Marking as "needs work for a couple of reasons.
It looks like facetapi_map_language() passes the language variable through t(), which is against best practices. See http://drupal.org/node/322729, specifically the passage below:
Are we sure that these strings have already been passed through t()? This is an area I am not too familiar with, so any clarification or confirmation would be helpful.
Also, based off of comments on the Facetapi i18n project, the patch to i18n_taxonomy at http://drupal.org/node/1340858#comment-5259368 apparently resolves the taxonomy issue.
Thanks,
Chris
Comment #2
benys commentedI checked how are implemented translation language names for example on /admin/config/regional/language/add page - handler locale_languages_predefined_form(). In function _locale_prepare_predefined_list() t() is used to translate language name:-).
Comment #3
cpliakas commentedGreat! Thanks for pointing that out and confirming.
Comment #4
benys commentedWhat should I do now?
Comment #5
cpliakas commentedI think based on thegreat's commets in his sandbox project we can skip the changes to the
facetapi_map_taxonomy_terms()callback since the i18n module is being worked on to support this without any changes to Facet API. Based on your feedback, the change to thefacetapi_map_language()callback is valid and I think would be a great addition to the module.In terms of the
facetapi_map_bundle(), I am hesitant to start committing code withmodule_exists()calls. In addition, there is work going on at #1338350: Extend facetapi_map_bundle() to all entity types which make this callback generic to all entities which would effect the proposed logic in the patch. I am thinking that this might be a good candidate for a project like Facetapi i18n where you could implement hook_facetapi_facet_info_alter() to modify the appropriate map callback keys to point to a custom callback with the i18n code you posted.Comment #6
benys commentedI created task in i18n #1371610: Node types Facetapi integration.
I attached only patch with translation languages.
Comment #7
cpliakas commentedThis is great. Thanks for opening the issue against i18n as well. Let's see what comes out of that and we can revisit in Facet API if necessary / once the
facetapi_map_bundle()function gets re-worked.Comment #8
cpliakas commentedChanging title to focus it down to what the patch accomplishes.
Comment #9
cpliakas commentedCommitted at http://drupalcode.org/project/facetapi.git/commit/8004a76.
Congrats on becoming the 16th committer to Facet API!
Comment #10
benys commentedThank you but...
i18n's staffs don't like our ticket :-(. They won't apply patch:-(
What can we do with this?
Comment #11
cpliakas commentedAs a quick solution you can always alter the facet info in a custom module and implement your own mapping callbacks. I have to do some research to figure out a consistent i18n strategy for the entire module. The new current search functionality introduces a whole new set of issues, so I want to make sure we are consistent in our approach.
Comment #12
cpliakas commentedChanging title for transparency as to what was done.
Comment #13
cpliakas commentedNote that the Facet API Translation module now provides the content type mapping capability.
Thanks,
Chris
Comment #14
janchojnacki commentedBenys, thank you for your patch. I saw one error in if($i18n_taxonomy_on) { condition. Adding working patch for me.
Comment #15
cpliakas commentedClosing this issue, as the only supported translation method moving forward will be the Facet API Translation module.
Thanks,
Chris