Hi,
I haven't used the module yet, but it seems interesting.
I would like to know if it is, or would be, possible to translate block titles using this approach?
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | imag-1.jpg | 14.76 KB | truyenle |
| #19 | image-2.jpg | 62.16 KB | truyenle |
| #19 | image-3.jpg | 30.79 KB | truyenle |
| #14 | screens1.jpg | 250.37 KB | agill |
Comments
Comment #1
andy inman commentedWhat block(s)? For example a "custom block" could use LS to show some language-dependent content, but the block title can't be set. Is that what you mean? I think that could be done with a fairly simple extra module.
Comment #2
j0nathan commentedHi netgenius,
This is what I mean :)
Comment #3
andy inman commentedOk, it seems like a good idea so I am trying to produce a small module to do it.
Comment #4
andy inman commentedSee latest version!
Comment #5
andy inman commentedComment #6
andy inman commentedComment #7
andy inman commentedComment #8
j0nathan commentedHi netgenius
That was quick. I'll try it on a site on the next days.
Thank you very much.
Comment #10
truyenle commentedThe module Language Section Titles does conflict with Rotor (Rotor banner). Whenever I enable Language Section Titles -> Views created by Rotor disappear.
In addition, how to use the Language Sections Block Title to translate the custom block?
Place the
=en=
English
=it=
Italian
Under the custom block title ???
And then go to Site Configuration -> Input format -> Select the appropriate input format and check the Language Section checkbox?
It doesn't work for me this way.
Truyen
Comment #11
andy inman commentedRotor compatibility
I haven't used Rotor. Please raise this issue with the Rotor maintainers - LS Block Titles may be at fault, and if so I would guess it's due to the theme hook ...
... but I can't see anything wrong with it.
Setting block title
Here's the example from http://drupal.org/project/ls_extras ...
=== en ===
Title: This is the Title in English
Here is the English text.
=== fr ===
Title: This is the Title in French
Here is the French text.
So, you need to include a Title: line.
Comment #12
truyenle commentedThank you so much netgenius.
Rotor compatibility: I'll report to rotor maintainer also.
Setting block title: So you mean place these
=== en ===
Title: This is the Title in English
Here is the English text.
=== fr ===
Title: This is the Title in French
Here is the French text.
in the Block title field of the block? I try it and it doesn't work.
Truyenle
Comment #13
andy inman commentedOk, if it doesn't work I suppose it's due to a conflict with some other module. Could you try disabling Rotor, or maybe install a test Drupal site with as few modules as possible?
Comment #14
agill commentedi have the same problem using the newest version. Input filters are set, but whatever i do, in every view: node, view, block(so not only block titles)
it only shows "==en== Departure ==de== Abreise"
*edit* nevermind, the problem was sitting in front of the monitor this time. i noticed i had the textfields of my
content types set to plain text and because of that no filters were used.
Comment #15
andy inman commentedOoops... try:
title: This is the title
My example, with "Title" (capital T) may be wrong - actually I can't remember if it's case-sensitive or not, need to check!
EDIT: Checked, it is not case sensitive, you can use title, Title, TITLE, etc.
Comment #16
truyenle commentednetgenius,
I did try with a sandbox of not rotor and create a new block and place these in the block body
=== en ===
Title: abc
Testing
=== es ===
Title: cde
Testing
But then the block is show both version in either languages (English + Spanish).
P/S: I enable the modules, set the Input format, etc and also change Title to title (case sensitive).
Truyenle
Comment #17
andy inman commentedJust a note, please check you are using the latest releases OR the current dev releases of both modules (Language Sections and LS Extras.) I notice you've shown 6.x-1.1 here as the version of LS Extras. EDIT: Ah, ok that was the version when this thread was originally created - what versions are you using?
Comment #18
andy inman commentedThis may be related to a bug in version - 1.8. Please try the dev version, or 1.9 which will be released shortly. EDIT: No, I don't think that's relevant.
Comment #19
truyenle commentedNetgenius,
I just give 1.9 a try and here is what I did.
I got a custom block called Mission A. I use the PHP Code for the Block body.
So in the Block Title -> Leave it empty
in the Block Body I have:
I did go to Input format and check Language Sections for PHP Code. I even move Language Sections above PHP evaluator.
See image for more illustration.
It doesn't work. did I do anything wrong or miss any step?
Thanks
Truyenle
Comment #20
andy inman commentedI guess you have a reason for using PHP rather than plain text, but I suggest you test with plain text, and then write PHP to create the required text.
For example, create a new Input Format for testing using nothing except Language Sections (and Line Break Converter, maybe). Then:
This works fine on my tests. After you have that working, you just need to write PHP to create the same text.
In any case, if you use PHP, you will need the PHP filter *before* (above) Language Sections in the processing order, becuase the PHP filter has to create the output which LS will then process.
I think you will need to print and a space (or end of line) when using PHP to separate each section (I'm not sure without checking.) e.g. add '\r\n' to your print statements.
Comment #21
andy inman commentedFurther info... here's a PHP example that works (with a simple input format of just PHP filter then Language Sections) ...
I confirmed you do need to add at least "\n" to the end of the *title* line. This is described on the LS Extras project page as It can be on any line in the section, but must be positioned at the start of a line - the title part must be a single line.
There are many other ways you could do this.
So, I suggest:
1. Disable the Rotor module (to confirm that it is not interfering).
2. Create a working example using text.
3. Convert it to a PHP equivalent (if you need to use PHP)
4. Re-enable the Rotor module and test.
Comment #22
truyenle commentedHi netgenius,
the code in #21 work for me. Thank you so much.
Truyenle
Comment #23
andy inman commentedcool!