I found that the tab titles are not run through t() and therefore can't be translated. I'm attaching a patch that fixes this.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | translate-display-title.patch | 566 bytes | dawehner |
| #1 | panels_tabs_i18n.patch | 471 bytes | samlerner |
I found that the tab titles are not run through t() and therefore can't be translated. I'm attaching a patch that fixes this.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | translate-display-title.patch | 566 bytes | dawehner |
| #1 | panels_tabs_i18n.patch | 471 bytes | samlerner |
Comments
Comment #1
samlerner commentedAttaching patch for D5.
Comment #2
wim leersThanks! Committed to D5 and D6:
http://drupal.org/cvs?commit=219944
http://drupal.org/cvs?commit=219946
Comment #3
dawehnerwhat happens if the title of the content is dynamic? for example if a pane title is a node title
Comment #4
wim leersThen no translation will be found and all will be fine.
And yes, this is somewhat tricky, but Drupal's language/translation system doesn't properly support dynamic strings. Or at least it doesn't distinguish very clearly between them.
Or am I missing something? That's very well possible, I no experience with multilingual Drupal.
Comment #5
dawehneri know a site where some developers runned everything througth t() and this broke the site full, because the locale cache kills the performance.
and here is the code in the locale function:
So if not translation can be found, its insert into the locales_target Database, and this is horrible :(
I set it to code needs work
Comment #6
dawehneradditional, i don't understand why this should be done by tabs panel style, this could be also done by panels
Comment #7
wim leers(I had typed this message and then closed the browser window. Stupid. That's what you get for working this late.)
#5: I had no idea it worked that way. It looks … weird to me that it works that way (that's a euphemism for "plain stupid" by the way). I'm pretty sure that I've done this incorrectly in just about every module of mine then.
But … how else can you do dynamic string translation in Drupal?
#6: Agreed. Patch reverted: http://drupal.org/cvs?commit=220972, http://drupal.org/cvs?commit=220974.
Comment #8
dawehnerthats what i18n does
there is a function tt() which works like t() but it uses a identifier like taxonomy:term:$tid
Comment #9
wim leersBut the tt() function isn't in core. So … that'd be ugly. Are there clear docs on this anywhere?
Comment #10
wim leersComment #11
nedjoSee http://drupal.org/node/304002 for some documentation.
Comment #12
smoothify commentedThis should be done through panels rather than panels_tabs.
There is an issue on this subject here:
#568740: Translating Pane Titles
Comment #13
juanjo_vlc commented#12 I disagree, because at this moment the "workaround" for panes is done just before rendering the pane, so the title is loaded with original title, and not the translated one.
The patch propossed on #1 should do the job, but it needs a notice 'use with care' or 'use at your own risk' because t() adds entries to the locales_source table and caches the results. This patch is good if you use some tabbed panes with user assigned titles.
Comment #14
dawehnerAre we really sure that translating pane titles and panel_tabs-titles are the same?
From my perspective it's not. Here is a patch to translate panels_tabs titles.
Comment #15
paul555 commentedFor me the first patch was a good workaround as i only use static strings as tabs titles.
Comment #16
broncomania commentedSubscribe 15 works perfect.