1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » [ask] different widget title in each language?
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1208 Views |
-
[ask] different widget title in each language?

27 June 2010 at 1:05pm Last edited: 18 January 2012 7:55am
haloo...
how can i set widget title in different language?
as this far i can understand that each widget title is set from mysite/code/my_widget.php in line :static $title = 'Widget Title';
my default site is indonesian, and I make it bilingual (Indonesian & English)
I want each widget title is automatically changed when I choose mysite.com/?locale=en_UScould it be possible?
(sorry for my bad english... ;D) -
Re: [ask] different widget title in each language?

23 July 2010 at 4:01am Last edited: 18 January 2012 7:55am
Form the Blogmodul i used the SubscribeRSSWidget.
The Headline of the widget is 'Subscribe via RSS', because its defined in line 12.static $title = 'Subscribe via RSS';
To get a german Widget-headline i put an additional function into blog/code/widgets/SubscribeRSSWidget.php
(maybe there is a better way without touching the original blogmodul files)function Title() {
return _t("Widget.SUBSCRIBEVIARSS",self::$title);
}So you need an entry in your language file, in my case:
$lang['de_DE']['Widget']['SUBSCRIBEVIARSS'] = "News als RSS-Feed";
in mysite/lang/de_DE -
Re: [ask] different widget title in each language?

18 January 2012 at 4:09am Last edited: 18 January 2012 7:55am
thanks for the hack..
since this is an old post, I'm wondering if you came up with a better solution?thanks
-
Re: [ask] different widget title in each language?

18 January 2012 at 4:58am Last edited: 18 January 2012 7:55am
This is how I did it...
http://www.silverstripe.org/widgets-2/show/11375?start=8 -
Re: [ask] different widget title in each language?

18 January 2012 at 5:15am Last edited: 18 January 2012 7:55am
how can I translate the widget title with the solution you provided?
-
Re: [ask] different widget title in each language?

18 January 2012 at 6:35am Last edited: 18 January 2012 7:55am
The same way the page title changes when using translatable is enabled - the widget will only show on the translated version of the widget - rather than the same widget for each page.
-
Re: [ask] different widget title in each language?

18 January 2012 at 7:51am Last edited: 18 January 2012 7:55am
still there is no field in the cms where I can translate the blog widget title, and if you mean the language file for blog I just looked at it and there is no entry for the widget title as the title is hard coded.. can you explain to me how did you translate the blog widgets?
-
Re: [ask] different widget title in each language?

18 January 2012 at 7:55am Last edited: 18 January 2012 7:55am
ok, I'm sorry I have scanned this and given an answer as how to translate a widget which is what it appeared to be asking for - I don't use the blog module widget. Instead I will move this thread to that area since the question is actually more specfic.
| 1208 Views | ||
|
Page:
1
|
Go to Top |




