Posted by aufumy on September 28, 2009 at 6:40pm
| Project: | Automatic Nodetitles |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Add t() around the display of content type names.
| Attachment | Size |
|---|---|
| auto_nodetitle_translate.patch | 1.05 KB |
Comments
#1
I have tried this, but it does not work.
#2
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
Yes, I have locale and i18n enabled. I changed my auto_nodetitle.module by adding the two t() functions:
t($types[$node->type]->name)andt($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
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.
#5
using a wrapper for tt(), function auto_nodetitle_tt()
#6
Hi there,
I guess there might be a problem with aufumys patch by using the tt function this way.
According to [1] the internal translation name should contain a integer value at its 3rd place. If a string like the node type is provided it will be parsed to an integer which will result in '0'. So this might cause some conflicts if used with different content types.
I modified the patch to work with multiple types and also added a new setting to be able to translate the whole title pattern.
[1] http://drupalcontrib.org/api/function/i18nstrings_context/6
#7
Hi.
I installed patch in #6, but I can't get the [type-name] to be translated.
I used [type-name]: [author-name] and also tried just with [type-name]
I tryed with Language neutral, spanish, or english. I never get the node type translated.
What am I doing wrong?
Sincerely thanks.
#8
As far as I remember, token.module doesn't translate the tokens content.
#9
I just need a text to be translated. For example I need to use Donation for: [author-name], where "Donation for:" should be translated to "Donación para".
Any idea how can I do this?
#10
Any way you can recommend me to do this?