Translate content type names displayed

aufumy - September 28, 2009 - 18:40
Project:Automatic Nodetitles
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Add t() around the display of content type names.

AttachmentSize
auto_nodetitle_translate.patch1.05 KB

#1

tomsm - September 29, 2009 - 09:40

I have tried this, but it does not work.

#2

aufumy - September 29, 2009 - 13:57

tomsm, could you please be more specific?

What was the specific issue, did the patch not apply, or?

If the patch applied, then do you have locale module enabled, and did you supply a translated version of the content type name?

#3

tomsm - September 29, 2009 - 14:19

Yes, I have locale and i18n enabled. I changed my auto_nodetitle.module by adding the two t() functions:
t($types[$node->type]->name) and t($types[$node->type]->name)))

I did not apply the patch, I just modified the module file. Is this ok?

I have set my auto node title pattern to: [type-name] [author-name] [dd]/[mm]/[yyyy]

With translation table I added a French and Dutch translation for my content type "Order". Normally [type-name] should be translated, right?

I also set the pattern to: Order [author-name] [dd]/[mm]/[yyyy]
I searched for all Order strings but did not find this pattern.

I also cleared the cache.

#4

aufumy - October 12, 2009 - 19:35

I should not have used t() for translating variables. Instead this patch uses tt().

Also some commenting fixes.

What this fix does is, when you are creating a node in French, and you save the node without any title, it will use the node type name in French as the title.

AttachmentSize
590364.patch 2.67 KB

#5

aufumy - October 13, 2009 - 21:47

using a wrapper for tt(), function auto_nodetitle_tt()

AttachmentSize
590364.patch 2.69 KB
 
 

Drupal is a registered trademark of Dries Buytaert.