Download & Extend

Translation of block's titles

Project:Tabbed Block
Version:6.x-1.0
Component:User interface
Category:task
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi! thank You for Your module :)

Everything works fine but multilanguage.
I have an issue with translation (or please correct me - maybe I'm doing something wrong).

I want to translate my block titles via "interface translation", but it doesn't work when it is put to tabbed_block. Every other blocks are translated correctly.

Do You know something about this issue?

Greetings.

Comments

#1

Sorry for late reply, did you try dev version?

#2

Thanks for the reply.

Yes, in fact i think that there is no difference in code beetwen stable and developer version (but info and install file).

On my local version I deleted "&" from arguments in hook_form_alter due to common warning:
warning: Parameter 2 expected to be a reference, value given
but still nothing.

EDIT:
also i think that problem is in this line:

<?php
$tab_subject
.= "<li><a href='#' id='fragment". $module_delta ."-". $i ."'>". $temp->subject ."</a></li>";
?>
but i'm not sure how to fix it.

BTW it would be great if You put two strings into t() function:

Nothing here.
Error! click here!
Please config the tab title here.

i can put it into separate issue (task) if You want. If i find time I can write this piece of code for You.

#3

I can have the title translated. (see attached.)

You manually entered that block's title?

AttachmentSize
tabbed_block-multi-lang-title.png 4.53 KB

#4

I have problem with block made via Views with title added on block configuration page.

Although i was trying to add blocks manually, but it is not working for me too. I'm still testing it.

With which option did You add Your blocks?
- All languages
- All languages (Translatable)

#5

What are these?
- All languages
- All languages (Translatable)

try the attached patch. It basically remove the "&", and add a t() to the title. You can search the views block title string in translation interface, then add a translation.

It works on my localhost.

AttachmentSize
translation-in-title-#1061230-5.patch 1.35 KB

#6

- All languages
- All languages (Translatable)
Block option (admin/build/block > configure) - appears along with i18n module.

I can't get the attachment (it redirects me to the front page).

Still testing..

EDIT: ok, i have more info :)

i managed to do this work with views by adding title directly to the views (not to the block) and then translate it. (as You said)
in addition:
in tabbed_block_output_content_block() after module_invoke my $block->subject was empty so the title was taken from database (tmp[title]). This value was taken from block table - so it was correct but wasn't translated.

It should be fixed (name should be taken from views first and IF given in block configuration the name from block should be taken) or at least there should be an info somewhere that multilanguage blocks made with views should have name/title added in views not manually in blocks. (othwerwise it won't be translated).

Of course it is my thesis. It would be nice if someone review it.

I will gladly help you testing Your patch, but as i said - i can't download it.

Greetings,
Naiya

#7

attach patch again. I am stupid to use # in file name.

AttachmentSize
translation-in-title-1061230-5.patch 1.35 KB

#8

hi, sorry so late..

form_state is ok .

i started testing translation but i want to be sure - please be patient (i have critical issues here with my project).