Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I am using marinelli on a multilingual drupal7 website with internationalization module, including the nice marinelli rotating banner feature.
Is it possible to support multilingual title and description for the banner images?
Regards
Comment | File | Size | Author |
---|---|---|---|
#13 | multilanguage_banners-issue_1094284_vs-7.x-3.0-beta11.patch | 930 bytes | sd2k9 |
Comments
Comment #1
Lioz CreditAttribution: Lioz commentedhi maryp!
use this code in banners.inc for marinelli_banner_markup function
let me know if this solves the problem!
Comment #2
cim CreditAttribution: cim commentedHi Lioz, I've used the code above. But where can I set the translations?
Comment #3
mdshields CreditAttribution: mdshields commenteddid you find out how this is to be translated?
I am making an assumption that the updated code included a t(...) wrapper around the text.
Once that is in place, the wrapped text then is included into the translation block. Which is pulled when striking the translation footer block that is provided with the translation module. This doesn't allow for node level translation. I am making these assumptions while I try it out. Will let you know if this is correct (this isn't documented anywhere on how to theme into translations whether supported by block, node or separately).
Comment #4
yamil CreditAttribution: yamil commentedThe code below worked for me. The strings are created automatically, you should only switch language. The strings can be translate in the translate interface. You don't worry for XSS. The variables aren't texts that a user entered.
http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/t/7
Comment #5
Lioz CreditAttribution: Lioz commentedComment #6
dangelmut CreditAttribution: dangelmut commentedI added some changes to make it possible to use a different image_url and image_path for each language too. So if the image shows some text it is possible to show it in different languages. And the user will be directed to the proper url for his language.
The code would be:
I'm a newbie so I don't know how, but I think that it is possible to automatically traslate the URL of the link (image_url). For example, this is one of my spanish articles http://www.soslabview.com.ar/es/biblioteaca-aes-labview and this is the english version http://www.soslabview.com.ar/en/aes-library-labview
If I didn't change the image_url every visitor would go to the first link, but as his language would be different than the url's language, he would get a 404. I mean, try for example http://www.soslabview.com.ar/en/biblioteaca-aes-labview
and you will see.
Take a look at my rotating banners and see what happens if you change language to see what I'm talking about (see how the language of the text in the picture of the AES banner changes, because image is different).
Comment #8
leventdal CreditAttribution: leventdal commentedHi,
I am using 3.0 beta11 and as far as I've seen the code implemantation mentioned above is implemented already.
My problem is even if I switch languages when i change the banner title from "Apperance" it effects all languages. I don't see a translation possibility in the banner description page when I switch language.
I've tried refreshing strings, clearing cache but didn't help.
In the translation interface I see the text that I've entered. I've translated it and it still doesn't work.
And when i change the text, the altered string isn't added to the strings to be translated area despite the fact that I refresh strings and clear the cache.
Regards,
Note: my site is not live right now. So I won't be able to show an example.
Info: English is not source language in my site.
I'm using "session" to determine the language of the site.
Comment #9
paweld CreditAttribution: paweld commentedHi,
I'm afraid it doesn't work. Every change of title, etc. in one language changes it in the same way in other languages.
Comment #10
adwordvietnam CreditAttribution: adwordvietnam commentedHi Lioz,
I am using 3.0 beta11 or update banners.inc, but cannot translate banners and description (both languages are same content, not translate)
Best regards,
Comment #11
sd2k9 CreditAttribution: sd2k9 commentedThe fix currently implemented in beta11 is unfortunately wrong.
You need to implement the code in #1094284-6: Multilingual support for banner title and description by yourself.
How to do the translation afterwards
- Write in English when uploading the banner images.
- Change the language once to generate the strings to be translated
- Translate the text in the "Translate interface"
URL: admin/config/regional/translate/translate
With the implementation in beta11 you can only translate the verbatim strings
"@image_desc" and "@image_title". This is not what you want :-)
With the manual change from #1094284-6: Multilingual support for banner title and description I was able to translate my banner titles.
Beside this small issue (which tought me a lot about Drupal translation internals) - thanks for the great
theme! I really enjoy it.
Comment #12
webmaster-eddie CreditAttribution: webmaster-eddie commentedWell the link in # 11 takes me to # 6, above, and it does not work. When you look at that guy's pages, the banner text is always in english, whether the page is in spanish or english.
This issue is NOT fixed, even if it were to work, the issue isn't fixed, as the modification is not in the latest beta release - and with the next marinelli upgrade, any changes made to the file will be written over...
Would someone answer clearly - is multilingual support for the 2 different strings of text for each marinelli 7 banner planned (without having to modify a file by hand) or not, please?
Comment #13
sd2k9 CreditAttribution: sd2k9 commentedHi webmaster-eddie,
I am attaching the patch I am using, which applies versus 7.x-3.0-beta11
Usage instructions are already given in #11
If you have trouble to get it running just let me know and I try to help.
For myself it's fine.
Maybe not the most elegant solution, but working as expected.
Cheers!
Comment #14
JeniferTucker CreditAttribution: JeniferTucker commented#13 worked for me, thanks sd2k9 :-)
You can now add tranlations to Marinelli banners.
Select theme settings.
www.example.com/admin/appearance/settings/[sub-theme]
Banner management.
Upload a new banner with title/description (if no banners images in place).
Save configuration.
Switch language to generate the strings to be translated.
Translate the text in the "Translate interface".
www.example.com/admin/config/regional/translate/translate
Use the 'Filter translatable strings' to find the text you want to translate.
Click on 'edit' under 'operations'.
Add translated text.
Click on 'Save translations'.
Comment #15
Fiable.biz CreditAttribution: Fiable.biz commentedHello. Thank you for your useful contributions. It used to work: I added the translation into Mongolian a while ago. Now I added the French language, but the strings don't appear in admin/config/regional/translate/translate any more. In what group are they supposed to appear?