I've got a site to build that will have both English and French content. I'm wondering how other people have dealt with the problem of having content in two languages.

I've thought of setting up two different hosts
english.hostname.ca
francais.hostname.ca
and just having two sites with similar themes, but no real connection at a database level.

I've also considered making a new livre_module that I could put my french content in and having clever block showing/hiding so different users would only see the appropriate navigation.

I've considered just having different books to organize the french and english content without making a new module and similar clever block showing/hiding.

I looked through the drupal sites list, and I saw lots of sites that were non-english, but none of them jumped out at me as bilingual. I'd love to hear a story like "Well, I tried it this way, and it is great." or "I tried it this way and now I'm stuck with it, but I should have done it that way....:"

Comments

e-1’s picture

http://cvs.drupal.org/viewcvs/contributions/sandbox/walkah/translate_node/

walkah (or anyone knowledgable about drupal): walkah's solution means duplicating every table. What do you think about the following approach:

  • An "alternate_language" module would create a table that contains the following fields: (node_id, node_type, field, language, value). The module would catch passing node requests with _nodeapi(), guess the current language, and replace all of the translated fields with those found in its table.
  • Depending on user settings, the module would either present the user with text boxes for each language defined, or would just show the current language values.
  • The module would know which fields should be replaced via module configuration.

I'm not sure of the implications for searching.

killes@www.drop.org’s picture

Walkah's approach is very elegant, lean, and Drupalish (IMNSHO).

It just needs some polishing, ie track keeping:

- which was the original language.
- what translations are already done and to what degree
- ...

Bèr Kessels’s picture

e's description is the one I tried.

I must admit that I'm very impressed by walkah's approach too. The problem is, however, that not only the core node-data must be translated, but very often stuff like assigned taxonomy-terms, and additional fields (e.g. recipe). The approach by walkah will provide difficulties here. (at least that's what Murphy stated ;) ).
My approach will prove more complex, an thus less elegant. Actually the only pre of my approach is that no extra node tables are required. Only one table to 'bind' the nodes, by language.

The module (my approach) can be found in my sandbox.

It can be seen live @ http://www.bakkers.nl/node/view/126. Note the link at the bottom of the file.
Also note that the multilingual stuff on this site was not yet released. So only this node is translated.

Ber
Mediarevolution.org :: het platform voor online muziek

walkah’s picture

it really only means duplicating the node table (and potentially any node modules that have extra tables (e.g. event.module). the problem with your approach (afaict) is this business of "guessing" current language ... and i'm not sure what user settings your referring to.

while duplicating tables is a drag... it only has to be done on install, and it has some nice side effects: namely all translations carry the same nid, which makes things like taxonomy assignments, etc. just work. you also will always see your preferred language version.

as killes has pointed out this module isn't perfect (which is why it's in my sandbox still), but it does work... and i know i'm biased, but it's my favourite approach (so far).

--
James Walker :: http://walkah.net/

e-1’s picture

In that case, nevermind, I'll just use this implementation.

e

e-1’s picture

Now that I have more experience with this module, I have to say that it lacks at least one necessary feature. I'd like to be able to edit all languages from a single edit page (so that the translator doesn't have to switch languages, etc). Is there a way to easily do this?


e

killes@www.drop.org’s picture

Not yet, but I guess walkah would like to see such a contribution.

ChiWevDev’s picture

qgil’s picture

Can't answer your questions but maybe you will find useful some recent thoughts about multilingual sites and the Locale module here:

Reflect locale in URL?

Maybe I'm wrong because I've landed recently in the Drupal community but it seems that the multilingual issue is growing accordingly to the Drupal's popularity increase, lot of work has been done but it is somehow disgregated and not very accessible to new Drupal administrators.

Maybe we need a more coordinated effort? I'd be happy helping to achieve basic solutions for multilingual Drupal sites...

e-1’s picture

Maybe we need a more coordinated effort?

I couldn't agree more. I've seen a couple of attempts at making drupal multilingual, but no real concerted effor that presents a nice solution.

e

Gaco-1’s picture

I have this problem as well. But, since the user's can select their preference for the language they see, I'm not too corncerned about the navigation.
Where I find the problem is having multilingual content. My users read/write one language or the other, but most don't know both. So, Breaking the content into two, really creates two sites sharing a database.
The other option would be to translate the content, but as I said, must of my users don't know both languages, so, someone else would have to do that.
And I feel that a lot would be lost from translating comments. So, I've decided to create a website with a main language, and just have an area of the forums where people who speak the other language, can participate.