Comments

pasqualle’s picture

Category: feature » support

I 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..

pndur’s picture

Thanks for your response

pasqualle’s picture

the given theme function theme_quicktabs_tabs() has been changed in the last commit. if you use it in your theme, then please update.

pasqualle’s picture

Category: support » feature

The 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..

benklocek’s picture

Category: support » feature

Any 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.

sidal1’s picture

Hi,

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!

pasqualle’s picture

@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..

sidal1’s picture

I could translate them with Localization client module :) Thanks a lot!

jpbhat’s picture

Hi all how could i use Localization client module to transalte the title of quick tabs

thanks and regards
jp

jpbhat’s picture

Hi 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

Junro’s picture

subscribe :)

Tab titles are not translable :(

pasqualle’s picture

first step is described in comment #1
second step is the l10n_client module..

what is the question?

Junro’s picture

No 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.

pasqualle’s picture

dynamic 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..

Junro’s picture

Thanks 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.

rtackett’s picture

The 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:

function YOURTHEMENAME_quicktabs_tabs($quicktabs, $active_tab = 'none') {
  $output = '';
  $tabs_count = count($quicktabs['tabs']);
  if ($tabs_count <= 0) {
    return $output;
  }

  $index = 1;
  $output .= '<ul class="quicktabs_tabs quicktabs-style-'. drupal_strtolower($quicktabs['style']) .'">';
  foreach ($quicktabs['tabs'] as $i => $tab) {
    $class = 'qtab-'. $i;
    // Add first, last and active classes to the list of tabs to help out themers.
    $class .= ($i == $active_tab ? ' active' : '');
    $class .= ($index == 1 ? ' first' : '');
    $class .= ($index == $tabs_count ? ' last': '');
    $attributes_li = drupal_attributes(array('class' => $class));
    $options = _quicktabs_construct_link_options($quicktabs, $i);
    $output .= '<li'. $attributes_li .'>'. l(t($tab['title']), $_GET['q'], $options) .'</li>';
    $index++;
  }
  $output .= '</ul>';
  return $output;
}

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().

blackdog’s picture

Component: Miscellaneous » User interface
Status: Active » Needs review
StatusFileSize
new1.9 KB

I'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.

pasqualle’s picture

@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

'quicktabs:tab:'.$quicktabs['qtid'].'-'.$i.':title'

with

"quicktabs:tab:{$quicktabs['qtid']}-$tabkey:title"

I think it is more readable..

blackdog’s picture

StatusFileSize
new1.9 KB

Thanks 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.

blackdog’s picture

StatusFileSize
new1.91 KB

Removed unnecessary $i++.

pasqualle’s picture

Status: Needs review » Fixed

thanks, 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

blackdog’s picture

Great stuff Pasqualle!

Status: Fixed » Closed (fixed)

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

katbailey’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Closed (fixed) » Patch (to be ported)
Stan.Ezersky’s picture

#16 works for Drupal 6.xx
Thanks

cpotter’s picture

+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

doublejosh’s picture

I 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.

doublejosh’s picture

QuickTabs version 6.x-3.0-beta2 still provides no titles in the translation table. Just an empty list.
Bummer :(

doublejosh’s picture

@katbailey, or anyone here really... interested in a bounty on this bug? (as in getting paid to fix it.)

katbailey’s picture

Sorry @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.

doublejosh’s picture

Sure. 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!

katbailey’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Patch (to be ported) » Needs review
StatusFileSize
new6.87 KB

Here'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.

doublejosh’s picture

Yeah, this stuff is out of my knowledge range.

Any specifics about what I'd need to change to get this into D6?

katbailey’s picture

@doublejosh, can you try re-saving one of your Quicktabs instances and seeing if that makes anything show up in the translation table?

doublejosh’s picture

Re-saving after what? Happy to help!

katbailey’s picture

I 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.

doublejosh’s picture

Gotcha. 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.

katbailey’s picture

OK 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

doublejosh’s picture

Yeah, 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.

tnightingale’s picture

Here is #32 rerolled for drush make (finally getting around to testing Kat :-P).
Thanks.

doublejosh’s picture

OMG, 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"

hugovzky’s picture

StatusFileSize
new25.46 KB
new32.22 KB

Hi,
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?

tnightingale’s picture

The 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.

katbailey’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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