Closed (won't fix)
Project:
Internationalization
Version:
6.x-1.5
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2008 at 15:43 UTC
Updated:
20 Sep 2011 at 13:13 UTC
I've read the documentation and don't see much help there in trying to get my modules to work with i18n. I am the owner/maintainer of several taxonomy-related modules and would like to make them work right with i18n. Currently there is an issue open against the Glossary module, which is as good as any to get working first. Please check http://drupal.org/node/233688.
What I need is a better step-by-step guide to making taxonomy-related modules work correctly when i18n is installed.
Comments
Comment #1
xanoI agree with Nancy. I would like to make Vocabulary Index compatible with i18n. For that I need to know about the possibilities to generate a taxonomy tree, but only with the terms belonging to the currently used language. Does i18n provide a function like taxonomy_get_tree() or do I have to create my own function that includes i18n support for creating trees?
Comment #2
nancydruMy modules use either db_rewrite_sql (which i18n intercepts, I believe) or taxonomy_get_tree (which has db_rewrite_sql). I though i18N took care of this in 5.x (at least it seemed to), but doesn't seem to be doing it in 6.x.
Comment #3
xanoSo you say i18n override the taxonomy_get_tree() query? That's worth checking it out...
Comment #4
AaronCollier commentedi8ntaxonomy 6.x has db_rewrite_sql:
The mention of taxonomy_get_tree:
Comment #5
nancydruWell, I can understand the db_rewrite_sql code and see a big problem with it. I don't identify my term_data as "t" -- it's usually "td". This is why module writers need some documentation. I can change my modules; I'm not sure why I really should have to, but I will.
I don't claim to completely understand the get_tree code, but I do know this: I am not going to be adding that big long function call to my code.
Comment #6
jose reyero commentedCleaning issue queue for old versions. If you want to get any support consider using the forum or updating to 6.x.
See #626858: Internationalization 5.x Maintenance Policy. Approaching end of support.
Comment #7
nancydruOkay, we still need this for 6.x and 7.x.
Comment #8
jose reyero commentedOK, I was just closing all 5.x issues...
About this, there's an API function to disable/change query rewriting. See i18n_selection_mode()
@NancyDru,
Yes, i18ntaxonomy uses db_rewrite_sql() to add language conditions to queries. The problem with this hook is we need some heuristics here for identifying the queries, and we try to use as far as possible Drupal core (unofficial) standards for table names and fields. For taxonomy these are 't', 'tid', 'vid'....
So please let me know what we would need to support any other module, but we cannot just add any table alias because that may clash with other different contrib modules too..
Comment #9
nancydruThe biggest issue I have is that it is not documented for developers. I can barely speak English, so I don't use i18n, but I do try to support its use.
Comment #10
fereira commentedI haven't really worked with the i18n module in the past but I am on a contract to work on a site for a major international organization that has a site which is available in five languages. The site also is also using several contributed modules to provide content as rdf (rdfcck, evoc, sparql). The way I am reading the db_rewrite_sql implementation in the i18n module is that it's going to add the (WHERE n.language="en"...) clause to any query which uses db_rewrite_sql, even if the query is accessing a table which does not have a language column. Since the rdfcck and evoc modules use db_rewrite_sql in several of it's queries, but the tables the modules use do not have a language column those queries fail. Since these are contributed modules, that haven't been updated in awhile I'm not sure I can expect that they'll be changed anytime soon, so if I'm going to continue to use the i18n module do I have to patch any contributed module which uses db_rewrite_sql if the i18n module is enabled?
Is this a bug in the modules which use db_rewrite_sql for not taking into account what any other enable modules which implements the db_rewrite_sql hook might do, or a but in the i18n module for making the assumption that any module which uses db_rewrite_sql code is going to provide a language column in any table it access and write the SQL such that the i18n_db_rewrite_sql function will rewrite it correctly?
Comment #11
nancydru"n.language" refers specifically to the node table, which does have a language column. Furthermore, it shouldn't touch a query that does not reference the node table.
Comment #12
fereira commentedI haven't looked at the code in detail but I just brought up a clean drupal instance, enabled the content translation and locale modules and the latest 6.x version of the i18n module. I installed/enabled the devel module so that I could execute some PHP code and executed the following:
print db_rewrite_sql('select * from {files}');
and it produced the following result:
select * from {files} WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL)
It looks to me like it *is* touching queries which are accessing tables other than the node table.
Comment #13
jose reyero commentedCleaning old issues (> 1 year without follow up)
Comment #14
nancydruThe follow up for documentation would be yours, not ours.
Comment #15
jose reyero commented@NancyDru,
Yes, but I mean I am not following up on these old 6.x issues. And if no one else is we better close this one...
Also, I don't see specific questions here, we are not producing any handbook page, etc...
So if you have specific questions about i18n API, need a better documentation for a function, etc, I'll try to fix / replay to that ones. That's why we have a 'Documentation' category for issues. But I think it will work better one question at a time.
But if not, really, having more issues open is the better way to make this issue tracker useless.
Comment #16
nancydru