I can only create translations for the built-in content types 'page' and 'story', but not for custom content types.

To reproduce:
1. Create a new content type and set the 'Multilingual support' option to 'Enabled, with translation' (in the 'Workflow settings' fieldgroup)
2. Create a new node of your newly defined content type and set the language of the node to some specific language (e.g. German)
3. Visit/view your new node and click on 'Translate'
4. In my example it looks like this:
Language Title Status Operations
English n/a Not translated add translation
German (source) Kontakt Published edit
5. Click on 'add translation' in the row for a language there's no translation, yet.
6. Seems like you're back at the same page as '/node/add/' (although the URL in the browser is '.../node/add/fewo_page?translation=2&language=en'). It's not possible to add a translation for your node.
7. Do the same with the built-in content types 'page' and 'story', there it works.

Comments

keith.smith’s picture

StatusFileSize
new1.03 KB

As far as I can tell, this ONLY happens on content type names with underscores in them. I don't think that translation module is correctly replacing these underscores with hyphens when it constructs the url for the "add translation" link in the table.

In testing, the attached patch seems to fix it for me.

My standard disclaimer applies: be aware that I only have the slimmest clue about what I'm doing.

keith.smith’s picture

Status: Active » Needs review

(as evidenced by me forgetting to adjust the status)

pwolanin’s picture

The hyphen to underscore switching was the worst idea since I dunno what.... makes for fragile code.

gábor hojtsy’s picture

Title: Impossible to translate custom content types » Underscores are not converted to hyphens in some URLs
Priority: Critical » Normal
Status: Needs review » Fixed
StatusFileSize
new1.88 KB

Well, I see this is done to construct the node/add link, so well, we need to do the same in translation module. Agreed with pwolanin.

  foreach (node_get_types('types', NULL, TRUE) as $type) {                                             
    $type_url_str = str_replace('_', '-', $type->type);                                                
    $items['node/add/'. $type_url_str] = array(
...

I grep-ed the Drupal source for more such cases, and found one more in forum module, which I fixed as well. Committed the attached patch.

Note that I don't think this is any critical.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.