Closed (fixed)
Project:
Quick Tabs
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2008 at 16:28 UTC
Updated:
28 Sep 2011 at 04:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
pasqualleI am not supporting the translation of dynamic texts with the t() function call. But you can do it if you override the theme_quicktabs_tabs() function in your theme's template.php file like yourthemename_quicktabs_tabs().
you will have to copy all the parameters and the full content of this function. and you can apply t() function on $tab['title'] in this function, it is inside the
<a>tag.I will try to make the theme functions easier (maybe create theme templates). There is too many code inside these functions. Please keep in mind that you will have to make the changes in your theme file, when the original function is changed in the module..
Comment #2
pndur commentedThanks for your response
Comment #3
pasquallethe given theme function theme_quicktabs_tabs() has been changed in the last commit. if you use it in your theme, then please update.
Comment #4
pasqualleThe translation of dynamic texts should be done with the i18n_strings module, but it needs additional development. I'll check how can I support the translation of tab titles..
Comment #5
benklocek commentedAny status on the translation of tab text? In another thread/issue (http://drupal.org/node/303453) a possible solution is to allow the tabs to use the title of the content. This would then be the translated text, and allow for normal translation to occur, rather than in a theme, or other place.
Comment #6
sidal1 commentedHi,
I am trying to translate the tab texts too. I copied the theme_quicktabs_tabs() into my template.php and made the required changes, but Translate Interface cannot find the tab text I want to translate. I know the new function I copied is being used because I appended some random text to tab names and I was able to see them appearing on the tabs. I have a multisite setup with separate databases and my quicktabs module is under sites/all/modules. Can this be the reason? Am i missing anything for this to work?
Thanks a lot!
Comment #7
pasqualle@sidal1: did you tried it with the Localization client module. That should pick up every string on your screen which is translatable.
The Drupal's built in interface does not find the strings which are not in the database..
Comment #8
sidal1 commentedI could translate them with Localization client module :) Thanks a lot!
Comment #9
jpbhat commentedHi all how could i use Localization client module to transalte the title of quick tabs
thanks and regards
jp
Comment #10
jpbhat commentedHi all
I am facing the transaltion in quick tab s title
when i click english language its getting transalted
but when i click different language its not getting translated
i have put my quick tab in panel page
what is the problem weather i am doing right or wrong
pls help out
thanks and regrads
jp
Comment #11
Junro commentedsubscribe :)
Tab titles are not translable :(
Comment #12
pasquallefirst step is described in comment #1
second step is the l10n_client module..
what is the question?
Comment #13
Junro commentedNo question just subscribing :)
Oh ok sorry,
Just understand we couldn't implant the t() function with dynamic texts in order to make tab titles translation work.
Comment #14
pasqualledynamic texts should not be translated with the t() function, but many modules do that. Even I sometimes translate dynamic texts with t(), like using t() on views exposed filters, because it is easy.
The first problem is that the source string won't be automatically registered, so you need to use a tool like l10n_client which can find all translatable strings on the page. The second problem is when you change the source string the translations will be orphaned, and it is quite common to change a dynamic string..
The general solution would be to use the i18nstrings module which is created for dynamic text translation, but that would require additional dependency, and I guess most of the Quick Tabs users do not use the i18n module.
you can read additional info about this problem here: http://groups.drupal.org/node/15177
Please help to push some kind of solution into Drupal 7, and we could have a general solution for D6.. So QT may support translatable tab titles by default..
Comment #15
Junro commentedThanks a lot for theses explanations.... I understand very well now :)
I will test the solutions you're talked about and report if I find another solutions.
Comment #16
rtackett commentedThe function override worked for me.
Here is the actual code (replace your theme name) if anyone is interested or doesn't want to dig through the module's code:
It would be nice to have this integrated within the module as an available option so the template code does not have to change after each upgrade. Maybe in an "Advanced" menu at the bottom of the quicktab parameters or do a check to see if the i18n module is activated, if so, add the t().
Comment #17
blackdog commentedI've taken a stab at this since I need it right now. This patch does not add any dependencies, it checks if function tt (from i18nstrings.module) exists and uses it.
Comment #18
pasqualle@blackdog: this patch looks great. Many thanks for jumping on this issue.
small things:
can you replace $i with $tabkey ($i mostly references to integer, but keys used in $quicktabs['tabs'] array could be strings also #332895: render quicktab programatically)
an I would replace
with
I think it is more readable..
Comment #19
blackdog commentedThanks Pasqualle, I've updated patch with your comments.
I'm not sure of you want to change the $i to $tabkey on the whole theme function? I've changed it in the refresh function in this patch.
Comment #20
blackdog commentedRemoved unnecessary $i++.
Comment #21
pasquallethanks, committed a slightly modified version (used double dashes between $qtid--$tabkey)
http://drupal.org/cvs?commit=268838
the quicktab translation support added to the translation_table module also: http://drupal.org/cvs?commit=268836
Comment #22
blackdog commentedGreat stuff Pasqualle!
Comment #24
katbailey commentedComment #25
Stan.Ezersky commented#16 works for Drupal 6.xx
Thanks
Comment #26
cpotter commented+1 subscribe.
Does not work in rc5 with
- Drupal 6.17+
- Internationalization 6.x-1.9 and
- String translation 6.x-1.9
A real shame for such a nice module
Comment #27
doublejosh commentedI get the interface for string translation of quicktabs, however none of the string listings show up (admin/build/translate/table/quicktabs)
I've run a refresh for Quicktabs, but no dice. (Quick Tabs 6.x-2.0-rc5)
Testing 3.0 now.
Comment #28
doublejosh commentedQuickTabs version 6.x-3.0-beta2 still provides no titles in the translation table. Just an empty list.
Bummer :(
Comment #29
doublejosh commented@katbailey, or anyone here really... interested in a bounty on this bug? (as in getting paid to fix it.)
Comment #30
katbailey commentedSorry @doublejosh... I don't even really understand what the problem is. Can you give steps to reproduce? I've just tested translating titles in 3.x and it seems to work fine but I don't even use this feature as I'm not doing anything multilingual these days. I'd need someone who's more familiar with multilingual stuff to help with this.
Comment #31
doublejosh commentedSure. When I visit the translation table page for QuickTabs it shows no entries though I have around 5 QuickTabs with 4-ish tabs each.
I've hit refresh strings, which was necessary for tags, but still nothing shows up in the list.
I'm a bit lost on how those entries are established myself. Thanks!
Comment #32
katbailey commentedHere's an initial patch to get QT title and tab titles as translatable strings in D7, using the i18n API, a combined effort between myself, robin.puga and thegreat. I'd like to get people testing it to make sure it works as expected as I've only done minimal testing myself and don't generally do much i18n stuff so could well be missing something.
Comment #33
doublejosh commentedYeah, this stuff is out of my knowledge range.
Any specifics about what I'd need to change to get this into D6?
Comment #34
katbailey commented@doublejosh, can you try re-saving one of your Quicktabs instances and seeing if that makes anything show up in the translation table?
Comment #35
doublejosh commentedRe-saving after what? Happy to help!
Comment #36
katbailey commentedI just mean, go to the admin UI for quicktabs, click the edit button for one of your Quicktabs instances, no need to make any changes, just submit the form.
Comment #37
doublejosh commentedGotcha. Did a save and no table entries. Refreshed the QuickTabs text group, no new entries.
Here are some screenshot of what I'm looking at.
Thanks for your help.
Comment #38
katbailey commentedOK that first screenshot is totally unfamiliar to me - what page is that on? Can you go to admin/build/translate/search and refine it by quicktabs - you should then see something like this:
https://skitch.com/katbailey/fq5ax/translate-interface-quicktabs-6.x-3.x
Comment #39
doublejosh commentedYeah, same stuff. There is a subtab for QuickTabs in addition to the wholesale search.
Mine just doesn't have any entries whether searching or otherwise.
Like the titles aren't being registered/indexed, etc.
Comment #40
tnightingale commentedHere is #32 rerolled for drush make (finally getting around to testing Kat :-P).
Thanks.
Comment #41
doublejosh commentedOMG, this might be completely my fault because of a theme override function for the title output...
http://drupal.org/node/625972#comment-4863710
I'm not passing my titles through "i18nstrings"
Comment #42
hugovzky commentedHi,
I have applied the patch at #40, but I still can't translate any quicktabs string...
After applied this patch i have got the group Quicktabs in the translation interface, but when i make a string refresh is shown a "Cannot refresh strings for Quicktabs" warning and remains with no quicktabs strings available.
Could anyone help me?
Comment #43
tnightingale commentedThe patch at #40 is missing the string refresh step.
Here is a patch that fixes the "Cannot refresh strings for Quicktabs" message and allows i18n_string to register the strings and corresponding translations upon refresh.
Patch is against quicktabs-7.x-3.x.
Comment #44
katbailey commentedCommitted http://drupalcode.org/project/quicktabs.git/commit/1060908