In block configuration, there is a locale selection tab, but no translation tab. So, we only can use one language for block title, instead translate it depending currently selected language? I mean, I choose English in locale and input title, that title will be used for all language.
Am I wrong in using block translation? Do I miss some settings?
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | block-locale-0.patch | 528 bytes | Cybso |
Comments
Comment #1
huayen commentedI read the document, which says that "Blocks can be associated with particular languages".
So, for block, we can not make it bilingual, right?
Comment #2
edinjapan commentedYour assessment is correct.
In the current implementation of Localizer, you can create a block, and then when you configure it, you can set a locale for display. The block will only display in the selected locale. The point of this feature is to let different blocks be displayed when different languages are set, not the same block with different languages.
So, a block can only be associated with one locale, and cannot be translated. If you need the same block content in another language, you will need to create another block in the other language and associate it with that locale.
Comment #3
huayen commented[blockquote]you can create a block, and then when you configure it, you can set a locale for display. The block will only display in the selected locale.[blockquote]
I don't think the module works in this way. After I read your reply, I tried again, the block I configured to English locale still shows in Japanese locale...
Comment #4
edinjapan commentedHi huayen,
I have re-verified that this is the way it should work. I'm not exactly sure why your troubles are occuring. Can you please check/try the following? (Although this issue was posted as regarding 5.x-1.x-dev,I have assumed you are using Drupal 5.1, Localizer 5.x-1.7. I have changed the related version on this issue to match this. Please change it back if it is incorrect.)
Let me know what happens. If you want to take this offline, you can send me an email from my profile node. http://drupal.org/user/93820
Comment #5
huayen commentedHello EdInJapan,
Thank you very much for the reply.
(1) I used patch command in installation.
I re-created blocks exactly according to (2) and (3), but still same problem. Now I have to use PHP return check to set the block visibility based on current locale.
Comment #6
Mini_me-1 commentedI have the same issue. My blocks working exactly as written "In the current implementation of Localizer, you can create a block, and then when you configure it, you can set a locale for display. The block will only display in the selected locale. The point of this feature is to let different blocks be displayed when different languages are set, not the same block with different languages. So, a block can only be associated with one locale, and cannot be translated. If you need the same block content in another language, you will need to create another block in the other language and associate it with that locale."
Is it possible some how to make block title display according to selected language. Because I have blocks which are come from the view. These blocks have "More" link. And I have to create to completely same views but with different links. I think that it is not the best way to make block title translated :)
Is there some workaround?
Comment #7
huayen commentedNow it's working now after I switch to another theme.
However, I still prefer to use php code to define block title in following way:
----------------
*****
} else if ($locale=='lang2') {#####
}----------------
This is much easier than defining two custom blocks.
However there are still some blocks coming with module installation (manage string in localization does not work for this case)
Comment #8
Roberto Gerola commentedI'll take a look t change the block translation mechanism.
Not using the localizerblock table but the localizertranslation
table instead and a translation interface similar to that implemented
for menu and taxonomy.
Comment #9
giorgoskif "block title translation" is the only issue (as the title of the issue indicates)
all you need is wrap the block title in t()
in your block.tpl.php in your theme's folder
and then
after viewing the block so that t() functions flags the title for translation (<-IMPORTANT)
look in your "locale > translate strings" for the string to translate
Comment #10
Roberto Gerola commentedIf we want translates only titles of the blocks, I need to patch the block.module.
Comment #11
sun@roberto: Regarding #8, we've converted localizerblock to use the localizertranslation table already. Will be part of Localizer 2.x which we plan to commit within the next days.
@kongeo: Using t() for block titles is simply overkill.
Try this instead:
Comment #12
sunPlease test the new version 2.x. Feel free to re-open this issue if it is not yet fixed.
Comment #13
(not verified) commentedComment #14
Cybso commentedThe changes as unified diff.