The module is not up to date with current HEAD, and I guess it wont work at all if you try. So some work needs to be done to update it.

However, in order to save some time and be able to work with some stable code, I will be waiting for the first Drupal 4.7 RC at least.

If you are in a hurry and cannot wait, feel free to post your patches to this thread and I'll do my best applying them. But please, no workarounds nor hacks, only full patches. I.e. "Update the whole module to Forms API".

Comments

Wesley Tanaka’s picture

It's actually working great for me on a live site once I applied this patch http://drupal.org/files/issues/backward.patch, which I submitted as a issue report on this here page:
http://drupal.org/node/38769

I should clarify that the only part of the module that I'm really using is the URL rewriting portion (the one that prepends /en/ or /de/ or /fr/ to URLs).

kiev1.org’s picture

i18n not work
On all references I see

====
Primary links
2
====

And it is more than anything

janekb’s picture

K1ev - quick patch for your problem:

Index: i18n.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/i18n/i18n.module,v
retrieving revision 1.21
diff -u -r1.21 i18n.module
--- i18n.module	3 Dec 2005 14:31:30 -0000	1.21
+++ i18n.module	27 Dec 2005 20:09:26 -0000
@@ -231,7 +231,7 @@
  */
 function i18n_get_normal_path($path) {
   // First, check alias with lang, then without
-  if ($path != ($alias = drupal_lookup_path('alias', $path))) {
+  if ($path != ($alias = drupal_lookup_path('alias', $path))&& $alias) {
     return $alias;
   } elseif(i18n_get_lang_prefix($path, TRUE)){
     $alias = drupal_lookup_path('alias', $path);

Jose,
I'm not shure if my solution is ok, but drupal_lookup_path returns FALSE when there is no 'alias' for $path. So without this patch 'FALSE' was returned from this function.

kiev1.org’s picture

Thank, thank you very much for help me !!!
All works!
It is necessary-whether apply old patch bootstrap.inc and common.inc? I did it manually for 4.7 on similarity 4.6 but I do not know it is necessary or not?

kiev1.org’s picture

And that the green line means everywhere in section admin above
i18n_form_alter id = story_node_form (on add story)

janekb’s picture

1. It looks that this update it's not a simple task (for example you are not able to choose language when editing node). So new patches will be need for this module in order to make it work.
2. Answering your question about patches do 'core', you don't need it anymore. Those patches are already in core.

kiev1.org’s picture

Thanks! I have thought up - I shall add a choice of language in a text field of module Flexinode and I shall have an opportunity to create page for two languages at once, and images in clause will be identical.

Wesley Tanaka’s picture

Another issue I'm having is that when I edit a node, it's "url alias" on the node edit form screen has the language prepended. So if the node was previously aliased as "some/alias", the url alias field in the form is filled out as "en/some/alias" for example.

kiev1.org’s picture

At addition node - all is good but after editing again
====
Primary links
2
====

kiev1.org’s picture

yes!

- if ($path != ($alias = drupal_lookup_path('alias', $path))) {
+ if ($path != ($alias = drupal_lookup_path('alias', $path))&& $alias) {
return $alias;
} elseif(i18n_get_lang_prefix($path, TRUE)){
- $alias = drupal_lookup_path('alias', $path);
+ $alias = drupal_lookup_path('source', $path); // (!)(!)(!)

kiev1.org’s picture

Tell - and how it is correct? So
if ($path != ($alias = drupal_lookup_path('alias', $path))&& $alias) {
or so:
if ($path != ($alias = drupal_lookup_path('source', $path))&& $alias) {
?

Please it is commit in cvs
inserted because the module patch does not work

kiev1.org’s picture

Today i18n for Drupal-4.7 knows how only to show or not to show different taxonomy in the different languages. How I can with survey node it will be switched to another language remaining on that -same node, also, in that -same taxonomy and vocabulary but by that translated into another language? in the current cvs module i18n this is not possible.

Has looked very old versions i18n and has understood that there there was something similar on "create translition" - but now it in 4.7 Drupal is absent completely.

the second: I want with addition of one and that -node to see the immediately different fields (theme teaser body and etc) for the different languages

and also to fasten node only to one taxonomy but which has different names in the different languages

kiev1.org’s picture

Category: task » bug
Priority: Normal » Critical

At the included module i18n at addition of the reference to items of administration - they are made multiple copies in a geometrical progression - at me was in the table menu more than 4800 records with identical title and a miscellaneous mid
And I can not find in it the button "create translation"
heeelp

Wesley Tanaka’s picture

the issue you mentioned most recently sounds like http://drupal.org/node/40879

Wesley Tanaka’s picture

I needed this patch:

http://drupal.org/node/41125

(been marked won't fix) to get 403 pages to show up properly.

Marc Bijl’s picture

Just a question regarding i18n for Drupal 4.7 (therefore decided to post it here):

Can anyone tell how stable / relyable i18n for Drupal 4.7 (HEAD / CVS) is? I like to start a brand new site, with hopefully a lot of visitors, and it will be in dutch as well as english. The site won't be complex, just some static pages and a simple blog. I do not expect menus except the primary links, and as far as I can tell, there won't be taxonomy terms either. In Drupal 4.6 I've done quite a lot with i18n.module as well as i18n_menu.module, and got a complete site working in two languages - so got some experience :)

Hope you guys can give me a good advice: what should I do, use 4.6 and trust on the things I already know, or just give 4.7 a try, as it might be stable enough?

Cheers!
Marc

kiev1.org’s picture

good afternoon!
with drupal-cvs works steadily, only I not find button/link/etc "To translate node/term/taxonomy/menu nowhere"
and I can not see as it all was in drupal 4.6
heelp

Marc Bijl’s picture

Hi!

In 4.6 I mostly use the translation tabs to create and/or edit translations. As you don't see buttons or whatsoever, I looked at the links - so you hopefully can get to them directly:

*** Node translation
Go to the node you want to translate. If you're using clean URL's, find out what nodenumber it has. Type this in your address bar (e.g. www.yoursite.com/languageprefix/node/nodenumber). Add "/translation" and hit enter (e.g. for my site it works with: www.newoceans.nl/nl/node/38/translation). You should see the translation page now.

*** Taxonomy translation
Go to www.yoursite.com/languageprefix/admin/taxonomy/i18n. You should see the translation page now for terms that are already translated.

*** Menu translation
This is done by localization, once you have installed the menu translation module. Find some information about the i18n_menu.module I use in 4.6 here: http://drupal.org/node/42235#comment-78158

Hope this can help.

To get back to my question: what do you think, does i18n for 4.7 (HEAD/CVS) work good enough, or is it a good advice to wait for the official release?

kiev1.org’s picture

Thank you!
Now clearly, but in my 4.7 it does not work because I not find i18n_menu.module nowhere (

I only use from it languageprefix, and did the system of translations other (at the input of one article an editor is in a position to add content at once for 2th languages on one page)

it is certainly desirable rather what i18n would earn in 4.7 similarly as well as in 4.6...

kiev1.org’s picture

> To get back to my question: what do you think, does i18n for 4.7 (HEAD/CVS) work good enough,
> or is it a good advice to wait for the official release?

No, i18n because you described in 4.7 does not work, it only commutes languages, but creating translations - not succeed. :(

Wesley Tanaka’s picture

My experience is similar -- I'm only using it for the url-language-prefix functionality, not for any of the "filter this list by language" functionality. The former works with a few patches. The latter I haven't tested one way or the other.

Marc Bijl’s picture

Thanks for the info, you both! Sorry for the sidetrack :\

Wesley Tanaka’s picture

mgifford’s picture

i18n broke the menu expansion in 4.7..

mgifford’s picture

tinyMCE skipped when loading i18n.

In two identical installs, one shows the enable rich-text and the other doesn't, depending on whether or not i18n is enabled.

Not showing up in the source code either.

kiev1.org’s picture

however
http://localhost/ru/translation/node/291/uk
Fatal error: Call to undefined function: form_hidden() in /var/www/localhost/htdocs/modules/i18n/translation.module on line 136

I can not understand principle of creation of node and node translation

Continental’s picture

I have the same...
Fatal error: Call to undefined function: form_hidden() in /modules/i18n/translation.module on line 136
And I can't create both language content using the language selectror when editing multilang node.

kiev1.org’s picture

jose reyero’s picture

There are some pending issues with Drupal core and some patches I still dont know whether they'll finally get in or not.

Whatever, I cannot produce a i18n 4.7 before Drupal 4.7 is out -or at least an RC.

I can tell you that the module in the link above wont work either because of issues like this one: http://drupal.org/node/34132

For now, I think we better invest our time in fixing Drupal bugs :-/.

profix898’s picture

Any progress on i18n for Drupal 4.7! The first Release Candidate is out now and I hope to have a site with i18n and 4.7 soon.

fleed’s picture

Same here, hoping for a working i18n install on 4.7 RC1 for a brand new site. I'll try the 4.6.0 version but I'm not too hopeful.

wonderland’s picture

Hi,

any news on this? Any 'RC' for this module? Any way we can help?

..- Wonderland

sar’s picture

Hi Jose

Do you think it's possible to publish a list of missing bits and peaces to get the module working with 4.7?

I've looked at the current CVS HEAD version and it seems that aside from migrating to 4.7 you're in the middle of refactoring.

If you could write a todo list that would show us where you're heading we could help you make it happen.

cheers
Steven

profix898’s picture

Great to see progress on i18n 4.7! :) But latest cvs code still needs work. It contains various bugs (error messages) and doesnt work as expected.

belio’s picture

Now 4.7 was released, it's a (the) key-module that is still missing for a few sites I'd like to build/upgrade.

Hope to get some good news soon ;-)

Thanks

Marc Bijl’s picture

Hmm. CVS version is intended to work with Drupal 4.7:
- http://drupal.org/node/60857#comment-93760

May be just give it a try?

belio’s picture

I tried, but didn't get far...

Just activating the i18n module gives me:

user warning: Unknown column 'v.language' in 'where clause' query: SELECT v.*, n.type FROM vocabulary v LEFT JOIN vocabulary_node_types n ON v.vid = n.vid WHERE (v.language ='en' OR v.language = '') ORDER BY v.weight, v.name in /var/drupal/includes/database.mysql.inc on line 120.

Then when first applying i18n.mysql to the database (normaly not needed on 4.7) I get a bit further, and can activate 'translation' too. But then when editing a page-node I get:

user warning: Unknown column 'language' in 'field list' query: SELECT language FROM node WHERE nid=1 in /var/drupal/includes/database.mysql.inc on line 120.

and nothing really works ;-(

jose reyero’s picture

Category: bug » task

Drupal's update.php script should take care of database updates.

That's the standard module update procedure now, in Drupal 4.7

klance’s picture

Category: task » bug

Instead of crapping on this, let's be positive about the fact that there's been recent progress. Jose said that he was going to wait until at least a 4.7 release candidate came out, and yes I know there are other modules that were ready before RC1, but this one is more tightly interwoven with the core than a lot of other modules, so it pretty much had to wait until 4.7 was finalized.

That said, I've tried the latest CVS, and it is greatly improved over the last one I tried. Sure, there are bugs, but instead of whining about how your site upgrades are being held up by the i18n module (keep in mind, Drupal 4.7 has been out for ONE WEEK), do something constructive and report any bugs you find while evaluating the latest CVS. If that doesn't work for you, ask for your money back. ;-)

belio’s picture

Hi, I had done the update.php even though I thought this was not necessary as it’s a new install of 4.7.0

I'm sorry if by politely (I thought) inquiring about the progress, and reporting the error I get, is taken as 'crapping'

Anyway, I found the error came from i18n.inc at

function i18n_node_get_lang($nid, $default = '') {
  $lang = db_result(db_query('SELECT language FROM {node} WHERE nid=%d',$nid));
  return $lang ? $lang : $default ;
}

Since I don't have a language field in the node table (it doesn't get created by the i18n.mysql or anything in i18n.install) I've added that manually.

Now I don't get an error, but changing a page's language isn't stored, neither do the links in the translations tab.

I hope this is of any help.

klance’s picture

Sorry for any misunderstanding. The topic http://drupal.org/node/61913 appears to be related to this issue. When I installed i18n on a fresh copy of Drupal 4.7 I got the same result. It seemed that the install script wasn't modifying the table schema for node, vocabulary, term_data, etc. as indicated in the i18n.install script. When I made the changes manually as per the install script, the module seemed to be working very well when logged in.

Note: I had a look at the i18n.pgsql that's still bundled with the current CVS, and it looks like a leftover from the 4.6.x version. I was thinking that it was a manual alternative to the install script, but it's not, and it will make a bunch of schema changes that are no longer needed with the current version, so I don't recommend running it.

After updating the database manually, I was, however, able to create and translate vocabularies, nodes, terms and even webforms. This was a good test because it showed that i18n works with non-core node types as well as it does with core ones.

klance’s picture

My mistake; I did another update and it looks like the taxonomy tables have been removed from i18n.pgsql, so it's up-to-date with the current cvs.

jose reyero’s picture

Category: bug » task

Hi,

FYI, I keep working on the module, which can be considered in alfa stage. Some updates will be committed in the next days.

I will be using this thread to post updates about the status of the module, but I think we better use specific bug reports for the problems that you experience from now on.

Cheers!

jose reyero’s picture

Update:

The module already works with Drupal 4.7 and all the known critical bugs have been fixed.

Testers, comments, bug reports, feedback are welcomed.

Notes:
- no core patches needed anymore
- the install script of the module will take care of the updates or the installation
(run Drupal's update.php when upgrading)
- the update scripts for pgsql have not been fully tested yet -some please let me know whether they work.

Marc Bijl’s picture

THANKS FOR ALL THE HARD WORK, JOSE!

Hopefully this week I can find some time to upgrade my website from Drupal 4.6.6 to 4.7. If there are any bumps on my road, I'll let you know ;)

Many thanks for all your efforts and keep up the good work!

pertuz’s picture

I have the module running nicely, but I'm having trouble getting the interface (mainly my owwn created menus) to switch languages.

Any pointers?

Marc Bijl’s picture

Hmm. Pointers to related issues here:

- http://drupal.org/node/62822
- http://drupal.org/node/62799

adixon’s picture

i18n won't normally translate menu blocks generated from manually added menus - normally, the translations take place in the menus when they're generated by the modules, and so the module takes care of that with it's t() wrapper.

But i had the same problem, so i added the following code to my template.php in my theme (using phptemplates of course..). What it does is check if the page is in the non-default language, and if it is it, then it translates all the labels, and also the links of any node items. Since it gets called a bunch of times for each page, i set up a separate function to cache the translation language into a static var.

function _get_translation() {
  static $translate;

  if (!$translate)  { /* set up initial state  */
    $translate = 'en'; /* placeholder for "don't translate" */
    /* only try translation if i'm in a non-default language */
    if (function_exists('translation_node_url'))  {
      $lang = _i18n_get_lang();
      if ($lang != i18n_default_language()) {
        $translate = $lang;
      }
    }
  }
  return $translate;
}


/* automate translations of menu items that are nodes */

function phptemplate_menu_item_link($item, $link_item) {
  $title = $item['title'];
  $path = $link_item['path'];
  $description =  $item['description'];
  $translate = _get_translation();
  if ('en' != $translate) {
    $title = t($title); // always try to translate the title
    $args = explode('/',$path);
    if (('node' == $args[0]) && is_numeric($args[1]) && empty($args[2])) {
      if ($nid = translation_node_url($args[1],$translate)) {
        $path = 'node/'.$nid;
      }
    }
    /* put other types of links to translate here .. */
  }
  return l($title, $path, $description ? array('title' => $description) : array());
}
Marc Bijl’s picture

Well, in 4.6 version of i18n module there used to be an additional i18n_menu.module. So, it used to be possible to translate menu blocks - without coding.

Therefore, I think it is justified to wonder if such functionality will be part of 4.7 version of i18n module.

However, that's going to be of topic:

Update i18n module for Drupal HEAD (4.7)

Even more because Jose wrote:

I will be using this thread to post updates about the status of the module

A topic about translating menu items has been started here:
- http://drupal.org/node/62822

I suggest to continue this conversation in that topic (or otherwise start a new one), so that we can focus this one on the status of i18n module in relation with Drupal 4.7

jose reyero’s picture

Just committed new i18nblocks.module -now in the 'contrib' sub-folder of the module

Hope you like it :-)

Marc Bijl’s picture

Thanks! Don't need right now, but will test and report as soon as this becomes the case.

oelewapperke’s picture

Any updates ? I'm going to try the CVS, but I'd love to use a release version.

jose reyero’s picture

Status: Active » Fixed

I've just tagged the module for 4.7 so in a few hours there will be a downloadable package for '4.7'. In the meanwhile, you can download the cvs version which is just the same for now.

Anonymous’s picture

Status: Fixed » Closed (fixed)